Skip to content

Instantly share code, notes, and snippets.

@expipiplus1
Created December 11, 2011 17:28
Show Gist options
  • Save expipiplus1/1461680 to your computer and use it in GitHub Desktop.
Save expipiplus1/1461680 to your computer and use it in GitHub Desktop.
/* lighting fragment shader (not quite phong)
* http://www.lighthouse3d.com/opengl/glsl/index.php/index.php?ogldir1
* James Stanley 2011
*/
#version 120
uniform sampler2D texture;
void main() {
vec2 p = gl_TexCoord[0].xy;
vec4 tex = texture2D(texture, p);
/* TODO: cope properly when there is no texture */
gl_FragColor = gl_Color.rgbr;
//gl_FragColor = vec4( gl_Color.rgb * tex.rgb, gl_Color.r );
//gl_FragColor = vec4(gl_Color.r * tex.r, gl_Color.g * tex.g, gl_Color.b * tex.b, gl_Color.r);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment