summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a6c45f5)
The generated shader code assigned a scalar to a vec3 if lighting was
enabled without texture or material. An unnecessary multiplication in
the alpha equation with texture but no material was removed.
Also fix texturing in the shader demo (Mesa does funny things with
uniforms).
}
GL::ProgramData progdata;
}
GL::ProgramData progdata;
+ progdata.uniform("texture", 0);
progdata.uniform("normalmap", 1);
GL::Lighting lighting;
progdata.uniform("normalmap", 1);
GL::Lighting lighting;
"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 = ",
"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", "tex_sample.rgb",
"l|mt", "*",
"t", "tex_sample.rgb",
"l|mt", "*",
"!lm", "v_color.rgb",
"l", "((l_diffuse",
"lm", "*gl_FrontLightProduct[0].diffuse.rgb",
"!lm", "v_color.rgb",
"l", "((l_diffuse",
"lm", "*gl_FrontLightProduct[0].diffuse.rgb",
"e", "+reflection.rgb*reflectivity",
0, ";\n",
0, "\tgl_FragColor.a = ",
"e", "+reflection.rgb*reflectivity",
0, ";\n",
0, "\tgl_FragColor.a = ",
+ "!t!m", "1.0",
+ "t", "tex_sample.a",
+ "tm", "*",
"!lm", "v_color.a",
"lm", "gl_FrontMaterial.diffuse.a",
"!lm", "v_color.a",
"lm", "gl_FrontMaterial.diffuse.a",