Discussion:
Debugging "Warning: detected OpenGL error 'invalid value' after RenderBin::draw(, )"
Jean-Sébastien Guay
2007-10-24 18:59:44 UTC
Permalink
Hello Robert,

I remember you mentioning a way (in OSG) to find out the source of the message

Warning: detected OpenGL error 'invalid value' after RenderBin::draw(,)

sometime in the past, but can't find the post just now. I recall it
having to do with setting something in a stateset to get explicit
debug messages printed which would help find the source of the
message...

I'm getting this when updating a vertex attribute array, and I was
hoping there was a way to eliminate it, because my geometry also
disappears when it happens, which leads to flashing (as I'm updating
attributes in a loop, and the message seems to pop up once in
approximately 10 attributes updated).

Thanks in advance for any advice on how to debug this situation.

J-S
--
______________________________________________________
Jean-Sebastien Guay jean-sebastien.guay-scC8bbJcJLCw5LPnMra/***@public.gmane.org
http://whitestar02.webhop.org/

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Michael Henheffer
2007-10-24 19:30:52 UTC
Permalink
Hi J-S,

I think calling the following might be what you are looking for to
narrow down the source of your error.

pState->setCheckForGLErrors
(osg::State::CheckForGLErrors::ONCE_PER_ATTRIBUTE)

where pState is a pointer to the osg::State.

Hope this helps,
Mike
Post by Jean-Sébastien Guay
Hello Robert,
I remember you mentioning a way (in OSG) to find out the source of the message
Warning: detected OpenGL error 'invalid value' after RenderBin::draw(,)
sometime in the past, but can't find the post just now. I recall it
having to do with setting something in a stateset to get explicit
debug messages printed which would help find the source of the
message...
I'm getting this when updating a vertex attribute array, and I was
hoping there was a way to eliminate it, because my geometry also
disappears when it happens, which leads to flashing (as I'm updating
attributes in a loop, and the message seems to pop up once in
approximately 10 attributes updated).
Thanks in advance for any advice on how to debug this situation.
J-S
--
Michael Henheffer - Software Developer
Core3D/Easy View
CARIS
115 Waggoners Lane, Fredericton, New Brunswick, Canada, E3B 2L4
Tel: +1-506-458-8533 Fax: +1-506-459-3849
_________________________________________________________________________
New Viewer for 2D and 3D Data
Download your free copy of CARIS Easy View today!
www.caris.com/easyview
_________________________________________________________________________

This email and any files transmitted with it are confidential and
intended only for the addressee(s). If you are not the intended
recipient(s) please notify us by email reply. You should not use,
disclose, distribute or copy this communication if received in error.

Any views or opinions expressed in this email are solely those of the
author and do not necessarily represent those of the company. No binding
contract will result from this email until such time as a written
document is signed on behalf of the company.
Cole, Charles E. (LARC-B702)[GENEX SYSTEMS]
2007-10-24 20:07:04 UTC
Permalink
This was Robert's response to a similar situation:

--->
Its likely that some OpenGL state you are setting isn't supported on
your hardware. The big question is what OpenGL features are causing
this problem. You could enable finer grained checking for OpenGL errros
via osg::State::setCheckForGLErrors(osg:State::ONCE_PER_ATTRIBUTE);
Or enable by tweaking the State constructor in src/osg/State.cpp.
You'll see a block:

#if 1
_checkGLErrors = ONCE_PER_FRAME;
#else
_checkGLErrors = ONCE_PER_ATTRIBUTE; #endif

Just change the #if 1 to #if 0.

This might give you a bit more info.

Robert.
<---

chuck
Jean-Sébastien Guay
2007-10-25 00:00:39 UTC
Permalink
Hello Chuck,
Yes, that was the message I was looking for. Thanks!

J-S
--
______________________________________________________
Jean-Sebastien Guay jean-sebastien.guay-scC8bbJcJLCw5LPnMra/***@public.gmane.org
http://whitestar02.webhop.org/

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Mihai Radu
2007-10-25 18:19:36 UTC
Permalink
Hi,

I hit the same problem with code ported from 1.2 to 2.0, and to trace it
I used gDebugger ( the trial ) and set breakpoints to OpenGL errors.

In my case it turned out to be using osg::Program without any shaders
for some parts of the scene.
I'll try this way also, see if it confirms the gDebbugger results.

I also found some more debugger programs, not as advanced as gDebugger,
but with some interesting features for shader debugging:
http://glintercept.nutty.org/index.html
http://graphics.stanford.edu/projects/shadesmith/ this one has very
powerful visualization options for shader variables, but they mention
that to debug it has to create it's own context, leaving me with a bit
of a problem as to how to implement it ( although if anybody can hook it
up to an osg app, then it could be used for ANY osg app )

Cheers
Mihai
Post by Cole, Charles E. (LARC-B702)[GENEX SYSTEMS]
--->
Its likely that some OpenGL state you are setting isn't supported on
your hardware. The big question is what OpenGL features are causing
this problem. You could enable finer grained checking for OpenGL errros
via osg::State::setCheckForGLErrors(osg:State::ONCE_PER_ATTRIBUTE);
Or enable by tweaking the State constructor in src/osg/State.cpp.
#if 1
_checkGLErrors = ONCE_PER_FRAME;
#else
_checkGLErrors = ONCE_PER_ATTRIBUTE; #endif
Just change the #if 1 to #if 0.
This might give you a bit more info.
Robert.
<---
chuck
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Jean-Sébastien Guay
2007-10-24 23:59:03 UTC
Permalink
Hello Michael,
Post by Michael Henheffer
I think calling the following might be what you are looking for to
narrow down the source of your error.
pState->setCheckForGLErrors
(osg::State::CheckForGLErrors::ONCE_PER_ATTRIBUTE)
where pState is a pointer to the osg::State.
Yep, that sounds like it should do the trick. I'll try it first thing
tomorrow morning.

Thanks,

J-S
--
______________________________________________________
Jean-Sebastien Guay jean-sebastien.guay-scC8bbJcJLCw5LPnMra/***@public.gmane.org
http://whitestar02.webhop.org/

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Craig, Joel S. (SED/TMI)
2007-10-24 21:24:29 UTC
Permalink
Classification: UNCLASSIFIED
Caveats: NONE

We received this error message whenever our thread tried to update the state
of a node while the drawing thread was trying to render it. Adding a mutex
solved our issue.



-----Original Message-----
From: osg-users-bounces-***@public.gmane.org
[mailto:osg-users-bounces-***@public.gmane.org] On Behalf Of
Jean-Sébastien Guay
Sent: Wednesday, October 24, 2007 2:00 PM
To: osg-users-***@public.gmane.org
Subject: [osg-users] Debugging "Warning: detected OpenGL error 'invalid
value' after RenderBin::draw(, )"

Hello Robert,

I remember you mentioning a way (in OSG) to find out the source of the
message

Warning: detected OpenGL error 'invalid value' after RenderBin::draw(,)

sometime in the past, but can't find the post just now. I recall it having
to do with setting something in a stateset to get explicit debug messages
printed which would help find the source of the message...

I'm getting this when updating a vertex attribute array, and I was hoping
there was a way to eliminate it, because my geometry also disappears when it
happens, which leads to flashing (as I'm updating attributes in a loop, and
the message seems to pop up once in approximately 10 attributes updated).

Thanks in advance for any advice on how to debug this situation.

J-S
--
______________________________________________________
Jean-Sebastien Guay jean-sebastien.guay-scC8bbJcJLCw5LPnMra/***@public.gmane.org
http://whitestar02.webhop.org/

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


_______________________________________________
osg-users mailing list
osg-users-***@public.gmane.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Classification: UNCLASSIFIED
Caveats: NONE
Jean-Sébastien Guay
2007-10-25 00:04:29 UTC
Permalink
Hello Joel,
Post by Craig, Joel S. (SED/TMI)
We received this error message whenever our thread tried to update the state
of a node while the drawing thread was trying to render it. Adding a mutex
solved our issue.
Hmmm, I'm doing this in the update traversal, so I should be ok on
that front... But maybe I'll test it out in SingleThreaded mode and
see if I still get that message.

Thanks for the interesting lead. This, with the check for GL errors
stateset thing, will surely help me find the source of the problem.

J-S
--
______________________________________________________
Jean-Sebastien Guay jean-sebastien.guay-scC8bbJcJLCw5LPnMra/***@public.gmane.org
http://whitestar02.webhop.org/

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Jean-Sébastien Guay
2007-10-25 00:40:44 UTC
Permalink
Hello again,
Post by Jean-Sébastien Guay
Post by Craig, Joel S. (SED/TMI)
We received this error message whenever our thread tried to update the state
of a node while the drawing thread was trying to render it. Adding a mutex
solved our issue.
Hmmm, I'm doing this in the update traversal, so I should be ok on
that front... But maybe I'll test it out in SingleThreaded mode and
see if I still get that message.
Who knew, this turned out to be the problem. Running SingleThreaded
removed the messages, so I've set my geometry's DataVariance to
DYNAMIC and it all works great. Of course, it's a bit slower since it
serializes the updates to that geometry, but no flashing.

Thanks for putting me on the right track, Joel!

J-S
--
______________________________________________________
Jean-Sebastien Guay jean-sebastien.guay-scC8bbJcJLCw5LPnMra/***@public.gmane.org
http://whitestar02.webhop.org/

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Robert Osfield
2007-10-25 08:31:14 UTC
Permalink
Post by Craig, Joel S. (SED/TMI)
Classification: UNCLASSIFIED
Caveats: NONE
We received this error message whenever our thread tried to update the state
of a node while the drawing thread was trying to render it. Adding a mutex
solved our issue.
You shouldn't need to add a mutex, just setting the DataVariance to
DYNAMIC will do the trick.

Robert.
Loading...