Scalar parameter with HLSL

Hi, i am having difficulty in getting scalar parameter to work with HLSL.

If i am just using a scalar value, it works fine but it doesnt seem to accept scalar parameter for switch function in HLSL despite having the value converted to int. Any help with this?

TexNum = (int)TexNum; [branch] switch(TexNum)
{
    case 1:
        return float4(0.2473,0.2473,0.0002,0.0002); 
    case 2:
        return float4(0.25,0.2475,0,0); 

252492-nogo.png

Add default to the switch and you should be good to go.

Thank you so much! :slight_smile: