Water reflection bug
by Phil Carlisle · in Torque Game Engine Advanced · 01/22/2007 (2:26 am) · 2 replies
We were discussing a problem with shapebase derived objects not being lit similarly to statics in another thread (in general discussion), when I spotted something that doesnt seem right in a shot tom posted.
If you look at this shot, look specifically at the waterline where the boats are shadowed in the water. That cant be right can it? Surely the bright spots where the water reflects the environment wouldnt happen? I.e. where the reflection of the ship is, the reflection of the env map shouldnt. So you shouldnt see a bright silouette against the reflection edge where the water meets the ship.

If you look at this shot, look specifically at the waterline where the boats are shadowed in the water. That cant be right can it? Surely the bright spots where the water reflects the environment wouldnt happen? I.e. where the reflection of the ship is, the reflection of the env map shouldnt. So you shouldnt see a bright silouette against the reflection edge where the water meets the ship.

About the author
Recent Threads
#2
Try changing the size 'reflectTexSize' of the waterblock. (Larger size = more accurate fit but..
more accurate fit + distortion = occasional to frequent appearence of unwanted bright spots)
Smaller textures tend to push the bright spots far enough under the object to be acceptable.
I found 256 to be acceptable for my needs in the relation of spot removal to quality.
It worked well for me on tightening it up around cliff walls that should have been shadowed.
I would think that forcing it to render backfaces (for the reflection map) would also do the trick. My assumption of the problem is that as intersections occur it ends up seeing and ignoring backfaces therefore rendering the skybox. You could try placing another object above the ship and moving it around and seeing if the brightspots disappear relative to its position.
01/26/2007 (9:59 am)
I've had similar problems. Try changing the size 'reflectTexSize' of the waterblock. (Larger size = more accurate fit but..
more accurate fit + distortion = occasional to frequent appearence of unwanted bright spots)
Smaller textures tend to push the bright spots far enough under the object to be acceptable.
I found 256 to be acceptable for my needs in the relation of spot removal to quality.
It worked well for me on tightening it up around cliff walls that should have been shadowed.
I would think that forcing it to render backfaces (for the reflection map) would also do the trick. My assumption of the problem is that as intersections occur it ends up seeing and ignoring backfaces therefore rendering the skybox. You could try placing another object above the ship and moving it around and seeing if the brightspots disappear relative to its position.
Associate Manoel Neto
Default Studio Name
When the scene is drawn into the reflection buffer, the water plane is used as a clipping plane so only geometry outside the water is rendered. When the reflection texture is distorted by the water normal map, seams light those might become visible.
In real-life (and in ray tracing-based renderers), objects closer to the water distort less than objects further than the water, but in your everyday pixel-shader-based water reflection that won't happen because the distortion happens in 2D space: there is no real light rays being reflected off the water.
An usual fix is moving the clipping plane up or down a little to minimize flaws. Check WaterBlock::updateReflection() in waterBlock.cpp and try messing with the calculation of the reflection plane. You may also tweak your waterblock settings to make the reflection less distorted.