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

Occlusion cull - Reloaded

7 posts in this topic

Hi,
I have a simple hardware occlusion culler implemented, but it stalls my pipleline forcing me to fetch the results in the next frame, that leads to latency.
I heard people are using other types of occlusion culling methods, like for exapmle - Software occlusion culling on the CPU.
How is that implemented ? A software floating point depth buffer to check things against ? A software rasterizer to render coarse meshes to produce that depth buffer ?
Is there other , pure geometric methods of occluion culling. Some Axis Aligned Bounding Boxes calculation in world, camera, screen space ?
Any hints, links, advices etc. will be appreciated.

Thank you.
0

Share this post


Link to post
Share on other sites
There's a [url="http://s09.idav.ucdavis.edu/talks/04-JAndersson-ParallelFrostbite-Siggraph09.pdf"]Siggraph 09 presentation from DICE[/url] about software rasterization-based occlusion culling. It's a very interesting read. [url="http://code.google.com/p/urho3d/"]Urho3D[/url] implements a software rasterization based culler which I think is very close, if not identical to the one in the presentation.

Other CPU methods that don't do rasterization tend to all be a kind of portal or sector-based (PVS sets, BSP trees). They are nice too, but most often restrict to static geometry only.
0

Share this post


Link to post
Share on other sites
Thanks.
I've seen that paper and it's pretty much clear how they do it. I'm not really sure I like the idea of keeping a separate low-poly mesh for each occluder to draw triangles of that mesh to a software depth buffer on the CPU.
0

Share this post


Link to post
Share on other sites
The general approach with hardware occlusion queries is: if the latest set of results for an object are not ready yet (your API will provide a means for testing this without actually fetching the results and having to stall) you just reuse the last result that you got. Otherwise the results are ready so you can go ahead and fetch them without stalling. This exploits temporal coherence - the assumption that even in a quite dynamic scene, on a raw frame-to-frame basis things don't really change too much.

There are a couple of edge cases where you need to short-circuit this - e.g., if an object is new in the scene then you should assume that it's visible by default until a fetched query result tells you otherwise. Likewise, if an object moves out of the scene (e.g. by frustum culling) then you must also do the same when it next moves back in (being careful to make sure that you let any outstanding query on it run to completion anyway, otherwise Interesting Things might happen).

In general it works quite well and can give good results, but is a little more complex to set up and manage than a scheme that just always fetches the results.

The software-based method involves an obvious tradeoff, and relies on the cost of keeping and updating a software z-buffer (which is generally of much lower resolution than your real hardware one) being less than the cost of just drawing the objects anyway. Edited by mhagain
1

Share this post


Link to post
Share on other sites
Thanks. I'm in a process of finishing a software renderer for a small z-buffer.
I want to ask another question.
I have some problems with aggressive culling now.
Let me explain. I have frustum culling and then occlusion culling. I keep pointers to mesh and other objects in terrain patch nodes.
The terrain is space partitioned via quadtree and when occlusion culling is enabled it culls large portions of the terrain geometry and contained objects in those nodes.
The problem is that my FPS fluctuates very much. If camera is looking at a wall that occludes large portions of the scene the FPS is around 200 fps, but when camera turns fast, lots of geometry comes into view causing awful lag for a fraction of a second, or even for a whole second the game freezes. Then frame rate stabilizes again, but drops real bad if camera makes another move in certain direction.

What can I do about such a problem ?
Sometimes I prefer to render everything every frame to keep the frame rate constant, not matter how low it is.
It's very annoying to have smooth rendering and all of a sudden everything to freeze for e sec, and when the game continues again, you find yourself five feet away from the place you have been, missing a several frames of the simulation...
0

Share this post


Link to post
Share on other sites
Are you creating GPU resources (vertex buffers, textures etc.) or doing other heavy operations in response to objects becoming visible? If that's the case, can you rather pre-create everything at scene load time? Or do you have such large amount of textures that they don't fit into your GPU memory at once?
0

Share this post


Link to post
Share on other sites
You can actually even use occlusion query results in the same frame without pulling the result by using conditional rendering. I have an OpenGL example for that here: https://github.com/progschj/OpenGL-Examples/blob/master/10queries_conditional_render.cpp

I get significant speed up on modern hardware (like factor 5 or so on my GTX560TI and up to factor 10 or so on a AMD 7730M). The older GTX260M actually lost performance from doing that though.
0

Share this post


Link to post
Share on other sites
Thanks guys.
Well, I did some testing and it seems that my for the amount of mesh and texture data I use, my video memory struggles. When I resized all of my textures by half - diffuse, normal maps, specular maps etc. everything runs smoothly.
I guess, when certain limit is exceeded for my video card, it tries to put things in system memory or something which is slowing thing down.
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