stk-code_catmod/data/shaders/rhdebug.vert

20 lines
546 B
GLSL
Raw Normal View History

2014-05-21 15:44:34 -04:00
uniform vec3 extents;
uniform mat4 RHMatrix;
ivec3 resolution = ivec3(32, 16, 32);
out vec3 uvw;
void main(void)
{
// Determine the RH center
float gx = int(gl_VertexID) & (resolution.x - 1);
float gy = int(gl_VertexID >> 5) & (resolution.y - 1);
float gz = int(gl_VertexID >> 9) & (resolution.z - 1);
uvw = vec3(gx, gy, gz) / vec3(resolution);
vec3 WorldPos = (2. * uvw - 1.) * extents;
gl_Position = ProjectionMatrix * ViewMatrix * RHMatrix * vec4(WorldPos, 1.);
gl_PointSize = 500. / gl_Position.w;
2014-05-21 15:44:34 -04:00
}