diff --git a/examples/osgmultiviewOVR/multiviewOVR.frag b/examples/osgmultiviewOVR/multiviewOVR.frag index 19b4e006d..7f4d05d18 100644 --- a/examples/osgmultiviewOVR/multiviewOVR.frag +++ b/examples/osgmultiviewOVR/multiviewOVR.frag @@ -2,11 +2,13 @@ uniform sampler2D texture; +in vec4 color; in vec2 texcoord; out vec4 fragColor; void main(void) { - fragColor = texture2D( texture, texcoord.xy); + fragColor = color * texture2D( texture, texcoord.xy); + if (fragColor.a==0.0) discard; } diff --git a/examples/osgmultiviewOVR/multiviewOVR.vert b/examples/osgmultiviewOVR/multiviewOVR.vert index bca31aeb4..79e8164dd 100644 --- a/examples/osgmultiviewOVR/multiviewOVR.vert +++ b/examples/osgmultiviewOVR/multiviewOVR.vert @@ -12,14 +12,17 @@ uniform mat4 ovr_projectionMatrix[NUM_VIEWS]; uniform mat4 ovr_viewMatrix[NUM_VIEWS]; in vec4 osg_Vertex; +in vec4 osg_Color; in vec4 osg_MultiTexCoord0; +out vec4 color; out vec2 texcoord; void main(void) { mat4 mvp = ovr_projectionMatrix[gl_ViewID_OVR] * osg_ProjectionMatrix * ovr_viewMatrix[gl_ViewID_OVR] * osg_ModelViewMatrix; + color = osg_Color; texcoord = osg_MultiTexCoord0.xy; gl_Position = mvp * osg_Vertex;