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();

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

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.

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.