oculus-samples / Unity-DepthAPI

Examples of using Depth API for real-time, dynamic occlusions
Other
192 stars 24 forks source link

Question about func "META_DEPTH_OCCLUDE_OUTPUT_PREMULTIPLY(i, fragmentShaderResult, 0.0);" #19

Closed Spphire closed 8 months ago

Spphire commented 8 months ago

at readme:

  1. Implementing Occlusion in custom shaders Step 4. Calculate occlusions in fragment shader func "META_DEPTH_OCCLUDE_OUTPUT_PREMULTIPLY(i, fragmentShaderResult, 0.0);"

Does that mean the func will use i.vertex to calculate, so i need to name the variable of positonWS as "vertex"?

this is the input of my frag func: struct CharCoreVaryings { float4 positionHCS : SV_POSITION; float3 normalWS : NORMAL; float4 color : COLOR; float4 uv : TEXCOORD0; float3 positionWS : TEXCOORD1; };

rename "positionWS" as "vertex"?