GLSL: Unique shader and Data Corruption!

Started by
11 comments, last by Neosettler 11 years, 2 months ago
This is true. Is the idea of your unique shader to use the same shader for every object?

Yes indeed,
While I understand the simplicity of that, it would result in alot of redundant calculations

Well, I was under the impression a if statement is a if statement... apparently, the portion inside a condition that is not being use has to be considered has if it was in order for the shader to render correctly. Strangely, the bug is not constant and very hard to track. I did noticed however that it rendered correctly when removing few objects from my scene which use no textures. I must be missing something.

...digging the uber shader.
Advertisement

As Phantom mentioned on newer cards your if statements would perform more like CPU if statements. But from the sounds of it your card might be a few years old so Uber shaders might be your answer. Like most good things in life there is a down side to them, they can become a bit of a nightmare to manage the larger they get.

Try to run your program through an app like gDEbugger or GPU PerfStudio so you can see what data OpenGL is receiving. Makes debugging a bit easier. Some objects might be overwriting uniform buffer data or something.

very good find Nyssa with the gDEBugger, Nice tool! It turns out that my glitch was caused by the lack of calling glFinish!

case closed. thank you all for your inputs.

Cheers!

This topic is closed to new replies.

Advertisement