Hey Daniel,

thanks for your hint. Using your little trick, I was able to debug my fragment shader.

The working code looks like this:
MFVec3f parameters = MFVec3f(); <- without specifying the field size!!!
parameters.push_back(osg::Vec3f(0.8f, -0.2f, 0.2f));
parameters.push_back(osg::Vec3f(0.1f, 0.2f, 0.2f));
parameters.push_back(osg::Vec3f(-0.6f, 0.5f, 0.5f));

Cheers,
Daniel

Daniel Holz schrieb:
Hi Anne,

Anne Braun wrote:
Shader:
#define NUMPOINTS 3

uniform vec3 vectors[3];

void main(void)
{
   vec3 vector;

   ...
   for(int i = 0; i < NUMPOINTS; i++)
   {
      vector = vectors[i];
    ...

To be honest, I have no idea how to debug the shader to check whether the values are correct. But using with a single vector instead of a array it works?!

A common way to debug shaders is to output values as fragment color. You could try something like
    gl_fragColor = vec4(vectors[0], 1.0);

It would also be helpful to set the colors in your "vectors" array to, e.g., (1,0,0), (0,1,0) and (0,0,1).
In this case you will see right away if the colors match your expectations.

Hope this helps,
Daniel


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

<<attachment: anne-kathrin_braun.vcf>>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to