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 7 of 7

Thread: Texture Images usage in glsl

  1. #1
    Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Spain
    Posts
    273

    Texture Images usage in glsl

    Hello, I'm having some problems with the texture units/images in glsl. Acording with the specification, a shader is able to use up to GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB between the vertex shader and the fragment shader. With a gffx card this value is 16, so I go from tex0 to tex15 binding all textures,
    for"i=0;i<15;i++"{glActiveTextureARB"GL_TEXTURE0_A RB + i"; glBindTexture"target[i],id[i]";}
    With this configuration in the host application
    If I try to assign a value greather than 7 to the sampler2D, the result is a black object in the window... so only works the first eight texture images
    P.S: replace quotes for parenthesis
    "!I don't know... fly casual"

  2. #2
    Member Regular Contributor
    Join Date
    Apr 2002
    Location
    Austria
    Posts
    328

    Re: Texture Images usage in glsl

    Shouldn't it rather be GL_MAX_TEXTURE_IMAGE_UNITS for fragment shader texturing?
    There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.

    There is another theory which states that this has already happened...

  3. #3
    Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Spain
    Posts
    273

    Re: Texture Images usage in glsl

    These are the driver limitations for the fx5200

    GL_MAX_TEXTURE_UNITS: 4

    GL_MAX_VERTEX_ATTRIBS_ARB: 16

    GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB: 256

    GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB: 4

    GL_MAX_VARYING_FLOATS_ARB: 32

    GL_MAX_TEXTURE_IMAGE_UNITS_ARB: 16

    GL_MAX_TEXTURE_COORDS_ARB: 8

    GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: 16

    GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB: 128

    As you can see, both parameters has the same value, 16. Another strange thing is GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, is should be 0, but is 4... and as far i know texture fetches in vertex shaders isn't allowed yet...
    Could be this two issues driver bugs?
    To compare, these are my driver capabilities (WildCat VP 560)

    Vendor: 3Dlabs
    Version: 1.3.2
    Renderer: Wildcat VP560 - GL2

    GL_MAX_TEXTURE_UNITS: 8

    GL_MAX_VERTEX_ATTRIBS_ARB: 15

    GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB: 468

    GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB: 0

    GL_MAX_VARYING_FLOATS_ARB: 32

    GL_MAX_TEXTURE_IMAGE_UNITS_ARB: 8

    GL_MAX_TEXTURE_COORDS_ARB: 8

    GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: 8

    GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB: 32
    "!I don't know... fly casual"

  4. #4
    Member Regular Contributor
    Join Date
    Apr 2002
    Location
    Austria
    Posts
    328

    Re: Texture Images usage in glsl

    hm...
    Sounds like a bug. Which driver do you use?
    There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.

    There is another theory which states that this has already happened...

  5. #5
    Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Spain
    Posts
    273

    Re: Texture Images usage in glsl

    I'm using the latest nv developer drivers, but...
    I'd tested with an ATI 9600xt, and i have the same result: the object becomes black when i try to use the TI#8 or highter

    Vendor: ATI Technologies Inc.
    Version: 1.5.4273 Win2000 Release
    Renderer: RADEON 9600 x86/MMX/3DNow!/SSE

    GL_MAX_TEXTURE_UNITS: 8

    GL_MAX_VERTEX_ATTRIBS_ARB: 32

    GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB: 4096

    GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB: 0

    GL_MAX_VARYING_FLOATS_ARB: 44

    GL_MAX_TEXTURE_IMAGE_UNITS_ARB: 16

    GL_MAX_TEXTURE_COORDS_ARB: 8

    GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: 16

    GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB: 4096
    "!I don't know... fly casual"

  6. #6
    Intern Contributor
    Join Date
    Jul 2001
    Location
    Santa Clara, CA
    Posts
    84

    Re: Texture Images usage in glsl

    You should be able to bind 16 separate texture images in GLSL on GeForce FX hardware. Since you are seeing this problem on ATI and NVIDIA hardware my first thought is it may be a problem with your application.

    If you can send me a simple test case I'll can take a look at it.

    Thanks,

    Simon Green
    NVIDIA Developer Relations

  7. #7
    Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Spain
    Posts
    273

    Re: Texture Images usage in glsl

    Well, after build a test application to test the textures issue, I can see that the problem will be in my main application. The test application works fine accesing to all 16 textures . Well, at least I know where are the error, it's an advance
    Other strange thing: Why GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB have 4 in gffx card? this means that 4 is the number of the textures accesibles into a vertex shader, this is an error?

    Thanks for your patience.
    "!I don't know... fly casual"

Posting Permissions

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