qzdoom/wadsrc/static/shaders/glsl/stencil.vp
2014-05-12 22:24:26 +02:00

14 lines
396 B
Text

out vec4 pixelpos;
void main()
{
// perform exactly the same relevant steps as in the main shader to ensure matching results (that also means including the model matrix here!)
vec4 worldcoord = ModelMatrix * gl_Vertex;
vec4 eyeCoordPos = ViewMatrix * worldcoord;
pixelpos.xyz = worldcoord.xyz;
pixelpos.w = -eyeCoordPos.z/eyeCoordPos.w;
gl_Position = ProjectionMatrix * eyeCoordPos;
}