Sign in to follow this  

glColorPointer

This topic is 3630 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm reading about Vertex arrays and I'm finally getting into them. I have this book that shows briefly how to use them and I noticed something about the GL_COLOR_ARRAY... Is there any way to include the Ambient, Diffuse, Specular, Shininess, and even emission value? This is very important and it appears to me that it only provides the diffuse color. Is there something else include these other values?

Share this post


Link to post
Share on other sites
I just had a thought, because Ambient, Specular, Shininess, and Emission are VERY unlikely to change, if at all, during one object, can they still be set before the call to glDrawElements() where the Diffuse color would be set in the Color array.

any other ideas?

Share this post


Link to post
Share on other sites
If going to shaders is going to be a big change now, it will simply be "impossible" in the future. Take your time and switch now.
Having generic attributes and total control on computation is a great help in understanding, not to mention managing the pipeline.
I also suggest to drop the FFP. It would allow you to use - say - half of the entrypoints, have a unified *Pointer call.

Whatever your specular color/shiness factor changes or not depends on your data but don't expect any performance difference from using immediate mode to inject constant data.

The first thing to learn shaders is the GLSL specification. Then you have to find how to "use" GLSL in GL. Read the shader extensions (go to the extension registry) and then have a read at the GL2 spec, which changes a few details. 3DLabs had a nice document to group all the changes in a single place but it seems I'm unable to find it right now.

Share this post


Link to post
Share on other sites
I only say it's a big change because I don't know anything about them and it's probably different than all of my rendering code which i'd have to change.

Alright thanks for the pointer, i'll have to look up the GLSL

Share this post


Link to post
Share on other sites
Quote:
Original post by BloodLust666
I just had a thought, because Ambient, Specular, Shininess, and Emission are VERY unlikely to change, if at all, during one object, can they still be set before the call to glDrawElements() where the Diffuse color would be set in the Color array.

any other ideas?


You can call glMaterialf before calling glDrawElements.
You don't need to use glColorPointer if you will be doing lighting. glMaterialf is what is needed.

If you want to study GLSL, might as well start now.

Share this post


Link to post
Share on other sites

This topic is 3630 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this