Skip to content

Commit

Permalink
fix: fix warning Ternary error with non scalar (doodlum#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Apr 9, 2024
1 parent 747c0db commit 40dab64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package/Shaders/Common/Color.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ float RGBToLuminance2(float3 color)

float3 sRGB2Lin(float3 color)
{
return color > 0.04045 ? pow(color / 1.055 + 0.055 / 1.055, 2.4) : color / 12.92;
return select(color > 0.04045, pow(color / 1.055 + 0.055 / 1.055, 2.4), color / 12.92);
}

float3 Lin2sRGB(float3 color)
{
return color > 0.0031308 ? 1.055 * pow(color, 1.0 / 2.4) - 0.055 : 12.92 * color;
return select(color > 0.0031308, 1.055 * pow(color, 1.0 / 2.4) - 0.055, 12.92 * color);
}

0 comments on commit 40dab64

Please sign in to comment.