Hi all,

My goal is to replace shader generator with shader composer, so I spent a few days playing with it. It proved to be very flexible and powerful tool but unfortunately, it lacks the support for a key feature I would consider necessary, and that is support for the "position state". Putting it differently, shader composer is "blind" for position state attributes (Light, ClipPlane, TexGen) stored within LightSource, ClipNode and TexGenNode. I was able to workaround the problem with cull calbacks or with custom cull visitor where I'm able to identify "positioned uniform" multiply it with model-view matrix and then force shader composer to accept the uniform and ShaderComponent attached to the state attribure. Unfortnatelly, this workaround introduced some unnecessary code complications and problems with uniform management and that is why I strongly feel that the solution should be integrated into OSG core.

I believe the implementation of such a feature should be straightforward task and since I might be able to post the core solution @submissions for a review, I am asking you for advice on how user interface should look. I have two ideas for now:

1. easy to implement solution dedicated to LightSource, ClipNode and TexGenNode. In addition to LightSource::setLight we could introduce two new methods: LightSource::addPositionedUniform(name, VecX) that will be collected into PositionalStateContainer and get special treatment with model-view matrix before applied at RenderStage and LightSource::addUniform(osg::Uniform*) to set other non-poisitioned uniforms that won't be multiplied but applied in a same way before any other attribure. 2. general soution by introducing two new types of uniforms: osg::PositionedUniform and "global? scene?" uniform, Both can be set at any StateSet and will be applied at RenderStage before any other attribure. 3. both solutions: First dedicated and after that general solution which will replace internal logic of LightSource and others leaving the interface as is.
4. ?

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

Reply via email to