I've read a little more of your code. I removed the "FRESNEL effect". I don't have the effect anymore. But the refraction is good now.
The refraction was hidden from the X angle of the camera and I don't understand why. From your code, there is no X axis implied in the Fresnel effect.
The only thing i'm 100% sure now. That the problem I have is in this calculation of the fresnel.
Code: Select all
// previous code was:
//float4 combinedColor = refractiveColor*fresnelTerm + reflectiveColor*(1-fresnelTerm);
// disabling fresnel like this:
float4 combinedColor = refractiveColor + reflectiveColor/4;
After some tweaking, here are some picture of the water of my demo:
This is the new source that you sent last time. I've started implementing with the first source you produced.
If you see now in theses pictures, we clearly see the refraction (the dark parts in the water are the Asphalt and the clearer part are the cement.)
Now it's working like I like. I've also changed a little the water color (too blue for my taste)
I've found a strange problem with my distribution of Irrlicht 1.3.1. The function
Code: Select all
CurrentCamera->GetFOV();
Some questions here:
- Is there a way to get a global value of my main() there?
- Is there a bounding box function that could render the water if the camera enter the zone of the bounding box? I've had to put very ugly code to (if ... if... if...) to do this and get good FPS until we get near of the water...
- Is there some kind of replacement for the clipping planes function that I had to comment out?