Error prior to using GLSL Program Object : invalid enumerant

Piko

13-06-2009 16:36:59

"Error prior to using GLSL Program Object : invalid enumerant" is the error that spams my terminal every time I interact with a gui. What is causing it?

kungfoomasta

13-06-2009 20:32:45

Its related to the GLSL shaders. Back when I rewrote the render system I used RBGUI as a reference, and adopted the shaders they provided.

Looking at the shaders, it doesn't seem like the pixel shaders do anything special, they just copy input straight across to output unmodified. The fragment shader, however, alters the output fragment color in some way, I'm not exactly sure what, since I haven't had the time to learn shaders. I decided to remove shaders and see what would happen to the rendering, and... everything seemed fine! I might need some other users to verify this, but I think we can scrap use of shaders altogether for rendering, and this should remove the error message you're seeing.

If you want to help me verify this, you can modify your Gui.material file, specifically the last definition, to this:

// Material for Gui rendering
material GuiMaterial
{
technique
{
pass
{
cull_hardware none
cull_software none

depth_check off
depth_write off

lighting off

// vertex_program_ref GuiVertexShader
// {
// ...
// }

// fragment_program_ref GuiPixelShader
// {
// ...
// }

texture_unit Image
{
tex_address_mode clamp
filtering linear linear none
}
}
}
}


If you can let me know if this solves your problem, it would be appreciated. :)

Piko

13-06-2009 20:46:30

Well I know quite a bit about GLSL, and I couldn't find anything wrong with the shader, but I removed the shader from the material, and the error seems to have gone away.

Your are correct in thinking that you really don't need a shader for what your doing because OpenGL, and DirectX can handle color blending on it's own with out the need for a shader. Unless you wanted to make some weird special effect, but none I can think of come to mind.

kungfoomasta

13-06-2009 21:04:20

Thanks for the quick response. I will clean up the shaders for the next release, now the material can be easily created programmatically, so users won't have to manage the shader programs/gui material on disk. Also users won't be required to support SM2.0 to use QuickGUI. :D

About the error, it was raised by another user not too long ago, and we couldn't really understand what caused the issue either. There were some posts in the Ogre forum about the same error message, in the end Sinbad wasn't able to repro it, it seems like some combination of using OpenGL and Ogre with certain video cards.