Results 1 to 3 of 3

Thread: Texture Image Scaling In GLSL Vertex Shader

  1. #1
    Member 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 Lord
    Join Date
    Mar 2015
    Posts
    6,675

    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
    Member 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.

Similar Threads

  1. Replies: 19
    Last Post: 06-11-2016, 09:29 AM
  2. Vertex and Geometry shader coordinate scaling problem
    By mamannon in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 03-03-2016, 06:04 PM
  3. Texture usage with vertex shader in GLSL
    By sheree in forum OpenGL: GLSL
    Replies: 4
    Last Post: 03-12-2009, 03:23 PM
  4. vertex shader texture image units
    By jide in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 03-29-2006, 02:11 AM
  5. "The GLSL vertex shader will run in software"
    By 3B in forum OpenGL: GLSL
    Replies: 7
    Last Post: 08-23-2004, 08:17 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
  •  
Proudly hosted by Digital Ocean