I’m using daylight water in a sunken pool, and it was working fine, but then I had to update the model itself. That update went fine, except that after that the reflection view in the water was from a camera position well below the mesh’s surface. For example, in the Scene view I can look down on the pool and see my FPS capsule in its correct place, but the reflection of the capsule is perhaps 20 metres below the surface of the water.
As I try to figure out how to fix it, I sometimes do a Reset of the daylight water component. Doing that completely breaks the water, no ripples or refraction, and barely any reflection. The only way I’ve found to fix that is to recopy the Pro and Standard assets folders back into my project.
So, two questions really, what might lead to the camera position being so far below the water surface, and why does doing a reset of the daylight water component permanently break it?
Incidentally, the symptoms are the same whether I attach the water bits to my own mesh, or I drag out the prefab. My next move is going to be a fresh reinstall of Unity.
The reinstall improved things, in that the prefab behaves itself now. I can also take my mesh into a new scene, and the reflection is correct, but the same mesh used in the full scene does the strange reflection. Here’s a screen recording to show what I mean:
http://xfiles.funnygarbage.com/~colinholgate/video/badreflection.mov
Is there something about a full Filmbox scene that could introduce some sort of offset to the routine that works out where the reflection is taken from?
Weird. Looks like the reflective component of the prefab got moved somehow. I’ve never seen that before.
If you create a new project and instantiate the water prefab in it, does it still do this? If it does, I have no idea what’s going on. If it doesn’t, then I’m guessing something in the prefab got changed inadvertently. I don’t know if this is the best way to fix it, but what I would do is to delete that instance of the prefab and then instantiate it again.
You may have written your message without reading my second message. A reinstall sorted out the prefab on its own problem, and in the case of using my own mesh, that’s ok in a new scene. But in the same project, with the same mesh in its original model, the problem occurs.
I had a new idea though, which was that I brought just that mesh into Unity in its own model, to rule out any influence from any of the other meshes in the full model. That still went wrong, but it did finally give me the clue to solve the problem!
My mesh was at a positive Y position. It seems that the camera reflection assumes that the water is a zero Y. I moved my whole scene downward slightly, until the water level was at zero Y, and then all was well.
After hours of trying to figure this out, I could almost weep for joy!
Perhaps the water script should expose the vector for where the reflection is taken from, so that water could be at non-zero Y positions?
One extra note, the Y shift I had to do was in the original model, to then export to FBX, to bring into Unity. I had of course already tried doing the Y shift just in Unity, but that hadn’t helped.