robcupisz / LightShafts

A light shafts (volumetric shadows) effect for Unity.
1.3k stars 161 forks source link

Cut out shader #28

Open baptistepoligne opened 6 years ago

baptistepoligne commented 6 years ago

Hi, Do you know any way to be makin the voumetric fog with a cut out shader ? Since you said it need to write to depth texture and standard cutout doesn't. Thanks ! Baptiste

CarlLee commented 6 years ago

Implement a pass with tag "LightMode"="ShadowCaster", in that pass render your geometry in grey scale color using z coordinate, and do alpha testing to discard transparent pixels. This way, when Unity renders depth pass, your material will appear with depth and transparent pixels discarded.

baptistepoligne commented 6 years ago

Thank you very much CarlLee !