• 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
Anand Baumunk

Indices VS Vertices

6 posts in this topic

Hello fellows,
I came up with some questions other beginners in 3D stuff are may interested in also.
What are the pros/cons of using pure vertices for a mesh (Trianglestrip), or using indexed vertices (Trianglelist)?
I run a few tests with DrawInstanced and DrawIndexedInstanced. It appeared to be much more performant when I was using only vertices.
Are there some tips what to use when? What provides which advantages?
When I load models/animations what should I use?
You may know a good article on this?

EDIT: What is a maximum number of vertices send to GPU per frame to remain fine performace on a medium pc?

Thank you Edited by gnomgrol
0

Share this post


Link to post
Share on other sites
Indexed meshes don't have duplicate vertices. With proper management it'll make your models smaller in size and faster to render due to vertex cache.
0

Share this post


Link to post
Share on other sites
Always use triangle-order optimized indexbuffers. (e.g. D3DXOptimizeFaces()).

Strips vs. Lists: from my experience both perform equally well on modern hardware, but strips are smaller (lists 3 indices per triangle, strips +/- 2 indices per triangle).
0

Share this post


Link to post
Share on other sites
[quote name='gnomgrol' timestamp='1344860655' post='4969033']
EDIT: What is a maximum number of vertices send to GPU per frame to remain fine performace on a medium pc?
[/quote]

Depends greatly how you implement it. You can send several megabytes of data through dynamic vertex buffers, textures, buffer objects (etc) to the GPU per frame and maintain good fps. Of course the most efficient way to draw is not to send data to GPU and use static buffers which already reside in the GPU memory. Since that isn't realistic case, you'll need to take care about the amount data that travels through the bus to the GPU.

Top GPU's can handle some hundred of millions of polygon's per second in test scenarios. The question of maximum vertices per frame is highly relativistic depending on the overall complexity of the used vertex/pixel/geometry/domain shaders + size of polygons + amount of used shader resources + number of used render targets and surface formats + blending operations + etc ... you get the point.

Cheers!
2

Share this post


Link to post
Share on other sites
Thanks for your concern.
Currently I am sending 256*256*6 indices for 256*256 vertices (with pos and texcoord). Drawing 50 of those with DrawIndexedInstanced. Instancedata is just setting X and Z offset , and the vertex and pixelshader are pretty basic. Just one rendertarget, everthing else basic also. It's the only thing I'm doing per frame. The FPS fall down to 10. I dont really get why this is happening. Is this really already to much data to send?
When I throw the DrawIndexedInstanced line out, FPS go up to 350.

[media]http://www.youtube.com/watch?v=4Ghulpp6CPw&feature=g-vrec[/media]
How can people do something like that maintain a decent performance??? Edited by gnomgrol
0

Share this post


Link to post
Share on other sites
[quote name='eppo' timestamp='1344870279' post='4969090']
Strips vs. Lists: from my experience both perform equally well on modern hardware, but strips are smaller (lists 3 indices per triangle, strips +/- 2 indices per triangle).
[/quote]
There's a tradeoff in this. Strips have a lower index count for sure, but lists can have a lower vertex count. With strips you're never going to get better than 1 vertex per triangle, whereas with a list the theoretical best case is 0.5 vertexes per triangle. As vertexes tend to be larger than indexes (is there ever any case in which they're smaller?) this can amount to a huge saving in vertexes as the cost of a smaller overhead in indexes.

That's not the full story though. The precise saving you'll get will be heavily dependent on the model you're rendering; if you have a lot of duplicated data then obviously there is more saving to be made with lists. You can also consider strips with primitive restart if you can target more modern hardware (which I assume is the case since you mentioned D3D10/11 draw calls), although my own experience is that it tends to be something of a wash between that and lists.

It's rarely mentioned but lists are also good for concatenating multiple strips (which you can also do with primitive restart) and for concatenating strips with fans and/or quads (which you can't do with primitive restart). Given the huge bandwidth of modern hardware that one point, IMO, tends to lead to me generally favouring lists, as it can result in less (and faster) preprocessing of model data in order to get it into a format where it can be used for drawing with, even in cases where a single large strip may benchmark as more performant. It also can lead to cleaner simpler code if everything can go through a common draw point.

One final point worth noting is that lists were used for everything in Quake 3 Arena; see: http://www.gamers.org/dEngine/quake3/johnc_glopt.html. Yes, it's an old old old game, and yes, it's OpenGL, not D3D, but it was used as a common graphics benchmark for such a long time that it should be considered as a reasonable indicator of the direction much graphics hardware and drivers have been optimized in.

[quote name='eppo' timestamp='1344870279' post='4969090']
Always use triangle-order optimized indexbuffers. (e.g. D3DXOptimizeFaces()).
[/quote]
It's worth noting that these calls, despite being D3D9 and not present in 10 or 11, can be used in D3D10 or 11 by just including the relevant headers and libs.
1

Share this post


Link to post
Share on other sites
[quote name='gnomgrol' timestamp='1344884628' post='4969165']
When I throw the DrawIndexedInstanced line out, FPS go up to 350.
[/quote]

Using debug or retail build? using debug or retail d3d libraries? Your hardware? Any errors in debug windows?

[quote]
How can people do something like that maintain a decent performance???
[/quote]

The video shows and explains it pretty well ... instead of drawing lots of trees, they use clever impostor tricks.

Cheers!
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