Original Post
Hey everyone,
I've been working on a personal 3D "game engine" for several months now, for learning purposes mainly.
My engine is split into two separate libraries : core and game.
Core is the low level wrappers and classes which abstract specifics APIs (such as directX for graphics, FMod for sound, etc.) into a unified system to use for high level components. This part is pretty much complete, and I have something I am happy to work with, and which offers all the components required for rendering ( primitive drawing, texturing, shader handling, etc.), gathering input, as well as managing memory and resources.
Now lately, I have been focusing on the game part, which is supposed to feature high level components, such as scene management components (octrees, scene graphs, whatever you like), state management (game states), and the rendering pipeline.
I have made several attempts at designing my rendering pipeline, from the dirty/naive rendering system within scene nodes (with simple "render()" calls), to attempting to have a unified system ( specific render managers for meshes, particles, etc, which receive basic data prior to rendering, and treat it later on) which I then turned into a deferred rendering pipeline. Unfortunately, I haven't been able to find a way which I found elegant and modular/flexible enough.
I have been reading through the forums, and gathered a few techniques and designs on providing the data, such as cbuffers, or render managers which expect pre-defined structures (similar to what I attempted with my deferred renderer), but I have found very little information on what the code looks like and how it links up with the pipeline (with shading, shadowing, post-processing effects, etc.).
---------------
Would you happen to know where I could find resources on an actual pipeline? I understand the principle of the techniques mentioned above, however, I do not understand how they actually relate to the complete process.
In my deferred rendering design, I essentially had several render managers which would take a list of pre-defined structures, and were able to output a render something. Basically my main RenderManager would allocate RenderInstances on demand (which could be of type RenderMeshInstances for meshes, expecting a mesh, matrices, and materials), and register it, so that during the actual rendering of the scene, the instance can be dispatched to its corresponding manager (in that case RenderMeshManager), which actually performs the job.
Now this method worked pretty well for a bit, since I could centralize rendering, however, as soon as I attempt to add an extra stage (say shadowing), I am lost. I thought I could potentially add a new RenderShadowManager, and its corresponding RenderShadowInstance which would require the mesh to be registered twice (once for default rendering, and once for shadowing). In effect that could work, but I hardly imagine it being viable once I start to add more effects and having to explicitely re-register instances for particular effects.
How did you guys design your rendering pipeline ? Is it monolithic ? Has someone of you managed to design it in a somewhat modular and dynamic fashion (e.g. allowing post-effects to be stacked on the fly at runtime, or new stages to be injected, without further changes, based on existing info : for instance a mesh might still register for an AO pass)?
Does it sound wrong to have to hardcode parts of the pipeline like I did? I have had a look at several engines/frameworks, such as Torque3D, Irrlicht, Ogre (which I know the less about), and they all seem to have to do it to some level. Am I delusionial to think a pipeline can be modular? Should I just drop it and design a fixed pipeline revolving around my game's needs?
Thanks in advance for your input and advice !!
I've been working on a personal 3D "game engine" for several months now, for learning purposes mainly.
My engine is split into two separate libraries : core and game.
Core is the low level wrappers and classes which abstract specifics APIs (such as directX for graphics, FMod for sound, etc.) into a unified system to use for high level components. This part is pretty much complete, and I have something I am happy to work with, and which offers all the components required for rendering ( primitive drawing, texturing, shader handling, etc.), gathering input, as well as managing memory and resources.
Now lately, I have been focusing on the game part, which is supposed to feature high level components, such as scene management components (octrees, scene graphs, whatever you like), state management (game states), and the rendering pipeline.
I have made several attempts at designing my rendering pipeline, from the dirty/naive rendering system within scene nodes (with simple "render()" calls), to attempting to have a unified system ( specific render managers for meshes, particles, etc, which receive basic data prior to rendering, and treat it later on) which I then turned into a deferred rendering pipeline. Unfortunately, I haven't been able to find a way which I found elegant and modular/flexible enough.
I have been reading through the forums, and gathered a few techniques and designs on providing the data, such as cbuffers, or render managers which expect pre-defined structures (similar to what I attempted with my deferred renderer), but I have found very little information on what the code looks like and how it links up with the pipeline (with shading, shadowing, post-processing effects, etc.).
---------------
Would you happen to know where I could find resources on an actual pipeline? I understand the principle of the techniques mentioned above, however, I do not understand how they actually relate to the complete process.
In my deferred rendering design, I essentially had several render managers which would take a list of pre-defined structures, and were able to output a render something. Basically my main RenderManager would allocate RenderInstances on demand (which could be of type RenderMeshInstances for meshes, expecting a mesh, matrices, and materials), and register it, so that during the actual rendering of the scene, the instance can be dispatched to its corresponding manager (in that case RenderMeshManager), which actually performs the job.
Now this method worked pretty well for a bit, since I could centralize rendering, however, as soon as I attempt to add an extra stage (say shadowing), I am lost. I thought I could potentially add a new RenderShadowManager, and its corresponding RenderShadowInstance which would require the mesh to be registered twice (once for default rendering, and once for shadowing). In effect that could work, but I hardly imagine it being viable once I start to add more effects and having to explicitely re-register instances for particular effects.
How did you guys design your rendering pipeline ? Is it monolithic ? Has someone of you managed to design it in a somewhat modular and dynamic fashion (e.g. allowing post-effects to be stacked on the fly at runtime, or new stages to be injected, without further changes, based on existing info : for instance a mesh might still register for an AO pass)?
Does it sound wrong to have to hardcode parts of the pipeline like I did? I have had a look at several engines/frameworks, such as Torque3D, Irrlicht, Ogre (which I know the less about), and they all seem to have to do it to some level. Am I delusionial to think a pipeline can be modular? Should I just drop it and design a fixed pipeline revolving around my game's needs?
Thanks in advance for your input and advice !!