Thanks Robert,

I am using OSG 2.6 on Linux with NVIDIA Quadro FX 4600 with driver version 
173.14.09...

How do I make sure my scene graph is precompiled? I thought OSG took care of 
this on its first frame using the GLObjectsVisitor in SceneView::init() but in 
your catch.cpp example, I see you are doing it manually. 

I am using osgViewer to render the scene.

Paul P.


----- Original Message ----
From: Robert Osfield <[email protected]>
To: OpenSceneGraph Users <[email protected]>
Sent: Tuesday, April 28, 2009 4:29:13 AM
Subject: Re: [osg-users] Multiple Shaders Performance Question

Hi Paul,

Different drivers manage compilation and linking in different ways on
different drivers so it's hard to give any hard rules.

In general making sure your scene graph is pre-compile before
rendering helps avoid most problems with compiles occur during
rendering.

Robert.

On Tue, Apr 28, 2009 at 2:46 AM,  <[email protected]> wrote:
>
> I have multiple shaders. I attach one shader to the root of the scene graph. 
> I then load in objects and attach one of another set of shaders to the root 
> of the object and attach it to the main scene graph. When I say "attach a 
> shader", I'm loading a fragment and vertex shader from a file and attaching 
> them to a new Program object each time. I then attach the Program object to 
> the object's state set.
>
> Is there any performance advantage to doing it this way or creating one 
> Program object for each shader and attach these same Program object to my 
> objects. Or should I be creating a set of StateSet's and attaching the 
> appropriate StateSet to my object based on the Shader I want to use.
>
> To complicate things, I have multiple cameras used to render to multiple 
> Frame Buffer Objects.
>
> What I'm seeing is a (single) missed frame when an object with a "new" shader 
> appears in the Field of View (running at 120Hz)?
>
> Could OSG be attempting to "recompile" my shader? Is driver downloading the 
> shader each time to the video card.
>
> Paul P.
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



      
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to