Hi, thanks belfegor and JasonZ, both of your sources have been great. I actually realised that my book 'Intro to DirectX 9.0c - A Shader Approach' has an EnvMap section. I think I have created a good EnvMap shader, but I just haven't got my program rendering to the cube map properly yet. Why can't there be a nice D3DX function to render to each face for you based on a specified 'up' direction and a chosen field of view for each face... ah well, I'll post a nice screenshot when it works
Yeah, the refraction map is built in realtime so I can't tweak the pictures manually. I am thinking that the easiest ways are:
- Clear the render targets to a specific colour, and if the sampled colour is equal to the specified colour in the shader, I know that the sampling has overspilled and I should choose another coordinate.
- Find the depth of each pixel in the refraction/reflection maps and lerp the sampling offset based on the distance of the pixel below the plane. That would kinda work because in real life, if there is more water between you and the object, there will be more refraction.