Created
December 11, 2011 17:28
-
-
Save expipiplus1/1461680 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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