• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
noatom

D3DUSAGE_DYNAMIC

9 posts in this topic

Is it a good ideea to use just dynamic vertex buffers? and static almost never?

I'm talking about having something like 2 dynamic vertex buffers,and just always add the vertices in those 2 vertex buffers,render them, and when needed, put other vertices in those buffers,render ...and you got the ideea.

BTW: I'm talking about dx 9 here.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb172625(v=vs.85).aspx Edited by noatom
0

Share this post


Link to post
Share on other sites

From a GPU point of view, it's a pretty bad idea. For most GPU's reading from a dynamic vertex buffer will be slower compared to a static vertex buffer, since dynamic vertex buffers need to be placed in CPU-accessible memory. From a CPU point of view it might let you reduce draw calls quite a bit which can remove a lot of CPU overhead, but of course you need to spend some CPU time copying the vertex data into the dynamic buffer as well (you may also need to transform the vertex position/normal/tangent data depending on how you set things up). In general instancing will be a better way of reducing draw calls, if you can make use of it.

2

Share this post


Link to post
Share on other sites
Well this whole ideea is from a game engine book.The guy says that rendering more than 100 vertices is better than rendering 2-3 at a time.So he created this manager that has a number of dynamic vertex buffer.And in each dynamic buffer puts something like this:every vertex that uses texture x,no matter from what model that vertex is,goes into dynamic buffer x,every vertex that uses texture z,no matter from what model that vertex is,goes into dynamic buffer z.Now the book is a little bit old,but it says something like this: dynamic buffers are placed in agp ram,which gets faster to the normal ram and to the vram.Is this a good ideea? I was kinda shocked of using lots of dynamic buffers.You can also use static buffers ofcourse,he creates a function for that.But he is very proud by this concept of organizing vertices based on the texture they need in dynamic buffers.Please,express an opinion about this.

BTW: I know the concert of agp ram...is outdated,but is he still right about the current pcs? Edited by noatom
0

Share this post


Link to post
Share on other sites

Well he's correct that rendering a large number of vertices per-draw call is better than rendering a small number, but you'll get more mileage by ordering your data at load time (or - even better - in your content creation pipeline) so that you can achieve this with static buffers.  And MJP is absolutely correct that you can burn more CPU than you save by doing too much work to order stuff at runtime; generally you should be aiming to get your runtime work as low as possible, preferably just setting states and issuing draw calls (which is not always achievable - e.g some particle system approaches - but should be possible for ~90% of what you see on screen).

1

Share this post


Link to post
Share on other sites

Ayway,big question:
Can you give me some examples about when I should use a dynamic buffer? I thought I should use it for animated models.Would that be a good ideea?
Because there are certain types of animation,I mean I could make a cube animate like this: put a translation it it's world transform.So the vertex shader would use the world transform to animate it.Then there is absolutely no point in using a dynamic vertex buffer. Edited by noatom
0

Share this post


Link to post
Share on other sites
For systems that procedurally draw a lot of tiny procedural meshes, like dynamic 2D GUI elements, then yes, a system like this can help you batch them all together.

For general rendering though (e.g. with static models of 100+) polygons, it's a bad idea. If its possible to use the vertex-shader for animation, then you should prefer that over the CPU and dynamic buffers. Edited by Hodgman
0

Share this post


Link to post
Share on other sites

An alternative mode of operation is to create a library of dynamic textures and create texture atlases so that all the vertices that belong to one model have access to all their different textures on one atlas.

 

I'm also curious about what the tradeoffs are. I think its cool he got it to work, how does he handle other operations that break a frame's worth of rendering into multiple draw calls? Stuff like different vertex declarations between two models, different render states, different shader constant registers, etc? Unless you have one uber vertex declaration, one uber vertex/pixel shader and do instancing on everything so that you don't need to change a world matrix using SetVertexShaderConstantF between each new model draw, I don't see how he can even win more than once or twice per frame.

1

Share this post


Link to post
Share on other sites
well I actually saw 10 pages later that he suggests using static buffer as a primary resource.I have no ideea what kind of vertex or pixel shaders are used.I'm not even at the middle of the book.<br />
0

Share this post


Link to post
Share on other sites

All dynamic buffers will  need to be reloaded upon losing the device, i. e. a full screen app that you alt tab away from. Until the dynamic buffers have been cleared and reset, the renderer will not render anything. 

typically dynamic buffers tend to be things like particle effects, fonts, any of the ID3DX objects. 

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0