#version 450 core layout (location = 0) in vec3 inPosition; layout (location = 1) in vec3 inMinEdge; layout (location = 2) in vec3 inMaxEdge; layout (location = 0) out vec4 outColor; void main(void) { float tMax; vec3 t1 = (inMinEdge - inPosition) / vec3(1.0); vec3 t2 = (inMinEdge - inPosition) / vec3(1.0); vec3 tmax = max(t1, t2); tMax = min(min(99999.0, tmax.x), min(tmax.y, tmax.z)); outColor = vec4(inPosition, tMax); }