4 Replies Latest reply on Mar 15, 2012 2:00 AM by farosis

    GLSL uniform struct init in shader error!

    peng

      Hello,

      When I want to initialize uniform struct variable an unexpected error is generated.

      link program fail!Vertex shader(s) failed to link, fragment shader(s) failed to link.

      unexpected error.

      unexpected error.

      The shader codes:

      struct LightSource{

          vec4 ambient;

          vec4 diffuse;

          vec4 specular;

          vec4 position;

          float attenConstant;

         float attenLinear;

          float attenQuadratic;

         bool enableAtten;//Enable or disable attenuation

      };

       

      uniform LightSource defaultLightSource=LightSource( vec4(0.1,0.1,0.1,1.0),//ambient

      vec4(1.0,1.0,1.0,1.0),//diffuse

      vec4(1.0,1.0,1.0,1.0),//specular

      vec4(-0.0,0.0,5.0,1.0),//position

      1.0,0.005,0.0005,false);

       

      I tested these code on windows 7 with ATI mobility Radeon HD 3470. Is it a bug ?

      Thanks!