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: mat4 and vec4 multiplication produces empty screen

  1. #1
    Newbie Newbie
    Join Date
    Aug 2018
    Posts
    2

    Angry mat4 and vec4 multiplication produces empty screen

    Code :
    #version 330 core
     
    layout(location = 0) in vec3 aPos;
    layout(location = 1) in vec3 aColor;
    layout(location = 2) in vec2 aTex;
     
    out vec4 ourColor;
    out vec2 Texture;
     
    uniform mat4 transform;
     
    void main(){
        transform;
        gl_Position = transform * vec4(aPos,1.0f);
        ourColor = vec4(aColor,1.0);
        Texture = vec2(aTex.x,1 - aTex.y);
    }
    This is my vertex shader code. When I run my program with this shader, An black screen appears. If I delete the code at below,

    transform *
    my program runs great and it shows colors and picture.

    My code runs clearly without

    transform *

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,475
    It would tend to suggest you are not populating the transform uniform properly, or not populating it with a value that places the content on-screen.

    Try populating it with the identity transform.

  3. #3
    Newbie Newbie
    Join Date
    Aug 2018
    Posts
    2

    Post

    Quote Originally Posted by Dark Photon View Post
    It would tend to suggest you are not populating the transform uniform properly, or not populating it with a value that places the content on-screen.

    Try populating it with the identity transform.

    It worked. I thank you so much.
    Last edited by Bilgin; 08-06-2018 at 01:47 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
  •