Urho3D/bin/CoreData/Shaders/GLSL/GreyScale.glsl
2015-01-18 21:31:13 +08:00

23 lines
534 B
GLSL

#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;
float intensity = GetIntensity(rgb);
gl_FragColor = vec4(intensity, intensity, intensity, 1.0);
}