Okay, yeah, I know, the filtering is rubbish, there is no lighting, the model is bad, blah blah!
The point is that I finally got models rendering again :) I had to refactor my shader constant system again. The template madness proved to be too mad... or should I say just too much maintenance work.
I've replaced it with a more simple system which requires less maintenance, but still works in a similar way. Render methods set up a series of default render states and shader constants, and make requests for any shader constants they have no knowledge of themself.
Render objects can then override states and supply shader constants (such as worl*view*projection matrix). The render method concerned alway has final say over what it receives though. If a render method knows that it's shader cannot handle certain values or states, it can set locks to prevent the overrides. So my 2D render method currently locks the z buffer to disabled for example.
All setting of render states is now neatly done in a single function per object type and is very low maintenance. It is very easy to create new types of renderobject and very easy to change how a given object is rendered. Mission accomplished.
Next thing I have to work on is speeding it up. It's currently only doing 26 frames per second :( I have no batching at the moment and this is a priority, as 26 FPS is just terrible. Mind you, I think I'm doing lots of unnecessary geometry building each frame, which is probably another quick and easy optimisation. I need to start flagging geometry builds only when geometry has been updated.
Then I need to get things looking a little less rough around the edges and hopefully at that point I can start loking at beginning my prototype :)
Cheers,
Steve
I'm sure I missed it somewhere, but what kind of game are you making?