UV Coords for screen quad not getting transformed

24 views Asked by At

I was making this open gl app where I needed to render the texture to a screen quad. My requirement is that the quad should be resized to the textures width and height for a specific reason. To test the resizing, I decided to have

transformation = Matrix4.CreateScale(0.5f,0.3f,0);

and I get the result [1]: https://i.stack.imgur.com/jf0Ty.png I was able to recognize that the problem was that the uv coords weren't scaling accordingly. Here is the vertex shader:

#version 460 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec2 aTexCoord;

out vec2 TexCoord;
uniform mat4 model;

    void main()
    {
        TexCoord = aTexCoord;
        gl_Position = vec4(aPos, 1.0f) * model;
    }

The uv coords are correct and displays when it is normal.. I thought it was supposed to show the entire image in the scale..

Thank You.

1

There are 1 answers

1
Alex Mathew On BEST ANSWER

Update: I fixed the problem.. The main reason: The reason was because I had some postprocessing effects and the things is, I didn't use texcoord for sample I just calculated the screen uvs.. Dumb me oh well!