Results 1 to 2 of 2

Thread: GLSL uniform array names?

Hybrid View

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    1

    GLSL uniform array names?

    My understanding of GLSL uniform arrays is that they should be identifiable by both the name along, and the name along with the array index in brackets. For example, if I had this uniform array in my shader:
    Code :
    uniform float lightrange[4];
    Then according to the spec, my program should be able to set the array, or parts of the array, with any of the following uniform names:
    Code :
    lightrange
    lightrange[0]
    lightrange[1]
    lightrange[2]
    lightrange[3]
    I ask because it appears iOS would only recognize "lighttange[0]" while Samsung's stuff only recognizes "lightrange".

  2. #2
    Member
    Join Date
    Jun 2012
    Location
    Texas
    Posts
    61
    Quote Originally Posted by JoshKlint View Post
    My understanding of GLSL uniform arrays is that they should be identifiable by both the name along, and the name along with the array index in brackets. For example, if I had this uniform array in my shader:
    Code :
    uniform float lightrange[4];
    Then according to the spec, my program should be able to set the array, or parts of the array, with any of the following uniform names:
    Code :
    lightrange
    lightrange[0]
    lightrange[1]
    lightrange[2]
    lightrange[3]
    I ask because it appears iOS would only recognize "lighttange[0]" while Samsung's stuff only recognizes "lightrange".
    I noticed the same problem reported on StackOverflow:

    http://stackoverflow.com/questions/1...49217#17049217

    So, I searched all the OpenGL ES shader code that I have and the only examples I found of using the array notation was for OpenGL ES 3.0.

Similar Threads

  1. Limits of GLSL Arrays
    By backspaces in forum Developers Coding:Beginner
    Replies: 1
    Last Post: 05-07-2011, 08:28 AM
  2. unique kernel names?
    By qwer in forum OpenCL
    Replies: 4
    Last Post: 12-26-2010, 08:49 AM

Posting Permissions

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