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

Vertex buffers (again...)

Started by Heretik Apr 15, 2002 at 10:39 AM 4 replies 200+ views
Original Post
Heretik
Heretik
In my engine, I try to share VB whenever I can, I group vertices by FVF, but I''d like to go further and group vertices by size ex: 32,36,40 ... (and so on) bytes vertices Now imagine you have a vb with two types of vertices (two differents FVF) but of the same size. The SDK doc talks about "FVF-VB" and "non-FVF VB", you can choose one or another when creating your VB. At rendering time when setting vertexShader (fixed function) with pDevice->SetVertexShader(someFVF), is it possible to render vertices from a non-FVF VB ? My english sucks a lot today cause I''m tired , so If it''s not a clear question, don''t hesitate to be more precise. Thanks
Heretik at bender77@caramail.com
siaspete
siaspete
This isn''t entirely related, but there''s a doc on the NVidia site that mentions vertex sizes and performance. It seems that performance is best when the vertex size is 24, second best is 32, then 64.

40, 48 and 56 byte vertex sizes didn''t perform as well, so you might be good to pad your vertices to be one of the better performing sizes.


Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
Heretik
Heretik
That''s funny, I always heard 32 bytes was the optimal one,
but whatever, what I was asking for, wasn''t the best size to use, but how to group vertices of the same size in one VB even if they don''t have the same FVF
Heretik at bender77@caramail.com
thedo
thedo
I am just gussing here but I would imagine that you just use it as normal but make sure the only vertices you draw in your Draw*Primitive are of the same FVF otherwise you would be in a right old mess. I could be VERY wrong though.....

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
Heretik
Heretik
Damn I''ll hope I''ll soon be out of this crapy geometry management, to be able to focus on some more interesting features !

However it''s one of the most important part of an engine, to achieve good perfs....
Heretik at bender77@caramail.com
Heretik
Heretik
c''mon guys, a little effort ...... pleeeeeeaaaase ))
Heretik at bender77@caramail.com

Topic Locked

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

Sign in to reply to this topic.