Error prior to using GLSL Program Object : invalid enumerant
-
- Kobold
- Posts: 27
- Joined: Thu Oct 11, 2007 12:43 am
- Location: Aachen, Germany
Error prior to using GLSL Program Object : invalid enumerant
Hello!
I have a problem that I cannot resolve. My application runs fine, however the log gets spammed with the following line:
Error prior to using GLSL Program Object : invalid enumerant
..about once for every frame and mesh with a GLSL material. This does not only happen when using my own shader programs (which are the first I've ever written), but also with ones from the Ogre examples. However the demos themselves do not spit this error.
This might be introduced with updating the 1.6 branch from svn when RC1 was announced (before that, my copy was one or two weeks old). Of course it might also be my own fault, but I already tried out a lot.
From googling I found out that the error might actually be produced somewhere totally different, but the GLSL code is the first that checks for errors. I don't know if that's the case for Ogre.
Maybe someone can point me to a direction how I can debug this. Right now, I'm totally stepping in the dark. Any help is appreciated!
Here's the obligatory Ogre log: http://pastebin.ca/1192088
Thanks for your patience,
Cmdr
Update: Having no lights in my scene seems to fix it, no matter if the shaders care about lights or not...
I have a problem that I cannot resolve. My application runs fine, however the log gets spammed with the following line:
Error prior to using GLSL Program Object : invalid enumerant
..about once for every frame and mesh with a GLSL material. This does not only happen when using my own shader programs (which are the first I've ever written), but also with ones from the Ogre examples. However the demos themselves do not spit this error.
This might be introduced with updating the 1.6 branch from svn when RC1 was announced (before that, my copy was one or two weeks old). Of course it might also be my own fault, but I already tried out a lot.
From googling I found out that the error might actually be produced somewhere totally different, but the GLSL code is the first that checks for errors. I don't know if that's the case for Ogre.
Maybe someone can point me to a direction how I can debug this. Right now, I'm totally stepping in the dark. Any help is appreciated!
Here's the obligatory Ogre log: http://pastebin.ca/1192088
Thanks for your patience,
Cmdr
Update: Having no lights in my scene seems to fix it, no matter if the shaders care about lights or not...
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
-
- Kobold
- Posts: 27
- Joined: Thu Oct 11, 2007 12:43 am
- Location: Aachen, Germany
Unfortunately, it's still there. I would really like to help by narrowing down possible causes, but I'm still totally clueless. Please forget my guess with the lights as well.
In the meanwhile, I updated to nVidia driver version 173.14.12, which is the latest stable. I'm also trying to compile my app on windows to see if it happens there.
In the meanwhile, I updated to nVidia driver version 173.14.12, which is the latest stable. I'm also trying to compile my app on windows to see if it happens there.
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
-
- Kobold
- Posts: 27
- Joined: Thu Oct 11, 2007 12:43 am
- Location: Aachen, Germany
Commenting that line would at least allow me to test my game without being afraid of filling my disk with the Ogre.log
I plan on going open source with my project anyway (as soon I find a cool name for it
), however it consists of almost 13k lines of code and has several dependencies. But I can try to create a stripped-down version that only shows graphics if you want to be able to compile it easily.

I plan on going open source with my project anyway (as soon I find a cool name for it

- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
-
- Kobold
- Posts: 27
- Joined: Thu Oct 11, 2007 12:43 am
- Location: Aachen, Germany
-
- Kobold
- Posts: 27
- Joined: Thu Oct 11, 2007 12:43 am
- Location: Aachen, Germany
As a status report: in my test app I fixed the problem by commenting the following line:
But in my main project this does not suffice. Maybe there is an issue with my reflection/refraction material too.
Code: Select all
sceneMgr->setShadowTechnique(Ogre::SHADOWTYPE_TEXTURE_MODULATIVE);
-
- Gnome
- Posts: 387
- Joined: Thu May 08, 2008 3:46 pm
- Location: Russia, Moscow
Today i also get this error in my log, and before some investigation i figured out that error which make this error is unsetted uniforms, because of when i checked all uniforms in shader and added undefinde in ".program" script all works fine, so i create this thread to find out best decision on this problem.
Here is new thread in feature request: http://www.ogre3d.org/phpBB2/viewtopic. ... 650#308650
Here is new thread in feature request: http://www.ogre3d.org/phpBB2/viewtopic. ... 650#308650
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
-
- Gnome
- Posts: 387
- Joined: Thu May 08, 2008 3:46 pm
- Location: Russia, Moscow
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
-
- Gnome
- Posts: 387
- Joined: Thu May 08, 2008 3:46 pm
- Location: Russia, Moscow
it's from samples: examples.program,
i commented params:
and created material:
created entity with that material and get log full of messages(from every frame):
And to find which shader is wrong is very very difficult when you have many shaders(
i commented params:
Code: Select all
vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureGLSL glsl
{
source AmbientOneTexture.glsl
default_params
{
//param_named_auto ambient ambient_light_colour
}
}
Code: Select all
material error_generator
{
technique
{
pass
{
vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTextureGLSL
{
}
}
}
}
Code: Select all
12:39:31: Error prior to using GLSL Program Object : unsupported operation("unsupported operation" i translated from Russian, because i think my driver is Russian it writes errors in native language) Fragment shader(s) linked, vertex shader(s) linked.
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
- metaldev
- Orc Shaman
- Posts: 761
- Joined: Thu Mar 17, 2005 11:56 pm
- Location: Boston
- x 15
- Contact:
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
-
- Gnoblar
- Posts: 4
- Joined: Tue Dec 02, 2008 4:55 pm
I get this error too. On every GLSL-shader I use and every frame, but they all give the correct output to the screen. I will try to create a minimal test case and see if I can locate the error.
(I changed the error message to also show the current shader it tries to use. )
I've got an Geforce 8800 gts so it's not an ATI error.
/Robert
Code: Select all
03:59:36: VP = NormalDepth_vs_glslFP = NormalDepth_ps_glsl Error prior to using GLSL Program Object : felaktig åtgärd
03:59:36: VP = FullScreenQuad_vs_glslFP = SSAO_ps_glsl Error prior to using GLSL Program Object : felaktig åtgärd
03:59:36: VP = FullScreenQuadFlipped2_vs_glslFP = BlurX_ps_glsl Error prior to using GLSL Program Object : felaktig åtgärd
03:59:36: VP = FullScreenQuadFlipped2_vs_glslFP = BlurY_ps_glsl Error prior to using GLSL Program Object : felaktig åtgärd
03:59:36: VP = FullScreenQuadFlipped2_vs_glslFP = Combination_ps_glsl Error prior to using GLSL Program Object : felaktig åtgärd
I've got an Geforce 8800 gts so it's not an ATI error.
/Robert
- petrocket
- Gremlin
- Posts: 178
- Joined: Tue Mar 20, 2007 3:29 am
- x 10
- Contact:
Re: Error prior to using GLSL Program Object : invalid enumerant
I also get this error too on my Macbook pro which as the geforce 8600 mt and I'm concerned that it's affecting my framerate. Gonna comment out the log line for now, but isn't it likely that openGL is not running optimally if we get this warning?
I'm using Ogre 1.6 (not RC1) which I compiled from source in release mode
Does anyone have any idea how to debug this warning/error? Is there a way to set a break point in the GL rendersystem library while running a a diff program? I'm not experienced debugging libraries on OSX yet. /me visits google
I'm using Ogre 1.6 (not RC1) which I compiled from source in release mode
Does anyone have any idea how to debug this warning/error? Is there a way to set a break point in the GL rendersystem library while running a a diff program? I'm not experienced debugging libraries on OSX yet. /me visits google
Code: Select all
Error prior to using GLSL Program Object : invalid enumerantWARNING: Could not find vertex shader attribute 'vertex' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'blendWeights' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'normal' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'colour' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'secondary_colour' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'blendIndices' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'uv0' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'uv1' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'uv2' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'uv3' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'uv4' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'uv5' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'uv6' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'uv7' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'tangent' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'binormal' to match BindAttributeLocation request.
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
-
- Gnoblar
- Posts: 8
- Joined: Thu Dec 04, 2008 12:20 pm
Re: Error prior to using GLSL Program Object : invalid enumerant
Hey guys,
I'm getting the same problem, and maybe someone of you can reconstruct that error with the provided code:
I'm using a Composer effect. Not really an effect but it is used to implement Softedge Blending between several Projectors:
The material i used looks like this: (I shortened it a bit)
The vertexProgram looks like this (basicaly just a renamed version of the existing StdQuad*glsl):
and here goes the fragment program:
In my application itself i do the following:
like all the others the output shows exactly what I expect from my program, but the console is spammed with the folling line:
Error prior to using GLSL Program Object : invalid enumerant
BTW: This is the only Compositor i use in my Application, but not the only Material, but all the other Materials don't make such Problems (and they all are written in GLSL).
Hopefully someone knows a solution to this problem,
thanks for taking the time to read to this (almost) very last line
lg, Myke.
I'm getting the same problem, and maybe someone of you can reconstruct that error with the provided code:
I'm using a Composer effect. Not really an effect but it is used to implement Softedge Blending between several Projectors:
Code: Select all
compositor SoftEdge
{
technique
{
// Temporary textures
texture rt0 target_width target_height PF_A8R8G8B8
// renders the scene into rt0
target rt0
{
// Render output from previous compositor (or original scene)
input previous
}
target_output
{
// Start with clear output
input none
shadows off
// Draw a fullscreen quad with the black and white image
pass render_quad
{
material Ogre/Compositor/Softedge
input 0 rt0
}
}
}
}
Code: Select all
vertex_program Ogre/Compositor/StdQuad_GL glsl
{
source StdQuad.vert.glsl
}
fragment_program Ogre/Compositor/B&W_GL glsl
{
source GrayScale.frag.glsl
}
material Ogre/Compositor/Softedge
{
technique
{
pass
{
depth_check off
vertex_program_ref Ogre/Compositor/StdQuad_GL
{
}
fragment_program_ref Ogre/Compositor/B&W_GL
{
param_named renderedScene int 0
param_named alphaMap int 1
param_named xInvert float 0.0
param_named yInvert float 0.0
}
texture_unit 0 // unit 0
{
tex_coord_set 0
tex_address_mode clamp
filtering trilinear
}
texture_unit 1 // unit 1
{
texture soft1edgeH.TIF 2d
filtering bilinear
tex_coord_set 0
tex_address_mode clamp
}
// further texture_units follow here.
}
}
}
Code: Select all
varying vec2 uv;
void main()
{
gl_Position = ftransform();
// compute texture coords on the fly
vec2 inPos = sign(gl_Vertex.xy);
uv = (vec2(inPos.x, -inPos.y) + 1.0)/2.0;
}
Code: Select all
varying vec2 uv;
uniform sampler2D renderedScene;
uniform sampler2D alphaMap;
uniform float xInvert;
uniform float yInvert;
void main()
{
vec2 uv_alpha = vec2(abs(xInvert - uv.r), abs(yInvert - uv.g));
vec3 color = texture2D(renderedScene, uv).rgb * texture2D(alphaMap, uv_alpha).rgb;
gl_FragColor = vec4(color, 1.0);
}
Code: Select all
Ogre::CompositorInstance* instance = Ogre::CompositorManager::getSingletonPtr()->addCompositor(mViewport, "SoftEdge");
if (instance) {
Ogre::CompositorManager::getSingleton().setCompositorEnabled(vp, "SoftEdge", true);
}
Ogre::ResourcePtr resource = Ogre::MaterialManager::getSingletonPtr()->getByName("Ogre/Compositor/Softedge");
if (!resource.isNull())
{
Ogre::Material* material = dynamic_cast<Ogre::Material*>(resource.get());
if (material) {
mVertParams = material->getTechnique(0)->getPass(0)->getFragmentProgramParameters();
}
}
// something in between
mVertParams->setNamedConstant("xInvert", Ogre::Real(xInv));
mVertParams->setNamedConstant("yInvert", Ogre::Real(yInv));
mVertParams->setNamedConstant("alphaMap", alphaMapIndex);
Error prior to using GLSL Program Object : invalid enumerant
BTW: This is the only Compositor i use in my Application, but not the only Material, but all the other Materials don't make such Problems (and they all are written in GLSL).
Hopefully someone knows a solution to this problem,
thanks for taking the time to read to this (almost) very last line
lg, Myke.
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
Re: Error prior to using GLSL Program Object : invalid enumerant
Did you try the Subversion 1.6 branch? That includes the updates that I talked about in the above link, and it's solved my problems.
- metaldev
- Orc Shaman
- Posts: 761
- Joined: Thu Mar 17, 2005 11:56 pm
- Location: Boston
- x 15
- Contact:
Re: Error prior to using GLSL Program Object : invalid enumerant
wow i just updated to 1.6.1 and the problem is fixed, thank god (and you too sinbad
)
also, a note for anyone also changing to 1.6.1 i had to update my compositors to match the ones in the 1.6.1 demos because my original ones crashed on runtime in 1.6.1.
thanks sinbad!

also, a note for anyone also changing to 1.6.1 i had to update my compositors to match the ones in the 1.6.1 demos because my original ones crashed on runtime in 1.6.1.
thanks sinbad!
- xabila
- Goblin
- Posts: 225
- Joined: Mon Jun 05, 2006 9:40 am
- Location: rennes [FR]
Re: Error prior to using GLSL Program Object : invalid enumerant
I'm also on Ogre 1.6.1 now but i still get the error on the SkeletalAnimation.
I'm on Fedora core 9, and my driver is the 177.82 on a Quadro FX Go1400
Any idea?
I'm on Fedora core 9, and my driver is the 177.82 on a Quadro FX Go1400
Any idea?
- xabila
- Goblin
- Posts: 225
- Joined: Mon Jun 05, 2006 9:40 am
- Location: rennes [FR]
Re: Error prior to using GLSL Program Object : invalid enumerant
Well I've got exactly the same problem on windows on a Gforge 7900GT, with Ogre 1.6.1.
Maybe it's my code : (Actually it's the OgreBUllet Demo Code)
And i'm using the data on Ogre/Sample Media...
Maybe it's my code : (Actually it's the OgreBUllet Demo Code)
Code: Select all
void OgreView::initShadow()
{
_pSceneMgr->setShadowColour(ColourValue(0.5, 0.5, 0.5));
Ogre::PixelFormat pxlFmt = Ogre::PF_L8;
if (_pRoot->getRenderSystem()->getCapabilities()->hasCapability(Ogre::RSC_TEXTURE_FLOAT))
{
pxlFmt = Ogre::PF_FLOAT16_R;
}
if (pxlFmt != Ogre::PF_L8)
{
String CUSTOM_CASTER_MATERIAL("Ogre/DepthShadowmap/Caster/Float");
String CUSTOM_RECEIVER_MATERIAL("Ogre/DepthShadowmap/Receiver/Float");
_pSceneMgr->setShadowTextureSelfShadow(true);
_pSceneMgr->setShadowTextureCasterMaterial(CUSTOM_CASTER_MATERIAL);
_pSceneMgr->setShadowTextureReceiverMaterial(CUSTOM_RECEIVER_MATERIAL + "/PCF");
//_pSceneMgr->setShadowTextureReceiverMaterial(CUSTOM_RECEIVER_MATERIAL);
}
Ogre::LiSPSMShadowCameraSetup *mLiSPSMSetup = new Ogre::LiSPSMShadowCameraSetup();
mLiSPSMSetup->setUseAggressiveFocusRegion(true);
//mLiSPSMSetup->setUseSimpleOptimalAdjust(true);
mLiSPSMSetup->setOptimalAdjustFactor(1.1f);
_pSceneMgr->setShadowCameraSetup(Ogre::ShadowCameraSetupPtr(mLiSPSMSetup));
_pSceneMgr->setShadowTechnique(Ogre::SHADOWTYPE_TEXTURE_ADDITIVE );
if (_pRoot->getRenderSystem()->getCapabilities()->hasCapability(RSC_HWRENDER_TO_TEXTURE))
{
// In D3D, use a 1024x1024 shadow texture
_pSceneMgr->setShadowTextureSettings(2048, 2, pxlFmt);
}
else
{
// Use 512x512 texture in GL since we can't go higher than the window res
_pSceneMgr->setShadowTextureSettings(512, 2, pxlFmt);
}
}