Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • GL_TEXTURE0 is the default active texture unit, and 0 is the default value for uniform variables. So while it's good to make those calls to establish a pattern that will still work with multiple textures, omitting those parts shouldn't keep a simple example from running. Commented Jul 28, 2016 at 7:24
  • hmm...I just checked and that's indeed quite clear in the specification that samplers default to the first texture unit. The only other thing that I can see as problematic is the generation of MIPs before uploading the texture data. This might actually create textures from the uninitialized data and this is what the sampler might be using? Commented Jul 28, 2016 at 7:56
  • This may sound dumb, but I'm not sure how to color the fragments with the uv coordinates. And I tried all those things, and nothing changed. I feel like the issue is in the drawing, because I know the image is getting loaded correctly, but either something in my code is wrong in the shader or in the code for the vertex arrays. Sorry for being so clueless about this. Commented Jul 28, 2016 at 17:01
  • you can do something like glFragColor = vec4(outTexCoord, 0.0, 1.0) actually, now that I looked at that code, can you remove the out vec4 glTexColor; line from your fragment shader? I think this might prevent glFragColor to bind to the first output. Commented Jul 28, 2016 at 18:25
  • I tried changing glFragColor to that, but nothing changed, and I removed glTexColor, but the window is still black. Am I just stupid for not being able to get this to work? Commented Jul 28, 2016 at 21:07