missed glsl shader changes

missed a few glsl shader changes
fixed gradient to look correct with selected underlay colour
This commit is contained in:
marauder2k7 2025-01-22 21:32:07 +00:00
parent 029a495de1
commit d5d7f9b91b
2 changed files with 14 additions and 8 deletions

View file

@ -65,6 +65,9 @@ void main()
{ {
float blendX = (1.0 - texCoord.x); float blendX = (1.0 - texCoord.x);
float blendY = texCoord.y; 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); 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;
@ -78,20 +81,20 @@ void main()
{ {
if(sdf < 0.0) if(sdf < 0.0)
{ {
toColor = color; toColor = baseColor;
sdf = abs(sdf) - borderSize; sdf = abs(sdf) - borderSize;
} }
} }
else{ else{
fromColor = color; fromColor = baseColor;
} }
float alpha = smoothstep(-1.0, 1.0, sdf); float alpha = smoothstep(-1.0, 1.0, sdf);
OUT_col = mix(fromColor, toColor, alpha); OUT_col = mix(fromColor, baseColor, alpha);
} }
else else
{ {
OUT_col = color; OUT_col = baseColor;
} }
} }

View file

@ -69,8 +69,11 @@ float4 main(Conn IN) : TORQUE_TARGET0
if(gradientFill > 0.5f) if(gradientFill > 0.5f)
{ {
float blendX = (1.0 - IN.texCoord.x); float blendX = 1.0 - IN.texCoord.x;
float blendY = IN.texCoord.y; 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); 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; baseColor = interpolatedColor;