Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Can't initialize an array with a single element???

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member Newbie
    Join Date
    Jul 2013

    Can't initialize an array with a single element???


    why do I get a shader compile error when I try to put this code in my vertex shader:

    vec3 lightColor[1] = vec3[](vec3(1,1,1));

    but this works:

    vec3 lightColor[2] = vec3[](vec3(1,1,1),vec3(1,1,1));

    If GLSL doesn't allow me to initialize my single-element array this way, how can I do it?

    Last edited by hooyacrusty; 08-22-2013 at 11:05 AM. Reason: dumbness

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts