View Full Version : Reflection effect
04-10-2011, 09:51 AM
I'm new to OpenGL. I have a building model. And all windows on model need to be more realistic. First of all, i would like to implement reflection effect. I made some research on this issue and got confused :).
Can anybody suggest me what technique to use to achive reflection effects on building windows.
Thanks in advance...
04-11-2011, 01:08 AM
Presumably you will have more than one building. Simulating more than one set of 'true' reflections is not a trivial matter. For example, have you considered the case of a second building reflecting the first building and visa-versa. How many levels of inter-reflection should happen?
You also have not indicated just how accurate these reflections should be?
Most games simply do not bother with true reflections for this kind of thing as it's too complex in this general case which your describing. The answer is to cheat!
The best and simplest way to cheat is to use a cube map for reflection. This is nice and fast and you could have many of these scene reflection maps scattered throughout your level/scene. Your objects could then just 'select the nearest environment map' and use that as its source of reflection.
04-11-2011, 03:38 AM
Old stencil reflection is still good if your reflection happens only on a plane.
Check this: http://www.opengl.org/resources/code/samples/advanced/advanced97/notes/node90.html
04-11-2011, 03:44 AM
Yes planar refelections will give you an accurate reflection - at the cost of re-rendering your scene.
How you go about multiple planar refelctions for each building, or sides of a building is another matter!
Hence my suggestion of environment cube mapping.
04-12-2011, 01:40 AM
Thanks for reply.
How should i organize environment cube maps in case if i have a city model and when all windows on buildings should be with reflection effect?
04-12-2011, 02:07 AM
Start by having just 1 set of cube maps and get that applied to each window.
Are you using shaders - because this sort of thing is trivial with shaders and not so easy with fixed function rendering.
I suggest a Google search on cube mapping - nVidia developer web site has some basic example if I recall.
You first need to know how to load the 6 face images and create a cube map texture. Then you need to know how to render a cube map. After that, you'll need to combine the glass texture of your building(s) with the cube map.
Easy via shaders.....
04-12-2011, 03:12 AM
Well, then i'll keep learning...
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.