Optimize rendering by rendering sub to texture #13947
BlackMoons
started this conversation in
Ideas and suggestions
Replies: 1 comment
-
I tried to do that, but i can't comprehend basic math so i left it |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Why not render most of the submarine to texture?
It seems like much of the game could be simplified down to above/below player and 'dynamic middle zone'. And then much of the submarine could be drawn in a single draw call.
For example, all the background walls/fins/etc of the submarine never change and can't even take damage. They could all be rendered to a texture at the start of a round. Maybe reserve the depth of 1 to 0.9 for that purpose since layering dynamic/static content is going to be tricky if there is any transparency. Only the submarine walls (takes damage) and the few animated components really need to be rendered per-frame.
Logic components and wiring could also likely be moved to this layer too, since changes in wiring typically are less then a few occurrences per round. (leave the animated dangling wire to the current system)
Since the entire wiring by default is at one depth, it could even be its own texture (so long as you don't check 'use sprite depth' on the wire), requiring less work to render it whenever it changes.
Pixels that are outside the screen are culled very early in the pipeline, so you don't need to do any special culling when rendering this giant texture either.
Beta Was this translation helpful? Give feedback.
All reactions