🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Reflection( reflection( reflection( ... ) ) )

Published October 04, 2008
Advertisement
What is your engine supposed to be to you?

One of the long term goals that I had for my rendering engine was to make it:

1. Flexible
2. Capable
3. Easy to use

The first two kind of go together - I wanted to be able to implement just about any algorithm in the engine (flexibility) and I wanted to be able to use all of the power that a given hardware platform could deliver (capability). The last goal is (I think) often overlooked - what good is a fancy engine if it takes you a week to implement any new abilities or techniques?

To that end, I completed my material system yesterday and I can't be happier with it - all three goals have been satisfied!


Recursive Reflection with Rasterized Rendering

To celebrate, I decided to put together the first major rendering technique in the new system. I've always been a fan of the paraboloid parameterization, and shiny things are usually fun to look at so paraboloid environment mapping was a natural choice. I've done this type of env. mapping before, so getting a single mirrored sphere up and running wasn't too much trouble. But what happens when you put two (or more) spheres near to each other in a scene? It turns out that the new material system was designed to handle recursive style rendering like this...

The details of the system will take up another post, but the concept is to give each entity an opportunity to 'PreRender' any render views that it needs prior to it being rendered itself. As long as you make this 'PreRender' function recursive and reentrant, then you can allow the system to recursively perform all of the rendering needed to put a scene together. Here's a simple example from my environment mapping tests:



Here you can see four reflecting spheres, each with an independant set of paraboloid maps. Look closely at the 'reflected' versions of each of the sphere's that appear within the other spheres - there is indeed mini-versions the scene within the mini-versions of the scene recursively until there is no way to discern anything smaller (i.e. the pixel resolution becomes too rough to represent the recursive image).

The best part of this is that this demo runs at 80+ FPS on a laptop graphics card (GeForce 8600M GT) without any optimizations. [grin] Here are some additional shots to check out.





More information on the details of the material system are sure to follow...
Previous Entry School impeding progress!
Next Entry Documentation
0 likes 4 comments

Comments

glaeken
Looking good!

How are you handling the seams where the front and back maps meet? I can't see any in the reflections. Are you just carefully choosing the dividing plane?
October 08, 2008 06:51 PM
Jason Z
It's actually just a constant offset provided for each of the two half spaces - instead of separating by the z = 0 plane, I'm just using z = -0.05 for the front and z = 0.05 for the back.

It's crude, but it works.
October 08, 2008 09:23 PM
glaeken
Hmmm. Looks like it works pretty well :)
October 10, 2008 04:08 PM
cowness
Impressive... very nice, cant wait for the details though...
October 12, 2008 12:12 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement