Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #version 330 core
- layout (location = 0) in vec3 aPos;
- layout (location = 1) in vec2 aTexCoord;
- out vec2 TexCoord;
- uniform mat4 view;
- uniform mat4 projection;
- uniform vec3 pos;
- uniform float aspectRatio;
- uniform float yrot;
- uniform int sheetInvert;
- void main()
- {
- vec3 right = vec3(view[0][0], view[1][0], view[2][0]);
- vec3 up = vec3(view[0][1], view[1][1], view[2][1]);
- vec3 forward = vec3(view[0][2], view[1][2], view[2][2]);
- vec3 upt = aPos.y * up;
- //upt = vec3(0.0, aPos.y, 0.0);
- float angle = yrot;
- float l = sqrt(0.5 - (cos(radians(abs(angle))) / 2)) * -sign(angle);
- vec3 center = pos + (normalize(vec3(forward) * vec3(1.0, 0.0, 1.0)) * -l);
- vec3 vertexPosition = center + (right * aPos.x * aspectRatio) + (upt);
- gl_Position = projection * view * vec4(vertexPosition, 1.0f);
- TexCoord = vec2(abs(aTexCoord.x - sheetInvert), aTexCoord.y);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement