]> git.tdb.fi Git - libs/gl.git/blobdiff - source/program.cpp
Fix color equations in the standard shaders
[libs/gl.git] / source / program.cpp
index f11206677b94890ebe7d89dfdeefbc5af425e7f4..729018a1a4b1edc69438d426c32426e82b19b09b 100644 (file)
@@ -79,9 +79,10 @@ const char *standard_fragment_src[] =
        "e",   "\tvec4 reflection = textureCube(environment, n_normal*(dot(n_normal, v_eye_dir)*2.0)-v_eye_dir);\n",
        "t",   "\tvec4 tex_sample = texture2D(texture, v_texcoord);\n",
         0,    "\tgl_FragColor.rgb = ",
-       "!t!l!m", "vec3(1.0)",
+       "!t!m",  "vec3(1.0)",
        "t",     "tex_sample.rgb",
        "l|mt",  "*",
+       "l!m!t",  "*",
        "!lm",   "v_color.rgb",
        "l",     "((l_diffuse",
        "lm",    "*gl_FrontLightProduct[0].diffuse.rgb",
@@ -94,10 +95,11 @@ const char *standard_fragment_src[] =
        "e",     "+reflection.rgb*reflectivity",
         0,      ";\n",
         0,    "\tgl_FragColor.a = ",
-       "!m",    "1.0",
+       "!t!m",  "1.0",
+       "t",     "tex_sample.a",
+       "tm",    "*",
        "!lm",   "v_color.a",
        "lm",    "gl_FrontMaterial.diffuse.a",
-       "t",     "*tex_sample.a",
         0,      ";\n",
         0,    "}\n",
        0, 0