0

I am reading through a HLSL implementation of CSM shadow mapping and have come across a line of code i don't quite understande

float3 pos;
float3 CascadeDistances;
...
float3 weights = ( pos.z < CascadeDistances );

Can someone please tell me what is happening here and what is the result of this assignment.

I think it may expand out to something like

float3 weights;
weights.x = ( pos.z < CascadeDistances.x ) ? 1 : 0;
weights.y = ( pos.z < CascadeDistances.y ) ? 1 : 0;
weights.z = ( pos.z < CascadeDistances.z ) ? 1 : 0;

Can someone please confirm if this is correct of if i am way off.

Any help would be appreciated.

Steve Medley
  • 151
  • 3
  • 7

1 Answers1

0

I contacted the author of this shader and after some time he replied and confirmed that this is how this particular expression evaluates

Steve Medley
  • 151
  • 3
  • 7