0
Under review

Depth Blend alpha

vincent 10 years ago updated by Freya Holmér (Developer) 10 years ago 16
Image 131Hi I just updated to beta 0.22 but I still have an alpha problem. I have an ocean material which uses the Depth Blend node. Now I want some particles to simulate waves crashing on the shore. Those big water splashes. So I need a alpha material on my particle that writes to the z buffer.
Now the weird thing is that it works fine when the particle is within a certain range of the camera. When I back out the alphaImage 132 of the particle starts blocking the ocean shader. (see Image)
If you rename your Diffuse node to MainTex, does it help?
No that doesn't do a thing;(
Bytheway the problem is only on the 'deepest' parts of the ocean, at the places where I can still see the ocean floor works the particle look fine.
Oh, wait, why are you enabling writing to the depth buffer? I'm almost certain that's the issue
You don't want Alpha blending and depth buffer writing at the same time, use alpha clip instead of alpha in that case
The issue kind of stays the same with the depth buffer writing disabled. The particle looks alright when looking at the shallow parts and the deeper parts look good close-by , but when I zoom out the particle will be clipped away or the water is rendered atop the particle.
Is alpha blending still enabled? Try alpha clip instead, and turn off alpha blending
Or not use alpha at all, and do additive blending instead
What do you mean with turn off alpha blending? 
I tried the alpha clip and the issue is gone but the look of the effect is not so nice anymore. The particle doesn't fade so nice anymore at the beginning and end of the lifetime.
It should fade if you set it to additive
nope sorry, even the material set to additive and no alpha connected the problem is the same when I zoom out.
Are you using deferred or forward rendering? (Check both the camera and the player settings)
I use forward rendering on the player settings and the camera's
hmm I did some more test and apparently it is a Unity thing because when I change the ocean shader with a Unity alpha shader the problem is the same.. when rotating the camera around the particle it sometimes render right and sometimes not:(
So I think this cannot be solved the way I want it..
In SF try un-checking the auto-sort property and setting the particle shader to Transparent 3000 + 1 looks like it's just a draw order issue to me
That look like it fixed it for me;) Thx