alestane icon

vetex shader

alestane | PRO | 01/25/16 11:12:06 PM UTC | 0 ⭐ | 338 👁️ | Never ⏰ | []
text |

500 B

|

None

|

0 👍

/

0 👎

#version 150
 in vec3 position;
 uniform float height;
uniform float aspect = 4.0/3.0;
uniform float zNear;
uniform float zFar;
 mat4 camera = mat4(
    vec4(1.0/(height*aspect),        0.0,                0.0, 0.0),
    vec4(                0.0, 1.0/height,                0.0, 0.0),
    vec4(                0.0,        0.0, 2.0/(zFar - zNear), 0.0),
    vec4(                0.0,        0.0,         -zNear - 1, 1.0) 
);
 void main () {
    gl_Position = camera * vec4(position, 1.0);
}

Comments