Part of the Khronos Group

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

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

    Github link for the code:

    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 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 11:44 AM. Reason: Clarify title

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Quote Originally Posted by KostaS
    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