Procházet zdrojové kódy

gpu: fix GLSL ES syntax errors in various shaders.

legacy
Sam Hocevar sam před 11 roky
rodič
revize
36c36525a2
2 změnil soubory, kde provedl 8 přidání a 8 odebrání
  1. +5
    -5
      src/easymesh/shinydebugUV.lolfx
  2. +3
    -3
      src/easymesh/shinydebugnormal.lolfx

+ 5
- 5
src/easymesh/shinydebugUV.lolfx Zobrazit soubor

@@ -53,14 +53,14 @@ void main(void)
float mode = 0.0;
if (mode == 0.0)
{
gl_FragColor = vec4(mod(pass_TexCoord.x, 1.0f),
gl_FragColor = vec4(mod(pass_TexCoord.x, 1.0),
0.1,
mod(pass_TexCoord.y, 1.0), 1.0);
}
else
{
float col = ((mod(mode, 2.0) == 1)?(mod(pass_TexCoord.x, 1.0)):(mod(pass_TexCoord.y, 1.0)));
if (mode == 1 || mode == 2)
float col = ((mod(mode, 2.0) == 1.0)?(mod(pass_TexCoord.x, 1.0)):(mod(pass_TexCoord.y, 1.0)));
if (mode == 1.0 || mode == 2.0)
{
if (col > 1.0/3.0) gl_FragColor.r = 0.0;
else gl_FragColor.r = min(col, 1.0/3.0);
@@ -68,14 +68,14 @@ void main(void)
else gl_FragColor.g = min(max(col, 1.0/3.0) - 1.0/3.0, 1.0/3.0);
gl_FragColor.b = min(max(col, 2.0/3.0) - 2.0/3.0, 1.0/3.0);
}
else if (mode == 3 || mode == 4)
else if (mode == 3.0 || mode == 4.0)
{
if (col > 0.5) gl_FragColor.r = 0.0;
else gl_FragColor.r = min(col, 0.5);
gl_FragColor.g = min(max(col, 0.5) - 0.5, 0.5);
gl_FragColor.b = 0.1;
}
else if (mode == 5 || mode == 6)
else if (mode == 5.0 || mode == 6.0)
{
gl_FragColor.r = col;
gl_FragColor.g = 0.1;


+ 3
- 3
src/easymesh/shinydebugnormal.lolfx Zobrazit soubor

@@ -47,9 +47,9 @@ varying vec4 pass_Color;
void main(void)
{
vec3 real_color = vec3(0.0, 0.0, 0.0);
real_color += abs(pass_TNormal.x) * ((pass_TNormal.x < .0f)?(vec3(0.0, 1.0, 1.0)):(vec3(1.0, 0.0, 0.0)));
real_color += abs(pass_TNormal.y) * ((pass_TNormal.y < .0f)?(vec3(1.0, 0.0, 1.0)):(vec3(0.0, 1.0, 0.0)));
real_color += abs(pass_TNormal.z) * ((pass_TNormal.z < .0f)?(vec3(1.0, 1.0, 0.0)):(vec3(0.0, 0.0, 1.0)));
real_color += abs(pass_TNormal.x) * ((pass_TNormal.x < 0.0)?(vec3(0.0, 1.0, 1.0)):(vec3(1.0, 0.0, 0.0)));
real_color += abs(pass_TNormal.y) * ((pass_TNormal.y < 0.0)?(vec3(1.0, 0.0, 1.0)):(vec3(0.0, 1.0, 0.0)));
real_color += abs(pass_TNormal.z) * ((pass_TNormal.z < 0.0)?(vec3(1.0, 1.0, 0.0)):(vec3(0.0, 0.0, 1.0)));
gl_FragColor = vec4(real_color, pass_Color.w);
}



Načítá se…
Zrušit
Uložit