Rubeus
Member
|
Render Modes
The rendering system is one of the few areas I'm having trouble understanding in EE. Maybe someone can help me understand a few things:
1) Renderer(Render);
This is used in the tutorials in the Draw call. Is there any benefit to this over using a standard call, like "Render()"? Or even just having the switch statement in the draw call? Playing with the Rendering tutorial, the sphere doesn't show up if the Renderer(Render); is not used, so it does something... but looking at the Bloody Massacre source, they use switch(Renderer()) right in their draw calls (see Bullet.cpp).
2) enum RENDER_MODE
This has a list of render modes, only about 1/2 of them have a good description as to what is drawn in that mode. The comments for shadows and prepare and a couple others are good enough to keep things functional, but I'm a little confused about where to draw things like post-process effects and the special effects like lasers and such. I can use the tutorials as examples for some, but they just don't cover all the modes. For instance, if I use a texture as a render target, and want to display it last, which mode do I use? If I draw it in RM_PREPARE, do I need to make sure it's drawn last so all objects show up on it?
I am operating under the assumption that the engine will cycle through each render mode in the order listed, but there seems to be more to it than just the order.
I want to make sure I understand what I am doing here before I create 50 objects, then realize I did it all wrong... Any help would be appreciated.
|
|
05-28-2012 03:31 PM |
|
Esenthel
Administrator
|
RE: Render Modes
1) please check the rendering tutorial carefully,
first you call Renderer(Render); // this initializes EE renderer with provided callback function, this is required for rendering
then inside that callback function you check the current render mode using the switch
2) where you can draw lasers that should be specified in the comments of the laser drawing function
if you want to use texture as render target, then check the render to texture tutorial, first you call rendering to the texture only, then once texture is ready, you perform standard rendering
|
|
05-29-2012 11:10 AM |
|
Rubeus
Member
|
RE: Render Modes
What I was really hung up on was the Render to texture part.
If I want to render several objects to the same texture, I have to either leave the texture as the default target for all the objects, or I have to create a grouping in some way to render them all to the texture at the same time, as fire as I know. Changing the render target back to default then to the texture again causes it to over-write the texture (instead of using a buffer or whatever).
Leaving the texture as the target seems like it wouldn't work, because it doesn't look like there is a way to dictate the draw order. Meaning some other objects might slip in between and show up on my pretty texture(Like the Cool-Aid man "Oh YEAH!").
I guess I'm going to be keeping a list of objects I want on the texture is going to have to be the way to do it.
The reason I was bringing this up is because the last engine I've really gone in-depth with had a single drawing phase, meaning if you drew a model after hud elements, it would look REALLY strange. Thus, there was a LOT of draw-ordering.
|
|
05-31-2012 06:35 PM |
|