I have done multi pass-pass rendering, before, and understand how it works. I didmade a simple example, which rendered a basic scene with shadows. This was all done inpart of one file. Now, I am trying to figure out is how to put it into my game engine.
Currently, my game engine isuses a single pass. It is in a hierarchical structure, and uses Direct3D9Direct3D 9. I have a graphics component, which will load and draw a 3d3D model. In my game loop, I update all of the entities in the world, then I call the draw function for each one. This This draw function gets the vertex buffer, index buffer and texture/ or material, and draws the 3d3D model using a shader. This isworks fine.
To do multi pass-pass rendering, to allow for shadows say, I will need to draw each model multiple times. It doesn't seem right, to me, that in each models draw function I should put the 2ndsecond pass code ascode; this will then be completed before the next models 1stfirst pass. Does anyone know of any design solutions or places where I can find some more information about this?
I hope this question isn't too confusing, I have tried to explain what I currently have and whatHow should I would like to achieve to the best of my ability.
Regards,
MD.implement multi-pass rendering in a game engine?