• 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.

Archived

This topic is now archived and is closed to further replies.

Tom

Render cost of degenerate triangles

10 posts in this topic

Are the latest nVidia drivers designed to understand the concept of degenerate triangles, in that they will effectively skip rendering them? This is pure speculation; I''ve read nothing to suggest it, and I have no evidence to support it. The reason I ask is because the overdraw for degenerate triangles approaches 200 percent as your triangle count rises (it''s never less than 100 percent); however, if the video card knows to skip these "invisible" triangles, then it really doesn''t matter how many you use, right? It''s only a matter of vertex buffer memory. I wonder if driver developers have considered this.
0

Share this post


Link to post
Share on other sites
Short answer: it''s totally safe to use degenerate triangles. Even older cards handle them just fine.

Long answer:
The idea of using degenerate triangles has been around for a long time. It''s really not even possible for a degenerate triangle to be rasterized because, by definition, a degenerate triangle has at least two vertices that are the same. This means that any attempt to rasterize the triangle will result in just a line being rendered.

Depending on what kind of triangle rasterization algorithm is actually implemented by the hardware, this can be difficult to handle. Most triangle rasterization techniques require that all the vertices of the triangle be distinct.

For this reason, degenerate triangles are simply ignored by the hardware

neneboricua
0

Share this post


Link to post
Share on other sites
Degenerate tris do take up memory, they may slow the upload of the buffers (depending on config) and they will be transformed, which includes running through a vertex shader if you have one.

They aren''t free, but they are pretty cheap. Though if you have more than a few it is often a win to switch to indexed lists rather than strips.


Stay Casual,

Ken
Drunken Hyena
0

Share this post


Link to post
Share on other sites
The usage of degenerated triangles is virtually free because (using indexlists) every vertex only gets transformed one time thus the statement of DrunkenHyena is wrong in the way that there is an unnecessary transformation overhead for the vertices of the degenerated triangle.

Remember that degenerated triangles are made of the last vertex of the previous ''has to be drawn'' triangle and the first vertex of the next ''has to be drawn'' triangle.

Sidenote : Degenerated triangles are always (!) used with index lists... never without index lists.

Best regards,
Metron
0

Share this post


Link to post
Share on other sites
quote:

Sidenote : Degenerated triangles are always (!) used with index lists... never without index lists.


Degenerate triangles are used in STRIPS because it''s necessary to stich non-contiguous strips together. I cannot think of a reason why you would ever want to use them with lists.



Stay Casual,

Ken
Drunken Hyena
0

Share this post


Link to post
Share on other sites
quote:
Original post by DrunkenHyena
quote:

Sidenote : Degenerated triangles are always (!) used with index lists... never without index lists.


Degenerate triangles are used in STRIPS because it''s necessary to stich non-contiguous strips together. I cannot think of a reason why you would ever want to use them with lists.
Rendering heightmaps.

0

Share this post


Link to post
Share on other sites
quote:
Original post by Metron
The usage of degenerated triangles is virtually free because (using indexlists) every vertex only gets transformed one time thus the statement of DrunkenHyena is wrong in the way that there is an unnecessary transformation overhead for the vertices of the degenerated triangle.


Actually, this isn''t quite correct. Degenerate triangles are used with triangle strips, not triangle lists. They can also be used with or without index buffers.

How many times a vertex is transformed depends on the index buffer and has nothing to do with whether a triangle is degenerate or not. The vertices of a degenerate triangle may indeed be transformed more than once because an index buffer can specify the vertices of degenerate triangles more than once if it needs to.
quote:

Sidenote : Degenerated triangles are always (!) used with index lists... never without index lists.


Again, degenerates cannot be used when rendering using triangle lists (whether it be with or without an index buffer). They are only used with triangle strips. Degenerates can be used in a triangle strip regaurdless of whether or not an index buffer is used.

neneboricua
0

Share this post


Link to post
Share on other sites
quote:
Again, degenerates cannot be used when rendering using triangle lists


They CAN be used, it''s just that there''s no need to use them.
0

Share this post


Link to post
Share on other sites
Ok, let's clear up things a little.

Degenerates and lists/strips.
Degenerate SHOULD only be used with strips. They CAN be used with lists but thats totally useless. If you see a reason to use degenerates with lists, feel free to post it here.

Degenerates and index buffers
Degenerates are used to get better batching with strips. Strips are used to reduce download and transformation overhead. Index overcome is almost exactly the same as strips, as they let the hardware reuse transformed (cached) vertices and save a lot of download overhead since you only need to upload 16 (or 32) bits instead of full repeated vertices. Therefore, there is (almost) no point in using strips and index buffers, except in very specific cases, such as heightmaps, since you can reuse the same index buffer for each patch (and still, that's very close to using strips only).


Conclusion
You should use EITHER:
- Degenerates on non indexed strips.
OR
- Indexed lists (with no degerates, of course)

OR MAYBE
- Indexed strips, which should only be used on several batches that use the same indices.

[edited by - Coincoin on April 23, 2004 10:28:06 PM]
0

Share this post


Link to post
Share on other sites
Just to add, degenerate triangles are used in tri-lists for some special algorithms. For example, you can implement a silhouette edge rendering algorithm using degenerate triangles. So they aren''t just used in the tri-strip case.
0

Share this post


Link to post
Share on other sites
Thanks for the info. Sounds like the only thing I've got to worry about is assembling my vertex buffers fast enough.

My original overdraw assessment was incomplete and therefore incorrect. I was assuming a batch of sprites, where each sprite is two triangles, and no two sprites are connected. In this case alone, overdraw approaches (but never reaches) 200 percent.

Of course, in a more reasonable application (like a terrain renderer), you would have far less overdraw, thereby making degenerate triangles extremely efficient. I'll remember this for future reference.

[edited by - Tom on April 24, 2004 2:18:53 PM]
0

Share this post


Link to post
Share on other sites