Send lovrEye to fragment shaders;
@@ -28,7 +28,6 @@ const char* lovrShaderVertexPrefix = ""
"#version 150 \n"
#endif
"#define MAX_BONES 48 \n"
-"#define lovrEye (gl_InstanceID & 1) \n"
"#define lovrTransform lovrTransforms[lovrEye] \n"
"#define lovrView lovrViews[lovrEye] \n"
"#define lovrProjection lovrProjections[lovrEye] \n"
@@ -43,6 +42,7 @@ const char* lovrShaderVertexPrefix = ""
"in vec4 lovrBoneWeights; \n"
"out vec2 texCoord; \n"
"out vec4 vertexColor; \n"
+"flat out int lovrEye; \n"
"layout(std140) uniform lovrCamera { \n"
" mat4 lovrProjections[2]; \n"
" mat4 lovrViews[2]; \n"
@@ -64,6 +64,7 @@ const char* lovrShaderFragmentPrefix = ""
#endif
"in vec2 texCoord; \n"
"in vec4 vertexColor; \n"
+"flat in int lovrEye; \n"
"out vec4 lovrCanvas[gl_MaxDrawBuffers]; \n"
"uniform float lovrMetalness; \n"
"uniform float lovrRoughness; \n"
@@ -83,6 +84,7 @@ const char* lovrShaderVertexSuffix = ""
"void main() { \n"
" texCoord = lovrTexCoord; \n"
" vertexColor = lovrVertexColor; \n"
+" lovrEye = gl_InstanceID & 1; \n"
" mat4 pose = \n"
" lovrPose[lovrBones[0]] * lovrBoneWeights[0] + \n"
" lovrPose[lovrBones[1]] * lovrBoneWeights[1] + \n"
