1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 17:59:56 +00:00
openmw/files/shaders/sky_vertex.glsl
madsbuvi dd5901d351 Initial commit
Multiview shaders.

Refactor Frustum management

Rewrite shared shadow map

cull mask should respect stereo

Stereo savegame screencap

LocalMap refactoring

use the vertex buffer hint instead of the display list patch to enable/disable display lists

Character preview fixes
2022-04-28 21:05:34 +02:00

37 lines
851 B
GLSL

#version @GLSLVersion
#include "multiview_vertex.glsl"
#include "openmw_vertex.h.glsl"
#include "skypasses.glsl"
uniform int pass;
varying vec4 passColor;
varying vec2 diffuseMapUV;
mat4 selectModelViewMatrix()
{
#if @useOVR_multiview
mat4 viewOffsetMatrix = viewMatrixMultiView[gl_ViewID_OVR];
// 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;
return viewOffsetMatrix * gl_ModelViewMatrix;
#else
return gl_ModelViewMatrix;
#endif
}
void main()
{
gl_Position = mw_modelToClip(gl_Vertex);
passColor = gl_Color;
if (pass == PASS_CLOUDS)
diffuseMapUV = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy;
else
diffuseMapUV = gl_MultiTexCoord0.xy;
}