Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Backdrop Vertex Shader
#version 150
// Uniforms
uniform float tanHalfFov; // View tan(0.5 * FOV)
uniform float aspectRatio; // View aspect-ratio
uniform float z; // Optional Z-coordinate
// Input
in vec3 position;
// Output
out Block
noperspective vec3 viewRay;
void main()
ob.viewRay = vec3(position.x * tanHalfFov * aspectRatio,
position.y * tanHalfFov,
gl_Position = vec4(position.xy, z, 1.0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.