The issues I have encountered haven’t been fixed, and the project is unsupported.
Enjoy.
—previously—
I developed (approximated) order independent transparency shader.
Wanted to publish it on asset store BUT encountered certain technical problem which prevented that from happening (for now, anyway).
Here are videos of the effect in action.
Watch the cursor in bottom left cursor - it toggles various options. “Standard” (enabled at 1:03) demonstrates standard way of handling transparency, without order-independence.
Normal transparency requires objects to be sorted. This one doesn’t.
In case of standard transparency, if you make several meshes that cannot be properly sorted by depth, (if they intersect, or if one object is within another), one object will “overdraw” another. This is demonstrated at 1:03 when I switch to standard transparency (smoke passes through other objects in the scene, and because it is considered to be “closer” to the camera than everything else, it is drawn last ,completely erasing car and standing character).
In case of standard transparency you’ll also get artifacts on complex concave object (like car’s hull) with lighting on it, unless you split that object into many small parts - because sorting is performed on object level and not polygon level.
However, it is still an approximation.
Also, in the example, particle smoke reacts to unity lighting and receives shadows.
You know what, I have live demo here, so see for yourself. It is older demo that doesn’t work in OpenGL.
It should actually be really cheap, BUT
Unity does not exactly let you reuse zbuffer (used by previously drawn objects - it just plain doesn’t work in DirectX mode), so currently currently all solid objects will have to be drawn second time (with cheap shader) for the the effect to work.
It is still much cheaper than proper non-approximated order independent transparency would have been.
I also spent a lot of time trying to make lighting work on transparent objects (in 1st demo you can see shadows on semi-transparent car), it cannot be reliably done (without replacing unity lighting system with your own) because it does not work in OpenGL mode (and probably relies on undefined behavior in DX).
You also cannot use the effect on standard unity shader unless you rewrite it.
What kind of tehnique you use? =)
About zbuffer… why don’t use depth textures? Copy them by blit… I think it’s more usefull than render solid geometry one more time.
You know, the reason why I never released the original asset is because I couldn’t make it work on OpenGL and there were problems with support for receiving shadows.
Guess now I’ll have to get it together and release it for free.