letting the engine know about special rendering

Started by
3 comments, last by PERECil 17 years, 11 months ago
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?
[size="2"][size=2]Mort, Duke of Sto Helit: NON TIMETIS MESSOR -- Don't Fear The Reaper
Advertisement
How are you rendering reflections, stencil buffer or texture?
----------------------------

http://djoubert.co.uk
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.
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.
[size="2"][size=2]Mort, Duke of Sto Helit: NON TIMETIS MESSOR -- Don't Fear The Reaper
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.

This topic is closed to new replies.

Advertisement