Environment Mapping Issues - glDrawElements INVALID OPERATION

Alright so I am having an issue with environment mapping, basically when I use any method to combine the result texture of the environment map on the object and the base texture and lighting am Invalid operation will be generated on the glDrawElements, this only occurs when combining these two values, each value on its own works, and the components of each value also work fine on there own. (you can check out the link to my game dev post for the images)

I have attached my shaders in tags below this, and marked the line with a comment that is the root of the problem, if I comment this line out the shader will run fine, before you ask I have tried every combination of this line, including writing my own mix function (lerp).

So what causes the INVALID OPERATION when that line is uncommented?

It will not let me post code tags, not sure what the issue is, because it tells me that new posts are limited by urls and forbidden words. so you just going to have to go to the gamedev post to see this stuff because I cannot post it here, let me be clear I would if I could.

This is a X-post from Gamedev and apparently I am not allowed to post any url’s this is a major failing of this forum because this link is highly relevant, alas I will just have to tell you that you find find this post on the first page of the gamedev technical openGL forum. entitled Environment Mapping Issues

Read up on glValidateProgram and how bad shader state can cause drawing commands to throw GL_INVALID_OPERATION.
In your case I guess, one of your samplers2D uniforms shares the same texture unit as the sampleCube you’re using.

[QUOTE=skynet;1249071]Read up on glValidateProgram and how bad shader state can cause drawing commands to throw GL_INVALID_OPERATION.
In your case I guess, one of your samplers2D uniforms shares the same texture unit as the sampleCube you’re using.[/QUOTE]

Thank you, that solved my issue, and your guess was bang on.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.