+1

Displacement and Depth

moxi299 3 months ago • updated by KlutoTek 2 months ago 1

I use Shader Forge 1.38 and get this Error when i try to connect the Depth or Scene Depth Node with the Displacement branch.


Shader error in 'TH/RoofTiles': undeclared identifier 'partZ' at line 631 (on d3d11)

Compiling Vertex program with DIRECTIONAL LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME


I've been trying to use the depth node for displacement/vertex offset as well with no luck. I think the problem has to do with the order that shader passes are drawn in each frame. Depth isn't drawn until after the vertex pass is completed which is the same pass where displacement is applied. So basically the depth info doesnt exist yet when you call it in the vertex pass. I've heard talk of using a compute shader to solve this but as an artist, that is a subject beyond my abilities. I'd love to see a solution for this built into Shader Forge somehow if it is even possible.