1
0
mirror of synced 2025-02-25 14:34:47 +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()
{
vec4 textureMap0 = vec4(1);
vec4 textureMap1 = vec4(1);
vec4 textureMap2 = vec4(1);
vec4 textureMap0 = vec4(1.0);
vec4 textureMap1 = vec4(1.0);
vec4 textureMap2 = vec4(1.0);
if (numTextureMaps > 0)
{
@ -128,10 +128,10 @@ void main()
vec3 whiteColorSRGB = pow(whiteColor.rgb, vec3(1.0 / gamma));
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 = 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;
@ -140,14 +140,14 @@ void main()
vec4 j2;
vec4 j3;
vec4 fragOutput;
vec4 previousStage = vec4(1);
vec4 previousStage = vec4(1.0);
if (numTextureMaps > 1 && numTevStages > 4)
{
for (int i = 0; i < numTevStages; i++)
{
j1 = textureMap0;
j2 = textureMap1;
j3 = vec4(1);
j3 = vec4(1.0);
if (numTextureMaps > 2)
j3 = textureMap2;
@ -175,7 +175,7 @@ void main()
gl_FragColor = fragOutput;
}
else if (debugShading == 5)
gl_FragColor = vec4(textureMap0.rgb, 1);
gl_FragColor = vec4(textureMap0.rgb, 1.0);
else if (debugShading == 1)
gl_FragColor = gl_Color;
else if (debugShading == 2)

View File

@ -1,6 +1,4 @@
#version 110
uniform int flipTexture;
uniform int flipTexture;
uniform mat4 rotationMatrix;
uniform int texCoords0GenType;
uniform int texCoords0Source;
@ -20,24 +18,16 @@ vec2 SetFlip(vec2 tex)
vec2 outTexCoord = tex;
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
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
{
float degreesR = 90.0;
return rotateUV(tex, radians(degreesR));
}
return rotateUV(tex, radians(90.0));
else if (flipTexture == 4) //Rotate180
{
float degreesR = 180.0;
return rotateUV(tex, radians(degreesR));
}
return rotateUV(tex, radians(180.0));
else if (flipTexture == 5) //Rotate270
{
float degreesR = 270.0;
return rotateUV(tex, radians(degreesR));
}
return rotateUV(tex, radians(270.0));
return outTexCoord;
}
@ -46,7 +36,7 @@ vec2 SetTexCoordType(int type, vec2 tex)
vec2 outTexCoord = tex;
if (type == 0) return tex; //Tex0
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 == 4) return tex; //Pane based
if (type == 5) return tex; //Proj