Sign in to follow this  
Endar

letting the engine know about special rendering

Recommended Posts

I've just got some basic reflection code working in OGL, and I've come up with a little bit of a roadblock. I wanted to implement the reflection as a material that can be applied to an object. I'm not really sure about that, but something else I was wondering about is that how can we let the engine know about something like this? Because the scene should be rendered once for each reflective surface, right (at least in my very very very simple reflective demo from NeHe)? So, would we have a list somewhere else and add references (pointer, whatever) to the objects that need to be rendered for reflections, and then render the scene once for each of them, resetting the settings each time for the new reflective surface?

Share this post


Link to post
Share on other sites
Yes you need to render the scene multiple times.

For a simple implementation then simply storing pointers to these materials as you suggested would be fine, but for a complex rendering engine if I might deffer you to Yann's shader implementation its a rather sophisticated solution, the bit of relevance is at the bottom of page 2 (with my board settings anyway) but you would probably need to read everything up to that point several times to fully understand it.

Share this post


Link to post
Share on other sites
Quote:
Original post by dawidjoubert
How are you rendering reflections, stencil buffer or texture?


I'm using the stencil buffer.

Quote:
Original post by dmatter
Yes you need to render the scene multiple times.

For a simple implementation then simply storing pointers to these materials as you suggested would be fine, but for a complex rendering engine if I might deffer you to Yann's shader implementation its a rather sophisticated solution, the bit of relevance is at the bottom of page 2 (with my board settings anyway) but you would probably need to read everything up to that point several times to fully understand it.


Thanks dmatter, I'll be reading that as soon as I get home from uni.

Share this post


Link to post
Share on other sites
You should also google for "Render Delegation". Take also a look here:
http://www.mine-control.com/zack/patterns/gamepatterns.html#renderdelegation
it will may be help you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this