Skip to content

Instantly share code, notes, and snippets.

@olamedia
Created December 22, 2012 01:35
Show Gist options
  • Save olamedia/4356955 to your computer and use it in GitHub Desktop.
Save olamedia/4356955 to your computer and use it in GitHub Desktop.
smooth in vec2 texCoord;
varying vec4 lightColor;
uniform sampler2D mesh_ActiveTexture;
void main (void)
{
vec4 texColor;
//if(0.0 <= texCoord.t && texCoord.t<=1.0) {
texColor = texture2D(mesh_ActiveTexture, texCoord.st);
//} else {
// texColor = vec4(1, 1, 1, 1);
//}
// mix frontColor with texture ..
//texColor = vec4(vec3(lightColor*texColor), texColor.a);
if (!gl_FrontFacing) discard;
if (texColor.a < 0.1f) discard;
// SrcFactor * gl_FragColor + DstFactor * pixel_color;
// gl_FragColor = mix(gl_FragColor, texColor, texColor.a);// vec4(frontColor*texColor);
gl_FragColor = vec4(gl_FragColor.a) * gl_FragColor + vec4(1.0 - gl_FragColor.a) * texColor;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment