1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-02 12:33:52 +00:00
lovr/etc/shaders/cubemap.vert

23 lines
517 B
GLSL
Raw Normal View History

2022-07-04 07:18:38 +00:00
#version 460
#extension GL_EXT_multiview : require
#extension GL_GOOGLE_include_directive : require
#include "lovr.glsl"
2022-07-31 18:18:15 +00:00
vec4 lovrmain() {
2022-07-04 07:18:38 +00:00
const vec2 uvs[6] = vec2[6](
vec2(-1, -1),
vec2(-1, +1),
vec2(+1, -1),
vec2(+1, -1),
vec2(-1, +1),
vec2(+1, +1)
);
vec2 uv = uvs[VertexIndex % 6];
vec3 ray = vec3(uv, -1.);
mat3 inverseViewOrientation = transpose(mat3(View));
2022-07-31 18:18:15 +00:00
Normal = normalize(inverseViewOrientation * (InverseProjection * vec4(ray, 1.)).xyz);
return vec4(uv, 0, 1);
2022-07-04 07:18:38 +00:00
}