2020-11-12 23:13:29 +08:00
|
|
|
#version 330
|
|
|
|
#extension GL_OVR_multiview2 : enable
|
|
|
|
|
2020-11-12 23:53:38 +08:00
|
|
|
#define NUM_VIEWS 2
|
|
|
|
|
|
|
|
layout(num_views = NUM_VIEWS) in;
|
2020-11-12 23:13:29 +08:00
|
|
|
|
2020-11-13 01:04:22 +08:00
|
|
|
uniform mat4 osg_ModelViewMatrix;
|
|
|
|
uniform mat4 osg_ProjectionMatrix;
|
2020-11-12 23:13:29 +08:00
|
|
|
|
2020-11-13 01:04:22 +08:00
|
|
|
uniform mat4 ovr_projectionMatrix[NUM_VIEWS];
|
|
|
|
uniform mat4 ovr_viewMatrix[NUM_VIEWS];
|
2020-11-12 23:53:38 +08:00
|
|
|
|
2020-11-12 23:13:29 +08:00
|
|
|
in vec4 osg_Vertex;
|
2020-11-13 02:35:16 +08:00
|
|
|
in vec4 osg_Color;
|
2020-11-12 23:13:29 +08:00
|
|
|
in vec4 osg_MultiTexCoord0;
|
|
|
|
|
2020-11-13 02:35:16 +08:00
|
|
|
out vec4 color;
|
2020-11-12 23:13:29 +08:00
|
|
|
out vec2 texcoord;
|
2020-11-12 20:36:24 +08:00
|
|
|
|
|
|
|
void main(void)
|
|
|
|
{
|
2020-11-13 01:04:22 +08:00
|
|
|
mat4 mvp = ovr_projectionMatrix[gl_ViewID_OVR] * osg_ProjectionMatrix * ovr_viewMatrix[gl_ViewID_OVR] * osg_ModelViewMatrix;
|
2020-11-12 23:53:38 +08:00
|
|
|
|
2020-11-13 02:35:16 +08:00
|
|
|
color = osg_Color;
|
2020-11-12 23:13:29 +08:00
|
|
|
texcoord = osg_MultiTexCoord0.xy;
|
2020-11-13 01:04:22 +08:00
|
|
|
|
|
|
|
gl_Position = mvp * osg_Vertex;
|
2020-11-12 20:36:24 +08:00
|
|
|
}
|