Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: UBO with arrays acting weird

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2010
    Location
    Sweden
    Posts
    3

    UBO with arrays acting weird

    Hello, I'm getting weird behavior in my fragment shader.

    I have two arrays in my uniform buffer a vec4 [30] and a vec3 [16]. The last arrays data seems to have been made changes to at some point.

    Code :
    uniform Sky {
        vec4 stars[30];
        vec3 cloudparts[16];
    };
    I tried different layouts with no change in behavior, so what whould I try next? I buffer the data in the right order etc as well. first a buffer for stars then a buffersubdata for cloudparts

    Some of the array indices have valid data, others seem to have swizzled components or something...

    Latest Nvidia driver with a GT240. I am not over the max uniforms limit.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,732

    Re: UBO with arrays acting weird

    The last arrays data seems to have been made changes to at some point.
    What does that mean?

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2010
    Location
    Sweden
    Posts
    3

    Re: UBO with arrays acting weird

    Quote Originally Posted by Alfonse Reinheart
    The last arrays data seems to have been made changes to at some point.
    What does that mean?
    Only some values in the array have the same value as in my cpu code.

Posting Permissions

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