Miscellaneous OpenGL questions (mostly dealing with shaders)

Started by
23 comments, last by Brother Bob 11 years, 3 months ago

Also, I could see detail in the rabbit before, now he looks completely flat.

Once again, I want to thank you for doing this. You probably cringe at some of the questions I ask because I am completely on the wrong track. I'm doing my best, I really enjoy this stuff. Thanks for putting up with me.

Advertisement
There are a lot of old-style and deprecated functions still. But ignoring that, a quick search suggests that the built-in normal attribute is on location 2, not 1.

Also, the enable and disable status of an attribute binding is a part of the vertex array object. When you bind the buffers and set the pointers, enable them within the vertex array object also and it will become a part of the binding. No need to enable and disable them in the render function.

There are a lot of old-style and deprecated functions still. But ignoring that, a quick search suggests that the built-in normal attribute is on location 2, not 1.

I would have given you +10 rep if I could. That fixed it. I have actually learned a lot in the last few days. I liked the jab about the "quick search." Trust me, I searched...but it was aimlessly.

And yes, I don't expect you read my entire post but I pointed out that I wanted to remove the old functions one at a time. Gamedev's Beginning OpenGL Game Development is a great book, and I have both versions. My problem with it is that is uses a ton of the old stuff as well. Hopefully the OpenGL 4.0 Shading Language Cookbook isn't way over my head, I may have to grow into it.

I'll let this thread die, here is a picture if anyone ever stumbles on this and is curious

k0ElG.jpg

I liked the jab about the "quick search." Trust me, I searched...but it was aimlessly.

That wasn't really what I meant to say, sorry. I knew there was something fishy with the indexing of the built-in attributes from many years ago, and "quick search" was meant to mean "not an extensive search", because I didn't spend too much time to verify the information and it was surprisingly difficult to find some definitive answer at all even if I knew exactly what I was looking for.

It was not meant as a hint that it's easily accessible and all over the place for you to read.

Although, you should have gotten the correct results from glGetAttribLocation and not just assumed the correct index :)

This topic is closed to new replies.

Advertisement