]> git.tdb.fi Git - libs/gl.git/commitdiff
Rename a variable in shader code to avoid conflict with a keyword
authorMikko Rasa <tdb@tdb.fi>
Tue, 7 Feb 2012 17:45:09 +0000 (17:45 +0000)
committerMikko Rasa <tdb@tdb.fi>
Tue, 7 Feb 2012 17:45:09 +0000 (17:45 +0000)
source/program.cpp

index 64aa7bc57d530ec364512fec5bd041eb072bb0dd..8511b8c15833c3f5f62e2e707e56279092952a97 100644 (file)
@@ -61,8 +61,8 @@ const char *standard_fragment_src[] =
        "n",   "\tvec3 n_normal = texture2D(normalmap, v_texcoord).xyz*2.0-1.0;\n",
        "l!n", "\tvec3 n_normal = normalize(v_normal);\n",
        "l",   "\tfloat l_diffuse = max(dot(n_normal, normalize(v_light_dir)), 0.0);\n",
-       "p",   "\tvec3 half = normalize(v_eye_dir+v_light_dir);\n",
-       "p",   "\tfloat l_specular = pow(max(dot(half, n_normal), 0.0), gl_FrontMaterial.shininess);\n",
+       "p",   "\tvec3 half_dir = normalize(v_eye_dir+v_light_dir);\n",
+       "p",   "\tfloat l_specular = pow(max(dot(half_dir, n_normal), 0.0), gl_FrontMaterial.shininess);\n",
        "s",   "\tfloat l_shadow = shadow2D(shadow, v_shadowcoord).r;\n",
         0,    "\tgl_FragColor = ",
        "!t!l!m", "vec4(1.0, 1.0, 1.0, 1.0)",