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 2 of 2

Thread: Texture won't render at all

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

    Angry Texture won't render at all [Already tried doc]

    Github link for the code: https://github.com/Kosta-Git/Pong/tree/master/Pong

    I am trying to render a basic texture and i got multiple problems first of all i cannot load at all the texture.jpg file (bricks.jpg works fine).
    When i try to render a texture this is what i get https://i.imgur.com/u77JLc7.png obviously this is not my textures, i have tried alot of stuff and the triangle sometimes gets a bit purple, or grey...

    I have looked at tutorials and the doc but it really seems like my code doesn't wants to work...

    Anyone could provide help?
    Last edited by KostaS; 08-26-2018 at 10:44 AM. Reason: Clarify title

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,476
    Quote Originally Posted by KostaS
    shader_f.txt
    Code glsl:
    #version 120
     
    varying out vec4 diffuseColor;
    varying vec2 texCoord0;
    uniform sampler2D diffuse;
     
    void main()
    {
        diffuseColor = texture2D(diffuse, texCoord0 );
    }
    Try writing to gl_FragColor rather than diffuseColor.

    Also, check for OpenGL errors.

Posting Permissions

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