[osg-users] EXTERNAL: Re: Value of a variable in shaders?

Rowley, Marlin R marlin.r.rowley at lmco.com
Fri Sep 28 06:48:04 PDT 2018


LOL @ mis-reading my question. 😊

How would you check the values of vertices?  I just need to see the transformed values of a vertex.



Marlin Rowley
Software Engineer, Staff

Missiles and Fire Control
972-603-1931 (office)
214-926-0622 (mobile)
marlin.r.rowley at lmco.com

-----Original Message-----
From: osg-users <osg-users-bounces at lists.openscenegraph.org> On Behalf Of Robert Osfield
Sent: Friday, September 28, 2018 3:41 AM
To: OpenSceneGraph Users <osg-users at lists.openscenegraph.org>
Subject: EXTERNAL: Re: [osg-users] Value of a variable in shaders?

Hi Marlin,

On Fri, 28 Sep 2018 at 07:40, Robert Osfield <robert.osfield at gmail.com> 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");

osg-users mailing list
osg-users at lists.openscenegraph.org

More information about the osg-users mailing list