Alpha Transparency Issues

Unity Pro 5.3.4f1

I have a gradient ramp that causes an object to be opaque in the center and fade out towards the edges. Problem is… the object is not 100% opaque in the center. (See attached images).

How can I accomplish this effect?

Thanks for any ideas!


An alpha-blended material doesn’t write into the Z-buffer even when its alpha value is 1. Since it doesn’t write into the Z-buffer, the renderer can’t tell what pieces of geometry are in front of others so it just renders them on top of each other in the (arbitrary) order they are submitted to the GPU.

You need to assign two materials to your mesh. Use an opaque material where it is fully opaque, and assign the alpha-blended material only where it starts to fade. You may still run into some problems with certain geometry, but it should work for the example you posted.

A work around is using a prepass depth transparency shader, but that comes with it’s own bag of oddities and artifacts.

Thanks very much for the info! I will give these options a try.

Thanks again.