static const char VERTEX_SHADER[] = "#ifndef DISABLE_MULTIVIEW\n" " #define DISABLE_MULTIVIEW 0\n" "#endif\n" "#define NUM_VIEWS 2\n" "#if defined( GL_OVR_multiview2 ) && ! DISABLE_MULTIVIEW\n" " #extension GL_OVR_multiview2 : enable\n" " layout(num_views=NUM_VIEWS) in;\n" " #define VIEW_ID gl_ViewID_OVR\n" "#else\n" " uniform lowp int ViewID;\n" " #define VIEW_ID ViewID\n" "#endif\n" "in vec3 vertexPosition;\n" "in vec4 vertexColor;\n" "in mat4 vertexTransform;\n" "uniform SceneMatrices\n" "{\n" " uniform mat4 ViewMatrix[NUM_VIEWS];\n" " uniform mat4 ProjectionMatrix;\n" "} sm;\n" "out vec4 fragmentColor;\n" "out vec4 fragmentColor2;\n" "void main()\n" "{\n" " gl_Position = sm.ProjectionMatrix * ( sm.ViewMatrix[VIEW_ID] * ( vertexTransform * vec4( vertexPosition, 1.0 ) ) );\n" " fragmentColor = vertexColor;\n" " fragmentColor2 = vertexColor*0.1;\n" "}\n"; static const char FRAGMENT_SHADER[] = "#extension GL_OVR_multiview2 : enable\n" "in mediump vec4 fragmentColor;\n" "in mediump vec4 fragmentColor2;\n" "out mediump vec4 outColor;\n" "void main()\n" "{\n" "mediump vec4 v_testColor = gl_ViewID_OVR == 0u ? vec4(1.0,0.0,0.0,1.0) : vec4(0.0,1.0,0.0,1.0);\n" "outColor = fragmentColor*0.0001 + fragmentColor2*0.001 + v_testColor;\n" "}\n";