Thanks J-S,
I am glad I have Your support. Honestly, I was counting on You ;-) I am not
that fluent in English as I would like to be. Writing such posts usually
take me much longer than in may native polish, I often realize that some
ideas got lost in the midle of batlle with proper word/expression selection,
so its always good to have some support from native speakers ;-).
Look at StateHack class and reinterpret_cast<StateHack> expression in
VirtualProgram apply. StateHack overrides osg::State class to make
getAttribureVec method accessible to Virtual program. This method is
protected or private to osg::State.
Obiously this could be solved by mamking VirtualProgram a friend of
osg::State but that would require changes to core OSG.
Cheers,
Wojtek Lewandowski
----- Original Message -----
From: "Jean-Sébastien Guay" <[email protected]>
To: "OpenSceneGraph Users" <[email protected]>
Sent: Monday, May 11, 2009 5:19 PM
Subject: Re: [osg-users] VirtualProgram - making programmable pipeline less
fixed
Hello Wojtek,
The code is simple and its basically one class named VirtualProgram. Its
derived from osg::Program. It does what its name implies - virtualizes
program and shaders in osg::Program similarly to C++ method overloading.
Wow, very nice! This indeed fills in one rather large gap that exists in
shader usage in OSG, which is to make using and managing shader fragments
easier in order to reduce the number of necessary permutations of shaders
we need to use to support many hardware and effect combinations. And it's
done in an elegant way. Good work!
I am not sending this as submission but more as some material for
discussion. I would love to have similar functionality in OSG but I am
aware that this approach slightly changes filosophy of OSG state
attribute handling. Obviously I don't have ideal understanding of OSG
intrinsics and I might not carefully realized all implications of this
code imlementation. I suspect that proper implementing such feature may
require some redesign of OSG. But I hope that this code may be used as
foundation for such development.
I'll let Robert and others discuss the low-level implications, but to me
this looks like a great step in the right direction.
To implement VirtualProgram I had to do small hack to make state
attribute stack available to VirtualProgram.
I'm not sure I spotted any such hack in the code you sent, what is it?
Thanks a lot and again, good work!
J-S
--
______________________________________________________
Jean-Sebastien Guay [email protected]
http://www.cm-labs.com/
http://whitestar02.webhop.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