Skip to content

Instantly share code, notes, and snippets.

@wipe2238
Last active January 19, 2017 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wipe2238/23b04be62aa0869f39bd to your computer and use it in GitHub Desktop.
Save wipe2238/23b04be62aa0869f39bd to your computer and use it in GitHub Desktop.
Cheap critters contours
//
// 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