at some point i should really clean up my use of shaders

right now each system has its own shader that it owns and all rendering code is controlled by that system

but obviously that means for N systems we have N shaders which means N gpu state changes

which is bad and it sucks

but fixing it means I have to generalize the shaders I have and consolidate them together in a way that makes sense and is efficient and also still adheres to the systems-first procedural approach I've been doing

likely it'll just be moving the generalized shaders to be part of the graphics system, and maybe maybe some sort of a map of shader->queue<drawn_obj> which is then iterated through each frame in the graphics system to minimize swapping shaders
maybe it should be more like

shader -> queue<callback>

that way things are still organized by shader, but the callback can be owned by the system and control uniforms and anything else it needs
on the other hand, I could just have all the renderable things do their Render() call in Graphics::Update() in the correct order and it becomes implicit and all the bookkeeping is done in the program text itself
this feels most correct i think i should do this
Follow

@binkle I am but a filthy webdev, so I trust your judgement.

· · Web · 0 · 0 · 1
Sign in to participate in the conversation
Merovingian Club

A club for red-pilled exiles.