PDA

View Full Version : Texturing Problem with GLSL



ViolentHamster
05-19-2009, 07:43 AM
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.

dletozeun
05-19-2009, 08:17 AM
What platform, OS, hardware, graphic driver are you working with?

ViolentHamster
05-19-2009, 08:36 AM
64 Linux OpenSuse 10.3

GL_VERSION returns: 3.0.0 NVIDIA 180.29

The card's an 8800.

ViolentHamster
05-19-2009, 09:23 AM
I upgraded to 180.51, but that didn't help.

dletozeun
05-19-2009, 12:20 PM
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?

ViolentHamster
05-19-2009, 12:54 PM
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?

dletozeun
05-19-2009, 01:05 PM
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 ^^.

ViolentHamster
05-19-2009, 02:31 PM
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?