top of page
Szukaj
  • marcindziedzic

Cubemaps: skybox and reflections

I have added cubemap textures to the framework. It is treated like standard texture, with this difference we specify not one, but six bitmaps and choose CubeMap texture type. Cubemaps are special textures. The difference between cube maps and other texture types (1D, 2D or 3D) is that we do not specify texture's fragment by position of this fragment on the texture, but by direction. We can imagine rendered skybox (like on the video below) where we can look around and pick texture's fragment by pointing it with mouse. This is why it is so easy to calculate reflections or refractions. We can just reflect or refract our view direction and we get direction vector that points the fragment to be rendered.


Presented effects are not too amazing, because I didn't want to fight too long with visual effects, when my purpose was to just implement cubemap textures. If someone is wondering how to achieve this animated comparison of effects, it is just one tricky if statement with some random values and functions in fragment shader :D I won't show it because it's ugly and useless for every other case ;)



4 wyświetlenia0 komentarzy

Ostatnie posty

Zobacz wszystkie
bottom of page