Sampler referencing in HLSL - Sampler parameter must come from a literal expression
- by user1423893
The following method works fine when referencing a sampler in HLSL
float3 P = lightScreenPos;
sampler ShadowSampler = DPFrontShadowSampler;
float depth;
if (alpha >= 0.5f)
{
// Reference the correct sampler
ShadowSampler = DPFrontShadowSampler;
// Front hemisphere 'P0'
P.z = P.z + 1.0;
P.x = P.x / P.z;
P.y = P.y /…