Hi Marlin,
On Fri, 28 Sep 2018 at 07:40, Robert Osfield <[email protected]> wrote:
> To pass data into shaders you have use a combination of uniforms
> (osg::Unfiorm), textures (osg::Textre*) and vertex attributes. With recent
> 3.4.x onwards you also have the option of passing in constants via
> #prama(tic) shader composition system that passes #define values into the
> compilation of shaders.
Seems I mis-read your question :-)
Testing internal values in shader is an easy thing to do, what I end
up doing is build up shaders bit by bit making sure each bit works on
it's own before I assemble it into a more complex shader. When I want
to test values I usually just set the fragment colour value, though
often this will have a processed version of the value to make it
visible. You can use #ifdef's in shaders to toggle the debug code
paths and even toggle these paths on/off via the
osg::StateSet::setDefine("ENABLE_DEBUG");
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org