Skip to main content
GameDev.net gamedev.net
🔒 Locked

Extra data in verticies

Started by _sudo Jan 23, 2003 at 12:56 AM 1 replies 300+ views
Original Post
_sudo
_sudo
Is there anyway to put extra data in the vertex buffer and have D3D ignore it when reading? For example, I set the vertex format to use only position and diffuse color. However, I want 4 extra floats in my structure so I tried to set the vertex stride to represent this difference. This doesn''t work as Direct3D complains that the stride doesn''t match the specified vertex format? Any ways around this? _sudo
Trienco
Trienco
there are some good reasons not to do that and store the information somewhere else (an array of vertexdata structs or something). first: if you read/write that data quite often you cant place it in vidmem without poor access times. if you place it in agp or sysmem you will have to send it all to the card. of course you can say ''agp 4x is fast enough'', but i wouldnt send more data than necessary and i wouldnt make swiss cheese out of a tightly packed buffer.
f@dzhttp://festini.device-zero.de
_sudo
_sudo
I agree with your points, and it looks like that''s what I''m gonna have to do wether I like it or not. The only reason I asked is because I wanted to be able to use the same vertex structure for rendering either to D3D or OpenGL. I guess I can just convert the color data for OpenGL whenever the buffer is updated. Thanks for the reply.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.