Archived

This topic is now archived and is closed to further replies.

Vertex Format

This topic is 5130 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 am trying to come up with a vertex format that will be compatible with both D3D and OGL. I am having problems with color values. OGL uses 4 separate float values, while d3d uses a single long value. Is there a value that is compatible with both API''s? If not, how would I convert a D3D long color value into 4 separate float values for use in ogl?

Share this post


Link to post
Share on other sites
Hmm, you can define the type for vertex colour submission when using OpenGL vertex arrays and VAR/VAO/VBOs. Just set the type to GL_UNSIGNED_BYTE and you''re fine, although you might need to use BGR instead of RGB order, which can be achieved through an extension. When using interleaved vertex arrays, use GL_C4UB_V3F or GL_T2F_C4UB_V3F.

- JQ

Share this post


Link to post
Share on other sites