Skip to content

Instantly share code, notes, and snippets.

@rasteron
Created February 24, 2016 16:15
Show Gist options
  • Save rasteron/fbe28211759541af6657 to your computer and use it in GitHub Desktop.
Save rasteron/fbe28211759541af6657 to your computer and use it in GitHub Desktop.
#include "Uniforms.glsl"
#include "Samplers.glsl"
#include "Transform.glsl"
#include "ScreenPos.glsl"
varying vec2 vScreenPos;
#ifdef GL_ES
precision mediump float;
#endif
void VS()
{
mat4 modelMatrix = iModelMatrix;
vec3 worldPos = GetWorldPos(modelMatrix);
gl_Position = GetClipPos(worldPos);
vScreenPos = GetScreenPosPreDiv(gl_Position);
}
void PS()
{
vec4 color = texture2D(sDiffMap, vScreenPos);
gl_FragColor = vec4(vec3(1.0, 1.0, 1.0) - color.rgb, color.a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment