Results 1 to 8 of 8

Thread: Texturing Problem with GLSL

  1. #1
    Senior Member Regular Contributor
    Join Date
    May 2008
    Posts
    101

    Texturing Problem with GLSL

    Hello,

    I'm having problems accessing textures in a GLSL shader.

    I figured I would start with something really simple, so I compiled and ran the ogl2brick-2.0 example from the OpenGL Shading Language book (3dshaders.com).

    When I run the example, the object should be a red brick wall, but it is totally black. Any ideas what's going on?

    Thanks.

  2. #2
    Senior Member OpenGL Pro dletozeun's Avatar
    Join Date
    Jan 2006
    Location
    FRANCE
    Posts
    1,367

    Re: Texturing Problem with GLSL

    What platform, OS, hardware, graphic driver are you working with?

  3. #3
    Senior Member Regular Contributor
    Join Date
    May 2008
    Posts
    101

    Re: Texturing Problem with GLSL

    64 Linux OpenSuse 10.3

    GL_VERSION returns: 3.0.0 NVIDIA 180.29

    The card's an 8800.

  4. #4
    Senior Member Regular Contributor
    Join Date
    May 2008
    Posts
    101

    Re: Texturing Problem with GLSL

    I upgraded to 180.51, but that didn't help.

  5. #5
    Senior Member OpenGL Pro dletozeun's Avatar
    Join Date
    Jan 2006
    Location
    FRANCE
    Posts
    1,367

    Re: Texturing Problem with GLSL

    That's weird, it works perfectly on Ubuntu 9.04 with latest mesa drivers. I have no more ideas, do you get any opengl error, compile or link errors from the shader program?

  6. #6
    Senior Member Regular Contributor
    Join Date
    May 2008
    Posts
    101

    Re: Texturing Problem with GLSL

    No OpenGL error, compile or link errors. I did comment out glewInit() and I removed the glew library from the Makefile. I don't have glew and I don't think that would make a difference, would it?

  7. #7
    Senior Member OpenGL Pro dletozeun's Avatar
    Join Date
    Jan 2006
    Location
    FRANCE
    Posts
    1,367

    Re: Texturing Problem with GLSL

    So from the beginning you are compiling an running the example code without glew?
    Anyway, glew is important to use some opengl extensions. It allows you to get automatically the function call entry points of any supported extension. Install the glew package on your distribution and link to this library. See if there is any change.

    But I do not know what happen with opengl 3.0, you should have to use glew for shaders.

    EDIT:

    I tried as you said without glew since shaders where promoted to core in opengl 2.0 and guess what: I do not have exactly a black screen but a uniformly green cube. But this is not very relevant since I hacked a lot with my distro and is now quite unstable ^^.

  8. #8
    Senior Member Regular Contributor
    Join Date
    May 2008
    Posts
    101

    Re: Texturing Problem with GLSL

    Ok, I installed glew. I reverted the program so it links with glew, it has #include <glew.h>, and it calls glewInit().

    Now, I get a red brick wall. Why does glew give me a red brick wall but standard OpenGL 3.0 doesn't?

Similar Threads

  1. GLSL fragment texturing with instancing
    By error17 in forum OpenGL: GLSL
    Replies: 5
    Last Post: 03-04-2014, 11:15 AM
  2. GLSL 400 multi texturing, how best?
    By glararan in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 09-13-2013, 09:59 AM
  3. Basic texturing w/ core (GLSL) problem
    By ElFuego in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 05-05-2011, 06:46 AM
  4. [VBO][GLSL] Problem with texturing
    By Rares in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-27-2009, 04:04 PM
  5. [GLSL] Simple Texturing problem
    By Adrian P. in forum OpenGL: GLSL
    Replies: 4
    Last Post: 11-15-2007, 03:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean