Archive 17/01/2023.

The water material has a refliction shadow,how to fix this

chenjie199234

i copy the code in the Water example,NO.23
but there is something strange in my object,like a white shadow~
how to fix it~
it will show when the angle between camera direction and horizontal plane is small.
this is the screen shoot
123 456

JTippetts

That’s the reflection on the surface of the water. In the sample, reflectionCamera is a camera set up to take a picture of the scene from a different viewpoint, and render that shot to a texture. In the water shader, a Fresnel term is used to mix between the refracted background color (your rendered scene from the standard camera viewpoint) and the reflection color. The Fresnel effect means that the shallower your viewing angle becomes, the more the reflected image will dominate over the refracted image.

If you don’t want reflections, you can modify the shader to only use the refracted color. This should get rid of the “shadow”, but also means there will be no surface reflections.

chenjie199234

got it.I didnt copy all the code in the example.thx for the explain.

Bananaft

Are you using orthographic camera? Some features may not work with it.

chenjie199234

yes im using orthograghic camera.what feature not work with it.
do u know how to modify the shader.i dont know how towrite shader.
can we add a technique named WaterWithoutReflect.xml

Bananaft

look into water.glsl, it’s pretty simple actually. You can replace reflectColor texture read with plain blue color and fresnel calculation with static number. Also disable all reflection related code from water example (which is almost all of it. :slight_smile: )

Good luck!