Results 1 to 9 of 9

Thread: Uniform arrays in Chrome / Firefox

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    11

    Uniform arrays in Chrome / Firefox

    Hi,

    Do uniform arrays work in Chrome or Firefox? A shader with a uniform array of floats, e.g.,

    Code :
    uniform float u_float[2];
    Works ok in both browsers, but a uniform array of vec2, e.g.,

    Code :
    uniform vec2 u_vec2[2];
    Does not work in either browser. In Chrome, the shader fails to link with no message in the link log. In Firefox, it compiles and links but the uniform cannot be queried.

    After reading the OpenGL ES 2 and WebGL spec, I expect this to work.

    Regards,
    Patrick

  2. #2
    Junior Member
    Join Date
    Mar 2011
    Posts
    11

    Re: Uniform arrays in Chrome / Firefox

    Sorry, I forgot to mention that I am running Vista 64 with an ATI Radeon HD 5870.

    Patrick

  3. #3
    Senior Member
    Join Date
    May 2010
    Posts
    207

    Re: Uniform arrays in Chrome / Firefox

    You might want to read this previous thread (especially the posts towards the bottom):

    viewtopic.php?f=35&t=3663

    I have not tried to make an array of vec2's - but the example I posted to that thread uses an array of 4x4 matrices - which is a pretty similar issue.

    I have not (personally) tried an ATI/Vista combination - but several thousand people have successfully played my WebGL game (here: http://tubagames.net ) - which uses arrays of matrices to do skin/bones transforms for the animation of characters in the game. If that game works for you - then you'll know it's not a problem for your hardware/software setup.

    I suspect you have a problem elsewhere - but it's hard to know without more information.

    -- Steve

  4. #4
    Junior Member
    Join Date
    Mar 2011
    Posts
    11

    Re: Uniform arrays in Chrome / Firefox

    Hi Steve,

    Nice job with your game. The following shader using an array uniform compiles and links in Chrome:
    Code :
    uniform vec2 u_vec2[2];
    void main()
    {
      gl_Position = vec4(u_vec2[0], 0.0, 0.0) * vec4(u_vec2[1], 0.0, 0.0); 
    }
    But if I use two uniform arrays (one float and one vec2), it does not compile/link and the logs are empty:

    Code :
    uniform float u_float[2];
    uniform vec2 u_vec2[2];
    void main() 
    { 
      gl_Position = vec4(u_float[0]) * vec4(u_float[1]) * vec4(u_vec2[0], 0.0, 0.0) * vec4(u_vec2[1], 0.0, 0.0);
    }
    These are just unit tests, not production code.

    Regards,
    Patrick

  5. #5
    Junior Member
    Join Date
    Mar 2011
    Posts
    11

    Re: Uniform arrays in Chrome / Firefox

    I thought the problem was I am not including an attribute input, e.g., attribute vec4 position, but I can't find anything in the GLSL spec that says one is required. I tried to add it anyway and it didn't help.

    Patrick

  6. #6
    Junior Member
    Join Date
    Mar 2011
    Posts
    11

    Re: Uniform arrays in Chrome / Firefox

    Just to follow up, uniform arrays are working perfectly fine in Chrome and Firefox. I am embarrassed to say that I was not even calling glUniform2fv() in the vec2 case. Shame on me.

    Patrick

  7. #7

    Re: Uniform arrays in Chrome / Firefox

    Quote Originally Posted by pjcozzi
    Sorry, I forgot to mention that I am running Vista 64 with an ATI Radeon HD 5870.

    Patrick
    am having mixed results getting an output from this combination. I installed Vista Ultimate x64 using a CRT monitor. But, with XP it's just flawless.

  8. #8

    Re: Uniform arrays in Chrome / Firefox

    Yeah, that's really true. I have also an annoying problem in Windows Vista when using a CRT monitor. When I start a game in full screen like Team Fortress 2 or often just by accessing something that triggers the UAP screen to confirm running as administrator
    the picture on my monitor goes complete garbled.

  9. #9
    Junior Member
    Join Date
    Jan 2012
    Location
    Carthage, Missouri
    Posts
    1

    Re: Uniform arrays in Chrome / Firefox

    HI Steve, new here may can you put link of your game as pjcozzi mentioned about.




    ---------------------------
    http://ambitpros.com/ambit-versus/ambit-energy
    AmbitPrso - Team Committed to Excellence.

Similar Threads

  1. unable to use opengl on ubuntu9.10, chrome or firefox
    By meir in forum OS & Browser specific questions
    Replies: 1
    Last Post: 10-13-2010, 07:51 PM
  2. WebGL in a Chrome or Firefox regular release?
    By CPLamb in forum OS & Browser specific questions
    Replies: 1
    Last Post: 05-13-2010, 06:03 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
  •