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

Thread: GLSL binding "constants" suggesstions

  1. #1
    Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Inside an xbox
    Posts
    279

    GLSL binding "constants" suggesstions

    In the current GLSL, you have to all glGetUniformLocationARB to get the "constant number/location" of your uniform.... Why not to do as Direct3D HLSL:

    void main ( unifrom float4 lightPos : register(C0) )
    {
    }

    or

    void main ( uniform sampler2D baseTex : register(S0) )
    {
    }

    where C0 is contant 0(loc==0) and S0 is sampler 0 ( loc==0 ) ???

    Ok, I can understand that forcing the uniform location can affect optimization, but....

    thx in advance.

  2. #2
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    1,932

    Re: GLSL binding "constants" suggesstions

    Because there are no registers.
    It's simple.

    GLSL method is much more flexible one. You can bind anything to anything. DX doesn't allow you to do this.

Posting Permissions

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