Kink3d / kDecals

Projection Decals for Unity's Universal Render Pipeline.
MIT License
532 stars 53 forks source link

Not working with vertex displacement #23

Open lisandroct opened 4 years ago

lisandroct commented 4 years ago

The decals are not correctly projected when the receiving object has vertex displacement applied. They are projected on the unmodified mesh and ignore the displacement.

thnewlands commented 4 years ago

I'm having a similar issue but with transparency. It seems like the approach that the author is taking is pretty similar to projectors (from the legacy pipeline): in a pass re-render everything with the projected (decal) material and then overlay that on the existing geometry.

Here's a pretty useful post on why this doesn't work with projectors at least. https://forum.unity.com/threads/projector-onto-surface-that-has-alpha-cutout.555394/#post-3679798

I'm bummed -- it seems like the only good approach for vertex shaders and transparency with discarded fragments is to come up with a solution that uses a prerendered depth pass.