|
This is a demo was created in my own custom platform independent engine using C++ and OpenGL. A simple demo showcasing reflection and refraction using a dynamic cube map
In this demo I dynamically create all six images that represent each face of the cube map. The first step is taking the camera and orientating it to the axis that matches the current face. Then I render each image into a render target texture. Once all the six images for each face is created we can bind all six texture resources and perform the cube map sampling. Note that this demo does not use the supported OpenGL cube map functionality and it is all done manually in my shader. Then finally when I render my sphere object it is then applied the reflection and refraction calculation and seen in the demo above. Note that I put some red sphere in the scene to show that the cube map is dynamic.
In this demo I dynamically create all six images that represent each face of the cube map. The first step is taking the camera and orientating it to the axis that matches the current face. Then I render each image into a render target texture. Once all the six images for each face is created we can bind all six texture resources and perform the cube map sampling. Note that this demo does not use the supported OpenGL cube map functionality and it is all done manually in my shader. Then finally when I render my sphere object it is then applied the reflection and refraction calculation and seen in the demo above. Note that I put some red sphere in the scene to show that the cube map is dynamic.
Features:
|