Execution Order Problems
Posted: Wed Jan 10, 2018 3:47 pm
i was wondering how screendepth / surfacedepth can create values <0 untill i looked into the generated code.
it turns out that the surface depth is calcuated in the vertex shade before the vertex offset is applied
Example:
i think this problem can occur on multiple occasions and might need some special execution priority.
(for example passing world position before and after vertex offset into the pixel shader using vertex to fragment node)
it turns out that the surface depth is calcuated in the vertex shade before the vertex offset is applied
Example:
- Code: Select all
o.eyeDepth = -UnityObjectToViewPos( v.vertex.xyz ).z;
v.vertex.xyz += float3(4,4,4);
i think this problem can occur on multiple occasions and might need some special execution priority.
(for example passing world position before and after vertex offset into the pixel shader using vertex to fragment node)