Parameters for VertexBuffer!!

Started by
2 comments, last by 88er 20 years, 10 months ago
how to use these parameters,and how to match them for better performance??? D3DUSAGE_DONOTCLIP ,D3DUSAGE_DYNAMIC ,D3DUSAGE_WRITEONLY vs D3DPOOL_DEFAULT, D3DPOOL_MANAGED in CreateVertexBuffer()/CreateIndexBuffer. When i must use D3DUSAGE_DYNAMIC,i nerver use this parameter, but my application isn''t any wrong?
Advertisement
MSDN and google can tell you more!

.lick
quote:Original post by 88er
how to use these parameters,and how to match them for
better performance???

D3DUSAGE_DONOTCLIP ,D3DUSAGE_DYNAMIC ,D3DUSAGE_WRITEONLY
vs
D3DPOOL_DEFAULT, D3DPOOL_MANAGED
in CreateVertexBuffer()/CreateIndexBuffer.

When i must use D3DUSAGE_DYNAMIC,i nerver use this parameter,
but my application isn''t any wrong?



Dynamic is if the VB will be dynamic in size.. in other words, if the size will change. Writeonly means you can only write information to the VB and not read it. Managed let''s DX decide the best place in memory to put the data from the VB.

Hope that helped a little! The SDK docs are your friend!

[Piebert Entertainment] [Ask The All-Knowing Oracle A Question]------------------------------------------------------------GDSFUBY GameDev Society For UnBanning YodaTheCodaIf you want to see yoda unbanned then put this in your sig ------------------------------------------------------------DAIAGA Dave Astle is a God Association. To join, put this in your sig!Founder and High Priest of DAIAGA[edited by - YodaTheCoda on December 10, 2003 1:57:54 PM]
Dyanmic has nothing to do with it's size. It's dynamic if the vertex (or index) data will change often. If you're transforming particles, or doing morphing in software, the vertex data will change, potentially every frame. Dynamic is your way of saying, I'm going to send you new data all the time, don't cache this in video RAM.

When using dynamic, your lock calls will use DISCARD, and NOOVERWRITE flags. NOOVERWRITE means you're appending data to the end of the buffer, data that you've never written to since your last DISCARD. DISCARD means you need fresh space to store vertices (ie: you've run out of room for the use NOOVERWRITE).

DONOTCLIP I've never used, but I imagine it controls with or not to adjust vertices such that the triangles points are all on screen. Color, UV, Normals, etc will have to be interpolated to clip correctly. You probably don't want to clip unless you're targetting old cheap crappy hardware. On todays hardware doing clipping in software may kill performance, the card can clip instantly for you regardless of what you pass it.

WRITEONLY indicates you will never read for the vertex buffer. ALWAYS use this flag. This lets the card put the vertex data in faster GPU memory.

MANAGED means that DX will attempt to save values, destroy and recreated the buffer for you when you get a lost device. This can affect where the card can put the buffer. DEFAULT may give better performance (as D3D never has to read back values to recreate the object, it may go in faster GPU RAM).

If you search, you might find a few months old response I wrote explaining how to use dyanamic buffer correctly, how the flags are used, and a step by step detailed sample.

(did the search - it's here: )
http://www.gamedev.net/community/forums/topic.asp?topic_id=148414

[edited by - Namethatnobodyelsetook on May 29, 2003 4:00:57 PM]

This topic is closed to new replies.

Advertisement