Hi Everybody,

I am also deply interested in the topic ;-).

Current VirtualProgram implementation does not complie and relink shaders and 
programs each time they are applied. They are only generated and linked when 
certain new mix of shaders is encounterd in VirtualProgram::apply and used for 
the first time. Then, this set of shaders and corrsponding linked gl program is 
cached and reused later. Exactly the same case as when new osg::Program is 
compiled on first use. Difference is that osg::Program can be prebuilt in 
GLVisitor. Theoretically we could write a code to do the same with 
VirtuaProgram combinations. It will be much trickier, though... 

Wojtek Lewandowski


  ----- Original Message ----- 
  From: Robert Osfield 
  To: OpenSceneGraph Users 
  Sent: Thursday, February 25, 2010 10:59 AM
  Subject: Re: [osg-users] Shader composition


  Hi Lilith,


  On Thu, Feb 25, 2010 at 9:12 AM, Lilith Bryant <[email protected]> wrote:

    I highly suggest you do some benchmarking on shader compiling/link times.  
We
    investigated this a couple of years ago, and found that we couldn't avoid an
    output glitch (due to compile/link time) whenever we needed a new shader.


  I agree that performance is critical.  When ever I make major changes to the 
OSG I do lots of benchmarking.

  In this specific case compilation, linking and uniform changes all have their 
own performance issues to be mindful of.  My expectation for shader composition 
was that we'd need to do upfront compilation, and linking as much as possible 
and select between complete programs rather than dynamically doing too much 
actual shader composition during draw dispatch on each frame.  

  Keeping the CPU overhead of doing selection of which program to make active 
is also something that I've been pondering about.

  Keeping this all in check is why I need to spend the time thinking about the 
design so deeply.

  Robert.

  I



------------------------------------------------------------------------------


  _______________________________________________
  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