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

Software Occlusion Culling Rasterizer - What about small cracks?

5 posts in this topic

Hi,

If you'd use a Occlusion Culling Rasterizer much like DICE describes in their papers, determining visibility by checking how many pixels were written to a lower resolution render target; wouldn't this all break down when you encounter small cracks in your geometry which is visible at your higher resolution rendering but not visible at the smaller occlusion culling resolution? This would result in objects being discarded that are really visible.

 

How would you deal with this? Is it just accepted as one of the drawbacks of the technique?

0

Share this post


Link to post
Share on other sites

I don't know the exact technique behind it, but I would guess, that they use the maximum depth of a raster. In this case the maximum would not be the wall with the crack, but the surface visible through the crack. Therefor I would render the scene to the depth buffer using the final render resolution (or a lower resolution while accepting some errors) and scale this depth buffer down by using max(...).

1

Share this post


Link to post
Share on other sites

Yeah this is a drawback. Most rasterizers check to see if a triangle covers some sample point within a pixel (usually the centre) and then fills the pixel if that check is true. At low resolutions, this can cause issues.

Alternatively, you can check whether an entire pixel's square area is covered by the triangle, and only fill it if this test is true, which would solve these issues for a conservative depth renderer... unfortunately, this kind of rasterizer is a lot slower, so I'm not aware of anyone that actually does this.

 

The most common solution is probably to just ensure that your occlusion meshes are far enough 'inside' the actual mesh so that these problems don't occur in practice. If you notice this issue occurring, you can manually edit an occlusion mesh to make it smaller...

 

Lastly, you can just perform your rendering at full resolution. For a CPU based depth rasterizer, this might be too slow, but you could instead use a CPU-based occlusion rasterizer (1 bit per pixel), which is an order of magnitude or two faster at filling pixels, which makes rendering full-resolution feasible.

1

Share this post


Link to post
Share on other sites

Thanks for your responses! If I could pick, I would rather get some false-positives rather than the opposite. But it doesn't seem like there's a straight-foward way to do that. ;)

[quote name='Hodgman' timestamp='1358336719' post='5022136']
Lastly, you can just perform your rendering at full resolution. For a CPU based depth rasterizer, this might be too slow, but you could instead use a CPU-based occlusion rasterizer (1 bit per pixel), which is an order of magnitude or two faster at filling pixels, which makes rendering full-resolution feasible.
[/quote]

That's interesting. I'm definatly taking the approach of CPU depth rasterizer rather than the 1-bit per pixel approach. Not sure how they map that to the objects being rendered. But it got me thinking, thanks Hodgman!

1

Share this post


Link to post
Share on other sites
I'm definatly taking the approach of CPU depth rasterizer rather than the 1-bit per pixel approach. Not sure how they map that to the objects being rendered

Bare with me --

In this old thread from 2003, treething mentions that you can speed up depth rasterization by, instead of interpolating depth across a triangle using the values from the 3 vertices, you can just find the furthest of the 3 vertices and use it's depth as a constant across the whole triangle. This increases false-positives (where something is really hidden, but the OC says it's not occluded) in cases where your triangles are at steep angles, but saves you a few instructions.

 

For occludees (the things you're testing for occlusion), you could also rasterize them as triangles (e.g. if performing something similar to hardware occlusion queries -- counting how many pixels would have been filled), but instead of picking the max depth per-triangle, for these you pick the min-depth per triangle to make sure you don't end up with false-negatives.

 

In that article that I linked, they're taking this idea to the extreme -- if every triangle has a constant depth value, then you can pre-sort the triangles from front to back, using max-z for occluders and min-z for occludees. You then loop through the sorted list, processing the triangles from front to back.

Occluders write a 1 to every pixel that they cover, whereas occludees test all their pixels to see if any are a 0 (as soon as a 0 is found, they early exit and mark the object as being visible).

In this system, you don't need to render depth at all. Whenever you're testing an occludee triangle, your "render target" contains a boolean mask of which parts of the scene are covered by geometry that is closer to the camera than the occludee is! All you need to know is whether the occludee is fully covered by this mask or not.

 

At the end of this process, your render-target will likely be completely full of 1's and is of no use -- the occludee testing work is interleaved with the rasterizing of occluders, so that just the right amount of occluders have been drawn so far whenever something is tested.

Edited by Hodgman
1

Share this post


Link to post
Share on other sites

Makes perfect sense! smile.png I'm going to test that right away and run some numbers, it sounds like it could be very fast with SSE. Thanks a ton for your help!

1

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