1
0
mirror of synced 2025-02-25 22:38:07 +01:00

BXLYT : Cleanup shaders.

Some cleanup and adjust floating point values to have decimals.
This commit is contained in:
KillzXGaming 2020-12-22 20:40:36 -05:00
parent 5a55eb189f
commit 6837bc30d1
2 changed files with 16 additions and 26 deletions

View File

@ -109,9 +109,9 @@ float AlphaCombiner(int type, vec4 j1, vec4 j2, vec4 j3)
void main() void main()
{ {
vec4 textureMap0 = vec4(1); vec4 textureMap0 = vec4(1.0);
vec4 textureMap1 = vec4(1); vec4 textureMap1 = vec4(1.0);
vec4 textureMap2 = vec4(1); vec4 textureMap2 = vec4(1.0);
if (numTextureMaps > 0) if (numTextureMaps > 0)
{ {
@ -128,10 +128,10 @@ void main()
vec3 whiteColorSRGB = pow(whiteColor.rgb, vec3(1.0 / gamma)); vec3 whiteColorSRGB = pow(whiteColor.rgb, vec3(1.0 / gamma));
vec3 whiteInterpolation = whiteColorSRGB.rgb * textureMap0.rgb; vec3 whiteInterpolation = whiteColorSRGB.rgb * textureMap0.rgb;
vec3 blackInterpolation = (vec3(1) - textureMap0.rgb) * blackColor.rgb; vec3 blackInterpolation = (vec3(1.0) - textureMap0.rgb) * blackColor.rgb;
//vec3 colorBlend = whiteInterpolation + blackInterpolation; //vec3 colorBlend = whiteInterpolation + blackInterpolation;
vec3 colorBlend = ColorCombiner(4, vec4(whiteColorSRGB.rgb, 1), blackColor, textureMap0); vec3 colorBlend = ColorCombiner(4, vec4(whiteColorSRGB.rgb, 1.0), blackColor, textureMap0);
float alpha = textureMap0.a * whiteColor.a; float alpha = textureMap0.a * whiteColor.a;
@ -140,14 +140,14 @@ void main()
vec4 j2; vec4 j2;
vec4 j3; vec4 j3;
vec4 fragOutput; vec4 fragOutput;
vec4 previousStage = vec4(1); vec4 previousStage = vec4(1.0);
if (numTextureMaps > 1 && numTevStages > 4) if (numTextureMaps > 1 && numTevStages > 4)
{ {
for (int i = 0; i < numTevStages; i++) for (int i = 0; i < numTevStages; i++)
{ {
j1 = textureMap0; j1 = textureMap0;
j2 = textureMap1; j2 = textureMap1;
j3 = vec4(1); j3 = vec4(1.0);
if (numTextureMaps > 2) if (numTextureMaps > 2)
j3 = textureMap2; j3 = textureMap2;
@ -175,7 +175,7 @@ void main()
gl_FragColor = fragOutput; gl_FragColor = fragOutput;
} }
else if (debugShading == 5) else if (debugShading == 5)
gl_FragColor = vec4(textureMap0.rgb, 1); gl_FragColor = vec4(textureMap0.rgb, 1.0);
else if (debugShading == 1) else if (debugShading == 1)
gl_FragColor = gl_Color; gl_FragColor = gl_Color;
else if (debugShading == 2) else if (debugShading == 2)

View File

@ -1,6 +1,4 @@
#version 110 uniform int flipTexture;
uniform int flipTexture;
uniform mat4 rotationMatrix; uniform mat4 rotationMatrix;
uniform int texCoords0GenType; uniform int texCoords0GenType;
uniform int texCoords0Source; uniform int texCoords0Source;
@ -20,24 +18,16 @@ vec2 SetFlip(vec2 tex)
vec2 outTexCoord = tex; vec2 outTexCoord = tex;
if (flipTexture == 1) //FlipH if (flipTexture == 1) //FlipH
return vec2(-1, 1) * tex + vec2(1, 0); return vec2(-1.0, 1.0) * tex + vec2(1.0, 0.0);
else if (flipTexture == 2) //FlipV else if (flipTexture == 2) //FlipV
return vec2(1, -1) * tex + vec2(0, 1); return vec2(1.0, -1.0) * tex + vec2(0.0, 1.0);
else if (flipTexture == 3) //Rotate90 else if (flipTexture == 3) //Rotate90
{ return rotateUV(tex, radians(90.0));
float degreesR = 90.0;
return rotateUV(tex, radians(degreesR));
}
else if (flipTexture == 4) //Rotate180 else if (flipTexture == 4) //Rotate180
{ return rotateUV(tex, radians(180.0));
float degreesR = 180.0;
return rotateUV(tex, radians(degreesR));
}
else if (flipTexture == 5) //Rotate270 else if (flipTexture == 5) //Rotate270
{ return rotateUV(tex, radians(270.0));
float degreesR = 270.0;
return rotateUV(tex, radians(degreesR));
}
return outTexCoord; return outTexCoord;
} }
@ -46,7 +36,7 @@ vec2 SetTexCoordType(int type, vec2 tex)
vec2 outTexCoord = tex; vec2 outTexCoord = tex;
if (type == 0) return tex; //Tex0 if (type == 0) return tex; //Tex0
if (type == 1) return tex; //Tex1 if (type == 1) return tex; //Tex1
if (type == 2) return tex; //Tex3 if (type == 2) return tex; //Tex2
if (type == 3) return tex; //Ortho if (type == 3) return tex; //Ortho
if (type == 4) return tex; //Pane based if (type == 4) return tex; //Pane based
if (type == 5) return tex; //Proj if (type == 5) return tex; //Proj