mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
missed glsl shader changes
missed a few glsl shader changes fixed gradient to look correct with selected underlay colour
This commit is contained in:
parent
029a495de1
commit
d5d7f9b91b
|
|
@ -65,9 +65,12 @@ void main()
|
|||
{
|
||||
float blendX = (1.0 - texCoord.x);
|
||||
float blendY = texCoord.y;
|
||||
|
||||
float gamma = 2.4;
|
||||
blendX = pow(abs(blendX), gamma);
|
||||
blendY = pow(abs(blendY), 1/gamma);
|
||||
|
||||
vec4 interpolatedColor = mix(mix(baseColor,vec4(1.0f, 1.0f, 1.0f, 1.0f), blendX),vec4(0.0f, 0.0f, 0.0f, 1.0f), blendY);
|
||||
baseColor = interpolatedColor;
|
||||
baseColor = interpolatedColor;
|
||||
}
|
||||
|
||||
if(cornerRadius > 0.0 || halfBorder > 0.0)
|
||||
|
|
@ -78,20 +81,20 @@ void main()
|
|||
{
|
||||
if(sdf < 0.0)
|
||||
{
|
||||
toColor = color;
|
||||
toColor = baseColor;
|
||||
sdf = abs(sdf) - borderSize;
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
fromColor = color;
|
||||
fromColor = baseColor;
|
||||
}
|
||||
|
||||
float alpha = smoothstep(-1.0, 1.0, sdf);
|
||||
OUT_col = mix(fromColor, toColor, alpha);
|
||||
OUT_col = mix(fromColor, baseColor, alpha);
|
||||
}
|
||||
else
|
||||
{
|
||||
OUT_col = color;
|
||||
OUT_col = baseColor;
|
||||
}
|
||||
}
|
||||
|
|
@ -69,9 +69,12 @@ float4 main(Conn IN) : TORQUE_TARGET0
|
|||
|
||||
if(gradientFill > 0.5f)
|
||||
{
|
||||
float blendX = (1.0 - IN.texCoord.x);
|
||||
float blendX = 1.0 - IN.texCoord.x;
|
||||
float blendY = IN.texCoord.y;
|
||||
|
||||
float gamma = 2.4;
|
||||
blendX = pow(abs(blendX), gamma);
|
||||
blendY = pow(abs(blendY), 1/gamma);
|
||||
|
||||
float4 interpolatedColor = lerp(lerp(baseColor,float4(1.0f, 1.0f, 1.0f, 1.0f), blendX),float4(0.0f, 0.0f, 0.0f, 1.0f), blendY);
|
||||
baseColor = interpolatedColor;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue