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: Texture Image Scaling In GLSL Vertex Shader

  1. #1
    Intern Contributor
    Join Date
    Sep 2007
    Location
    Southern California
    Posts
    60

    Texture Image Scaling In GLSL Vertex Shader

    1) Is there sample code that will enable me to duplicate these OpenGL drawing commands in a Vertex Shader:

    glTranslatef();
    glRotatef();
    glScalef();

    2) How can I translate GL_TEXTURE_2D textures in X/Y direction within a Vertex shader by referencing the number of actual pixels I want to offset, instead of using normalized (0-1) coordinates?

    Thanks.

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

    Re: Texture Image Scaling In GLSL Vertex Shader

    Is there sample code that will enable me to duplicate these OpenGL drawing commands in a Vertex Shader:
    Those commands modify OpenGL state. You can't do that from a vertex shader.

    You can create matrices (which is the kind of state that they modify). But you can find the matrices these generate online via the man pages.

  3. #3
    Intern Contributor
    Join Date
    Sep 2007
    Location
    Southern California
    Posts
    60

    Re: Texture Image Scaling In GLSL Vertex Shader

    Thanks Alfonse. Can you point me to the page or functions I should look at? I'm very new at Vertex Shaders. I'm trying to get away from pipeline stuff, and most of my experience in in fragment shaders.

    Thanks.

Posting Permissions

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