Jump to content
  • Advertisement
Sign in to follow this  
fazekaim

OpenGL need help using glColorPointer

This topic is 5467 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

Hello! A read in the Opengl reference,that the glColorPointer accept only 3 or 4 as number of components. My problem is that, when I render my terrain, I only use the alpha value (for multitectuxing). Pixel shaders compute the shadows, so the glColor is (1.0,1.0,1.0,alpha value). So, with vertex object I allocate 4*n byte for storing n important information. Can I store only the alpha values with glColorPointer somehow? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Oh! I almost forgotten.
If I use this method, it will store my array in the GPU memory as it does using Vertex buffer object?

Thanks.

Share this post


Link to post
Share on other sites
Yes, your data will be stored in the same way as if you had used glColorPointer. glVertexAttribPointerARB was introduced with shaders because per-vertex data was no longer precisely defined to the existing set of data. For example tangents and binormals are often send as texture coordinates for bump-mapping, despite the fact that they are not texture coordinates. Vertex Attributes are a generalisation of a per-vertex data stream specifying that this is per-vertex data of unspecified usage. Check out the ARB vertex program specification for more details.

Enigma

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!