Skip to content

Instantly share code, notes, and snippets.

@rasteron
Created August 21, 2015 09:46
Show Gist options
  • Save rasteron/2019a4890e0d6311297f to your computer and use it in GitHub Desktop.
Save rasteron/2019a4890e0d6311297f to your computer and use it in GitHub Desktop.
#include "Uniforms.glsl"
#include "Samplers.glsl"
#include "Transform.glsl"
#include "ScreenPos.glsl"
#include "Lighting.glsl"
varying vec2 vScreenPos;
void VS()
{
mat4 modelMatrix = iModelMatrix;
vec3 worldPos = GetWorldPos(modelMatrix);
gl_Position = GetClipPos(worldPos);
vScreenPos = GetScreenPosPreDiv(gl_Position);
}
void PS()
{
vec3 rgb = texture2D(sDiffMap, vScreenPos).rgb;
gl_FragColor.r = dot(rgb, vec3(.393, .769, .189));
gl_FragColor.g = dot(rgb, vec3(.349, .686, .168));
gl_FragColor.b = dot(rgb, vec3(.272, .534, .131));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment