I am trying to create a realtime (not eevee) refraction shader which is using an environment map as input. I know that the world environment is the usual input for the refraction. But I want to create a realtime shader based on an indipendent environment map ( llike a light probe ).
So here is what I did:
- I created this test scene and rendered an environment map with the camera being at the center.
- I use this environment map as the color input for the diffuse shader to create a fake reflection.
- now i want the shader to look like refraction. So I am flipping the x-axis and rotate the scene so that the orientation is like when refracted. but of course now this is representing a strange IOR. The upper sphere is a real glass shader which is the way it should look (for glass).
In what way do I need to manipulate the vectors so that is looks like glass? It should be way more distorted.
I know that the game development is using these technique to create refraction effects. But all I could find were coded shaders to calculate the refraction. The must be a way to get this done by tweaking the vectors in my opinion. I just cant figure it out. It must not be 100% physically accurate. Most important is that it looks right.
Find also attached the blend file EnviroMapCreator.blend (4.1 MB)
Thanks so much for your help