how can i get world position in translucent material? world position behind the translucent pixel which being rendered. just like “worldPosition” in post-process;
i have tried “WorldPositionBehindTranslucency” but it give different value Compared with what “َWorldPosition” give in post-process.
i saw ‘PostProcessMaterialShaders.usf’ that calculates the world position from depth buffer, then i wrote the following code as a custom expression but it doesn’t work.
float SceneDepth = CalcSceneDepth(ScreenAlignedPosition(Parameters.ScreenPosition).xy); float3 ScreenVector = mul(float4(Parameters.ScreenPosition.xy, 1, 0), View.ScreenToWorld).xyz; return ScreenVector * SceneDepth - View.PreViewTranslation.xyz;