openmw/files/shaders/lib/core/vertex_multiview.glsl

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
529 B
Text
Raw Permalink Normal View History

#version 330 compatibility
// Note: compatibility profile required to access gl_ModelViewMatrix
2022-04-24 15:29:16 +00:00
#extension GL_OVR_multiview : require
#extension GL_OVR_multiview2 : require
layout(num_views = @numViews) in;
2023-02-25 11:03:39 -08:00
#include "lib/core/vertex.h.glsl"
2022-04-24 15:29:16 +00:00
uniform mat4 projectionMatrixMultiView[@numViews];
2023-02-25 11:03:39 -08:00
vec4 modelToClip(vec4 pos)
2022-04-24 15:29:16 +00:00
{
2023-02-25 11:03:39 -08:00
return viewToClip(modelToView(pos));
2022-04-24 15:29:16 +00:00
}
2023-02-25 11:03:39 -08:00
vec4 modelToView(vec4 pos)
2022-04-24 15:29:16 +00:00
{
2022-06-21 15:55:06 +00:00
return gl_ModelViewMatrix * pos;
2022-04-24 15:29:16 +00:00
}
2023-02-25 11:03:39 -08:00
vec4 viewToClip(vec4 pos)
2022-04-24 15:29:16 +00:00
{
2022-06-21 15:55:06 +00:00
return projectionMatrixMultiView[gl_ViewID_OVR] * pos;
2023-02-25 11:03:39 -08:00
}