Hi Joel,
I'm not sure this is useful to you, but here it is anyway.  When I
load shaders in my game I check to see if the computer I'm running on
can handle them with code like this:

Progam* program = new Program;

load vertex and fragment shaders here

program->compileGLObjects(state);
const int context = state->getContextID();
if(!(program->getPCP(context)->isLinked()))
   return false;


Can you use this to detect your own shaders that don't work?
--
Terry Welsh
mogumbo 'at' gmail.com
www.reallyslick.com


>
> Message: 6
> Date: Sat, 22 Oct 2011 13:23:14 +0200
> From: "Joel Graff" <[email protected]>
> To: [email protected]
> Subject: Re: [osg-users] flagging shaders with errors
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=UTF-8
>
> Robert,
>
> It would appear I've not taken the time to really explain what I'm doing...  
> My apologies. :)
>
> I am presently building a shader development environment using OSG.   Since 
> RenderMonkey can't really handle GLSL 140+ and the other options out there 
> are limited so far as GLSL is concerned, I decided I may as well write my own 
> shader dev tool.  After hunting around for an API that I could use to manage 
> the 3D for me (I hadn't touched OpenGL since college and that was around 
> version 1.2), I settled on OSG.  So far, it's been a really good experience, 
> though I suppose my posts to this forum may not have reflected that...
>
> Anyway, since the software I'm writing would lie at the heart of the shader 
> development process, there's an expectation that I'll be loading *lots* of 
> shaders with errors. :).  In the end, I'm working toward a hotloading 
> solution, but having a callback checking the shader error logs and flagging 
> them for removal has proven a pretty useful mechanism thus far.
>
> Regarding the techniques you've proposed, I imagine I've missed something 
> obvious, but I don't see how to get at the scene graph from a draw callback 
> (or a realize callback, for that matter).  That is, what you're proposing 
> makes sense.  Actually, that's what I was trying to do (I think).  My problem 
> is I couldn't figure out how to run my node visitor when I couldn't get a 
> reference to the scene graph's root node from inside the draw callback - not 
> without explicitly passing a reference when I construct the callback.  That's 
> the thing I want to avoid, if possible.
>
> Thanks,
>
> Joel
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to