Hi.
I am using the refracted water (FX/water) with a terrain and deferred rendering.
While everything else works ok when you look into the water you notice constantly shadow artifacts on the terrain below the water. Here are 2 images and a video.
I tried to solve this through excluding various (reflect,refract,lighting) layers but with no luck.
Apparently this is a shader issue. Can somebody please give me a hint for another shader (the one used here is nighttime/daytime water from the standard shaders).
I’m sure this has been tested and working, so yeah, something unique must be going on. Set up a project with only the water. If it still happens, submit a bug report.
I just came across this problem in Unity 3.4 Pro. Looks like shadows do not properly get calculated when Unity renders the reflection texture…I can see the errant shadowing when I watch the preview.
I had the same problem ( using Unity 3.3 ) but it was even worse. I have a big tree on a tiny island in the middle of shallow pond so I had the whole water surface flashing dark and light as if one big shadow was cast over the surface. The code fix worked (thanks for that by the way elias_T) it’s a pity that I can’t have the shadows working thru the water it was looking really nice with forward lighting, but it’s not worth losing the deferred lighting and all my normal maps I guess.
Hope Unity fixes this.
This worked for me too. I created a script called “fixWaterShadows.js” and this code:
Replace “SunPrimaryDay” with the name of your sun. Of course, if you have more than one light casting shadows, you’ll have to revise this code to do it for all such lights.
Just drag and drop this script on your camera and problem solved!