Refactoring the rendering…
Yep, that’s what I’m doing… It will be a bit painful and I’ll get a lot of bugs in the process, but I think it’s the best thing at this moment…
Currently, the rendering is working in a per-pass/per-object basis…
So, first we get the solid pass, iterate objects, render all of them (and they will check if they should be render in the current pass), then go to the alpha pass, etc, etc…
What I want to do is a “object pre-pass”… So I gather all the objects/meshes/render elements in a single array, with some metadata on their usage, conditions and rules (I don’t want lighting on this object, I don’t want to do decals on this one, etc), and then on the render pass I’ll iterate this array and should be drawn or not, rendering as intended…
The idea on this is to save some CPU power (not much, I expect), but mainly so I can organize the render data according to my criteria, for example, to sort alpha objects back to front, and solid objects front to back, to exclude dynamic objects from decal rendering, draw these special effect objects after the decals are done, exclude objects from the depth/normal stage, etc…
It’s going to be a lot of work, but in the long run it will be fairly positive!
Now listening to “Sunset of the Golden Age” by Alestorm
Comment
You must be logged in to post a comment.