Original Post
I recently received a question on my render view system, and figured I would share it with everyone if it might help anyone out. Here it is:
Quote:Hi HellRaiZer, I don't mind helping out - I didn't just wake up one day and understand what I was doing, lots of people have helped me out too!!! For question #1,
Hello Jason... First of all sorry for bothering you. If you think i should make a thread about this, then please say it. I'm trying to implement your RenderView system as you described it in this thread. Back then i thought that your approach was too generic but after working on my implementation i ended up doing things similar to what you described. So i thought i should give it a try to see what i come up with. I think i understand everything from your description, but i have a little question, if you don't mind answering. Quoting your definiton of the renderviews : Quote:The question is what happens with the other required inputs. You mention only render targets. But if a render view needs the scene, it has to get it from somewhere. But this is easy, if you keep a scene manager type of thing in your engine. But what happens with camera's? Let me explain. The main render view needs the current camera in order to render the scene. A cubemap render view needs the object's transformation for correctly placing the 6 cameras. A shadowmap rv needs the light's position and direction. The question is : Does the render view interface have entry points for configuring these things, or you have to know which render view you are using (in order to cast it) and you are calling special case functions (like SetCamera(), SetLight(), SetTransformation()). In your last post of the previously mentioned thread, you said :
The render views are built around the fact that you can set any input and output render targets for them to use, which enables you to link them together and chain multiple rendering algorithms together. Quote:What i'm trying to accomplish is a data-driven framework for configuring render-views. E.g. if i want a reflective object to use a dynamic cubemap, i should be able to specify this at the material level. This way i don't have to bother creating renderviews by hand after the object is loaded, and i can create new renderviews, without the need to inform the engine about it. Is this possible with your design? Thanks for reading this, and hope you find some time answering. HellRaiZer
The thing to keep in mind is that the overall system is not designed to be able to add a new effect, drop it anywhere and the system will handle it for you. Instead, it is generalized so that any algorithm can be implemented - but the programmer still has to make sure everything will work together.
Quote:I generalize the parameters into the shaders with three major categories: 1. Object parameters 2. View parameters 3. App parameters When I author a shader, I use the *.fx system in DX9. This allows you to specify semantics for each parameter, and I have defined the following allowed semantics: ObjectParm*, *=[0,7] ViewParm*, *=[0,7] AppParm*, *=[0,7] As the names imply the application sets an array of parameters in the renderer during the start of the rendering pass. Next, each renderview is rendered. This gives them a chance to set any ViewParms that they want. Finally, for each renderview, they render any visible objects. Each of the objects sets any of its ObjectParms before actually rendering its geometry. This gives three different levels of control to the shader parms. The app level is used for global constants, view is for renderview dependant parms, and object level is for per-object parms. So individual render views can set the appropriate parameters that they need. For question #2,
The question is : Does the render view interface have entry points for configuring these things, or you have to know which render view you are using (in order to cast it) and you are calling special case functions (like SetCamera(), SetLight(), SetTransformation()).
Quote:This is possible, you just have to come up with a way of linking a specific render view with a material. In my system the render views are actually created and maintained within the objects, but you could create a separate material system to abstract the render views out of the objects control. This would make the object call 'SetMaterial( int index )' and the material system would have to manage the render views and so on. It's not a bad idea - perhaps Hieroglyph 2.0 will add something like this... I will make a copy of this and post it in the Graphics forum for everyone to check out. If you have any questions just let me know!
What i'm trying to accomplish is a data-driven framework for configuring render-views. E.g. if i want a reflective object to use a dynamic cubemap, i should be able to specify this at the material level. This way i don't have to bother creating renderviews by hand after the object is loaded, and i can create new renderviews, without the need to inform the engine about it. Is this possible with your design?