Hi,
In my current project, I am looking to use the Daylight Water Material which comes with the Water (Pro Only) Package on a custom mesh. Although I set the mesh layer to Water, added the Water script to the mesh, and gave the mesh the Daylight Water Material (which is using the FX/Water shader), the end result is a polygonal mess that does not resemble the Daylight Water example object.
I have tried everything i could think of, including adjusting the shape and polycount of the water mesh, and UVW mapping the mesh, but have not had any luck in getting it to render correctly. If I replace my custom water mesh (in the mesh filter component) with the mesh that is used by the Daylight Water example object (named waterPlaneMesh) the example mesh renders correctly (albeit oriented on the wrong axis), indicating that the issue lies with my water mesh (which is just a simple plane imported from 3ds max) rather than the way I added the water components to it.
Curiously, If I create a new Plane within Unity and attach the Water Material to that Plane it renders correctly, so I cannot imagine why the Material does not render correctly when attached to my custom mesh. I have researched this issue to the best of my ability, however I have been unable to find a solution. If anyone can provide some insight into the problem I am experiencing it would be greatly appreciated. I am currently using Unity 4.
Thank you.
I figured out a solution to this problem. I applied the water material to a cube that was imported from my modeling software to see if the water rendered correctly on any of the faces. Sure enough, two faces were oriented the way the water material expects them to be, and rendered correctly, while the rest of the cube looked messed up like my water mesh
So in my modeling software I deleted all but one side of the cube (the side that rendered the water correctly in Unity) and used that side to rebuild my water mesh, and the result is correctly rendered water on a mesh that is shaped exactly the same way as before It was my understanding up until this point that the only difference between faces on a cube is their material ID and rotation, but apparently there is something else that I was unaware of, that the water material in Unity requires to be a certain way. Anyway, perhaps the “how to create water from scratch” guide should be updated to note that just having a “flat mesh oriented horizontally” is not necessarily going to work if that mesh was imported from external modeling software using the FBX importer, depending on some additional factor related to orientation that I am not aware of. http://docs.unity3d.com/Manual/HOWTO-Water.html When I say orientation, I mean something to do with how sides of the mesh are initially generated in my modeling software (3ds max); simply rotating the cube in 3ds max or in Unity does not change how the water material renders on each face.
EDIT: I Forgot to mention that I was also having trouble with the reflection/refraction not appearing correctly (the reflection and refraction changed depending on the camera angle, creating a weird looking effect). To fix this, I rotated the mesh 180 degrees on the y axis in 3ds max, and flipped the normals of all polygons in the mesh.