Saturday, November 23, 2013

Reflection, Refraction using CubeMapping.

Reflection, Refraction is fairly easy in OpenGL using both Shader and normal OpenGL pipeline. Today I tried both the classical method of Reflection Mapping and also using shaders.
The main objective of today's work was to render shiny Metals and Glass. The shiny metal needed a simple reflection mapping. The result is shown in the figure below:





Then I tried simple refraction mapping as well. To render glass, I needed both reflection as well as refraction. So, I mixed both reflection and refraction for my object.
Here is the ouput:



Note: I have used static Mapping techine.

For additional refrences you can follow this site: Cube Maps: Sky Boxes and Environment Mapping

The source code for the shaders used in above program are uploaded on my github: GLSL Source Code
Hope it helps :)

0 comments:

Post a Comment