J-S, Robert, Maciej, Roland et al,
Thanks for Warm welcome. If nothing interrupts me I will try tomorrow to add
changes that Robert made and maybe will create more advanced example.
Roland, you are right this was a rather simple example of VirtualProgram. In
practice we employ it in bit more complex scenarios. Since I wrote this
code some time ago, I forgot one of original motives. This idea was to
allow some programability in model statesets while retaining freedom to
create advanced(or simple) lighting of the whole scene. With osg::Program
all shaders had to be stored in the model and as such it would not be
possible to have the same model displayed with different lighting/shading
algorithm. With VirtualProgram parts of program lighting could be
virtualized and replaced by different lighting shaders. Thats why I though
about creating the example that would show the cows on two views displaying
them simultaneously with vertex / pixel lighting.
Cheers,
Wojtek
--------------------------------------------------
From: "Roland Smeenk" <[email protected]>
Sent: Monday, May 11, 2009 10:18 PM
To: <[email protected]>
Subject: Re: [osg-users] VirtualProgram - making programmable pipeline
lessfixed
Hi Wojtek,
Thanks for sharing your code. This will be very helpfull.
It would be nice if we could somehow combine this with the existing fixed
function ShaderGen utility.
Thoughts about the demo:
The coloring of the children with only a different version of the
ColorFilter would typically be implemented with a uniform that is
overidden by the children. The children depend on a parent virtualprogram
that actually calls the ColorFilter method. If this is not the case the
Program used by the children will fail (which is logical, because they are
incomplete)
I guess in practice you are using a virtualprogram with a lot of semantic
blocks at the root of the tree so children have the opportunity to
override multiple pieces of the shader similar to overriding
stateattributes in a stateset.
warmest regards,
Roland
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=11851#11851
_______________________________________________
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