1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 03:35:27 +00:00
OpenMW/files/shaders/sky_vertex.glsl

38 lines
826 B
Plaintext
Raw Normal View History

2022-04-24 15:29:16 +00:00
#version 120
2022-04-24 15:29:16 +00:00
#include "openmw_vertex.h.glsl"
2021-10-23 17:53:38 -07:00
#include "openmw_vertex.h.glsl"
2021-10-23 17:53:38 -07:00
#include "skypasses.glsl"
uniform int pass;
varying vec4 passColor;
varying vec2 diffuseMapUV;
mat4 selectModelViewMatrix()
{
#if @useOVR_multiview
2022-04-24 15:29:16 +00:00
mat4 viewOffsetMatrix = mw_viewMatrix();
// Sky geometries aren't actually all that distant. So delete view translation to keep them looking distant.
viewOffsetMatrix[3][0] = 0;
viewOffsetMatrix[3][1] = 0;
viewOffsetMatrix[3][2] = 0;
2022-04-24 15:29:16 +00:00
return viewOffsetMatrix;
#else
return gl_ModelViewMatrix;
#endif
}
2021-10-23 17:53:38 -07:00
void main()
{
2022-04-24 15:29:16 +00:00
gl_Position = mw_viewToClip(selectModelViewMatrix() * gl_Vertex);
2021-10-23 17:53:38 -07:00
passColor = gl_Color;
if (pass == PASS_CLOUDS)
diffuseMapUV = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy;
else
diffuseMapUV = gl_MultiTexCoord0.xy;
}