Last active
January 19, 2017 08:34
-
-
Save wipe2238/23b04be62aa0869f39bd to your computer and use it in GitHub Desktop.
Cheap critters contours
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
// | |
// Cheap critters contours | |
// Wipe/cirn0 | |
// | |
#version 110 | |
#ifdef VERTEX_SHADER | |
uniform mat4 ProjectionMatrix; | |
attribute vec2 InPosition; | |
attribute vec4 InColor; | |
attribute vec2 InTexCoord; | |
attribute vec2 InTexEggCoord; | |
varying vec4 Color; | |
varying vec2 TexCoord; | |
varying vec2 TexEggCoord; | |
void main( void ) | |
{ | |
gl_Position = ProjectionMatrix * vec4( InPosition, 0.0, 1.0 ); | |
Color = InColor; | |
TexCoord = InTexCoord; | |
TexEggCoord = InTexEggCoord; | |
} | |
#endif | |
#ifdef FRAGMENT_SHADER | |
uniform sampler2D ColorMap; | |
uniform sampler2D EggMap; | |
varying vec4 Color; | |
varying vec2 TexCoord; | |
varying vec2 TexEggCoord; | |
void main( void ) | |
{ | |
vec4 texColor = texture2D( ColorMap, TexCoord ); | |
gl_FragColor = Color; | |
if( TexEggCoord.x != 0.0 ) | |
gl_FragColor.a = texture2D( EggMap, TexEggCoord ).a; | |
else | |
gl_FragColor.a = texColor.a - 0.4; | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment