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

Any articles or demos on sorting triangles for real time semi-transparent rendering?

10 posts in this topic

I've searched on google and I haven't found any useful information yet :(.

 

Is there any one who knows something about this?

0

Share this post


Link to post
Share on other sites

there have been tons of different implementaions, I'm surprised you haven't found any.

 

most recent is the ati mech demo, not sorting just triangles, but sorting individual fragments:

http://developer.amd.com/resources/documentation-articles/samples-demos/gpu-demos/ati-radeon-hd-5000-series-graphics-real-time-demos/

 

-you can determine correct order using "depth peeling"

-you can use the "painter algorithm" and sorting by the nearest or most far or center point of triangles

-you can do sorting by using BSP trees

-you can use six-side pre indexed meshes, means, you preprocess your mesh to have 6 indexbuffer, in every of those you sort by one axis direction (+x,-x,+y,-y,+z,-z) and during rendering you pick the closest one

-you can dump all visible transparent triangles into some buffer and use compute shader, opencl or cuda to do sorting

-you can do the previous point but with tiles, e.g. 128x128 pixel, that way sorting might be more accurate

-you could use a scanline rasteriser with an s-buffer http://www.flipcode.com/archives/The_Coverage_Buffer_C-Buffer.shtml it's like a realtime per line BSP tree you construct and then evaluate per pixel

-you can use an A-buffer to route pixels and with a custom resolve get a proper sorting up to some limited depth complexity http://www.humus.name/index.php?page=3D&ID=76 (I think there is an extension to this called k-buffer)

 

Thank you.

 

You mentioned that triangles can be sorted on gpu, through compute shader, openCl, or cuda. Could you talk more on this? Could you post more information on this? I can't find anyting useful on this topic through search engine.

0

Share this post


Link to post
Share on other sites

Last year at Siggraph Asia there was a cool paper on presorted triangle lists: http://w3.impa.br/~diego/publications/ChenEtAl12.pdf I haven't tried to implement it but it looks cool. It uses some prepossessing to make a special triangle list with the triangles in a special order that can be rendered in any view. Of course this order does not always exist so what they do is duplicate some triangles.Then they use a simple test in the one of the shader stages to skip some of the duplicated triangles. The test can be done in either the geometry, vertex or fragment stage in the paper they explain the pro and cons of each stage.

0

Share this post


Link to post
Share on other sites

Last year at Siggraph Asia there was a cool paper on presorted triangle lists: http://w3.impa.br/~diego/publications/ChenEtAl12.pdf I haven't tried to implement it but it looks cool. It uses some prepossessing to make a special triangle list with the triangles in a special order that can be rendered in any view. Of course this order does not always exist so what they do is duplicate some triangles.Then they use a simple test in the one of the shader stages to skip some of the duplicated triangles. The test can be done in either the geometry, vertex or fragment stage in the paper they explain the pro and cons of each stage.

 

Thanks.

 

The article is insteresting. And it also contains many reference articles in the end. But this method works only for static meshes. And its preprocessing is so slow.

 

Any other idea?

0

Share this post


Link to post
Share on other sites

This paper on Dual Depth Peeling also presents an alternative approach to order independent transparency they refer to as "Weighted Average" (hidden away on page 8).  It sounds too good to be true, it's just one pass over the geometry, and then a full-screen blending pass.  The results are an approximation, but from the pictures in the paper, the results are indistinguishable from doing it the correct way.

 

It uses MRT with 16-bit 4 channel target to accumulate RGBA values, and a second target to count the layers of transparency at each pixel.  Then the fullscreen pass divides the accumulated RGBA by the layer count and blends the result to the main framebuffer.  Super simple.

 

I haven't tried it myself, but it sounds great for particles.  Anyone try it?

 

1

Share this post


Link to post
Share on other sites

This paper on Dual Depth Peeling also presents an alternative approach to order independent transparency they refer to as "Weighted Average" (hidden away on page 8).  It sounds too good to be true, it's just one pass over the geometry, and then a full-screen blending pass.  The results are an approximation, but from the pictures in the paper, the results are indistinguishable from doing it the correct way.

 

It uses MRT with 16-bit 4 channel target to accumulate RGBA values, and a second target to count the layers of transparency at each pixel.  Then the fullscreen pass divides the accumulated RGBA by the layer count and blends the result to the main framebuffer.  Super simple.

 

I haven't tried it myself, but it sounds great for particles.  Anyone try it?

 

I thought it looked too good to be true at first as well. Unfortunately, trying it out confirmed this. The inaccuracies quickly become quite noticeable if there's a significant difference between the brightness of overlapping fragments. The main issue is that the transparent fragments don't look ordered at all, so a bright fragment in front of a dull one looks identical to a dull one in front of a bright one. In my view, this looks quite glaringly wrong.

 

I now use per-pixel linked lists to do OIT. It's obviously more expensive than the weighted average approach, but it produces 100% accurate results, and I think it's worth the tradeoff.

 

I still use weighted average as a fallback, though. It remains preferable to no OIT at all, and might be okay if you're only using it for fast-moving particles or something. I'd recommend giving it a shot, anyway, as it's pretty trivial to implement.

Edited by myers
1

Share this post


Link to post
Share on other sites

What's your particular situation? Do you have extremely complex transparent objects that need to be rendered perfectly, or do you just need a solution that's on par with current-gen games?

I previously encountered a problem of transparent dresses and hair rendering. I didn't figure out a perfect solution at that time.

 

Later I have an idea of sorting triangles. My idea is to divide view frustum into many small view frustums, and put centers of triangles of a mesh into those small frustums, and then do sorting on triangles in each small frustum. Because nearer frunstums occlude further ones, we can fill the indices buffer in the order from further frunstums to nearer ones. So that triangles will be rendered from further to nearer.

 

I wonder whether there is someone who has already implemented such an idea.

0

Share this post


Link to post
Share on other sites

 

What's your particular situation? Do you have extremely complex transparent objects that need to be rendered perfectly, or do you just need a solution that's on par with current-gen games?

I previously encountered a problem of transparent dresses and hair rendering. I didn't figure out a perfect solution at that time.

You probably want k-buffers for that. Much like the OIT method of A-Buffers but limited and designed to handles hundreds of transparencies like you would encounter with hair. Here's a paper.

Edited by Sirisian
0

Share this post


Link to post
Share on other sites

 

You probably want k-buffers for that. Much like the OIT method of A-Buffers but limited and designed to handles hundreds of transparencies like you would encounter with hair. Here's a paper.

 

I run a-buffer OIT sample in DX SDK. It's very slow, it can't be used in games. Is k-buffer also slow?

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