i modelled two palms; the leaves are just planes with an alpha mask.
i also have water pro in my scene; now when i play the leaves disappear at the horizon (e.g. where the water meets the sky)
another interesting fact is that if something is behind those leaves they do get rendered, so i suppose it has something to do with the water cutting off something or being prioritized before the alpha mask, but i can’t quite put my finger on it.
if i select diffuse instead of transparent/diffuse everything is like it should be:
maybe there’s just some small option i’m missing; this is the first time i worked with alpha masks inside of unity.
the texture is a .psd with the alpha in the first channel by the way…
It is very likely that your water object is also set as a transparent object. Unity does a depth sort by position. It is very likely that your trees are further away than the pivot point of your water plane. (Have you looked at the other side of the trees?)
To solve this, you can put your water plane to be non-transparent, so it will be rendered earlier than your transparent trees and will not give you problems with any transparent object anymore.
If you really want the water plane to be transparent, you should go for the render ordering, but it will always result in false images, because it is fully dependent on your view angle towards the transparent objects.
This problem may be caused by shaders that do not write to the Z (or depth) buffer. You can work around this by changing the rendering order. Test which queue value solve your problem with the script below, which must be assigned to the palm tree:
var order = 2800;
function Update(){
renderer.material.renderQueue=order;
}
Once the value is found, you can set it in your shader or in the Start function.