I have encountered a weird x.wwww
component of the float4 x
vector in a HLSL code. I haven't seen such a member or member function of float4 structures in HLSL, so please tell me what is the meaning of that. It is in the code of this pixel shader:
float4 PSConstantColor( PS_PARTICLE_INPUT input ) : SV_TARGET
{
// Sample particle texture
float4 vColor = g_baseTexture.Sample( g_samLinear, input.Tex ).wwww;
// Clip fully transparent pixels
clip( vColor.a - 1.0/255.0 );
// Return color
return vColor;
}
At first I thought it should be the w
component replicated to all the members of the float4 vColor
vector, but it does not make sense for the color value, does it?