Hi Marlin, in case you want to know the value of a variable (not uniform) of a shader there is no way (to my knowledge) inspecting it like in a debugger. The usual workaround is visualizing things by coloring the output pixels. If you want to "see" the "value" of a normal vector you can just take it as a color and set it in the fragment shader as the output color. Be creative when "debugging" other values: Bools or thresholds go black and white etc. If you have to "debug" values in vertex or geometry shaders, just pass colors to the fragment shader.
I hope this helps a little. - Werner - Am 28.09.2018 um 08:40 schrieb Robert Osfield: > Hi Marlin, > > On Thu, 27 Sep 2018 at 19:30, Rowley, Marlin R > <marlin.r.row...@lmco.com <mailto:marlin.r.row...@lmco.com>> wrote: > > Is there a way to examine variable values in shader code? I can’t > figure out this problem that we are having unless I can see the > values in the shaders. > > > 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. > > Shaders are a big topic so it's impossible for me to give you a full > guide, there are plenty of reosurces online about GLSL shaders, within > the OSG search for uses of osg::Program, osg::Shader, osg::Uniform. > > Robert. > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org