Hi,
I'm working on a 2d project where I need to produce a refraction map for a rendered image, so that when it moves it deforms the pixels beneath it.
Say I have modelled a glass, and rendered a front view perspective view. In the project when this image is moved it needs to deform the background using a displacement calculation, and so I need to create a refraction map from this same camera.
I can sort of fake this effect with a manual normal map
setup, but was hoping to go one better, and get a better effect, by mapping how the rays are affected going through the object.
any ideas how I would accomplish this?
cheers!
Replies
Now. Using normal maps is pretty convenient way to get reflection and refraction effects. You can cast rays in pixel shader by sampling Glass normal map and adding this vector to the final texture coordinates. To make myself clear here is the example(You weren't specific about the environment so i assume you are making a shader):
Sorry I forgot to mention - I'm using 3ds max, unfortunately creating shaders are a bit beyond me at the moment, but def something I would look into if needs be.
So I guess if normal map is the way to go - how best do I add refractions from say ice cubes inside the glass?
cheers!