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

Best visibility culling algorithm for single room scene

17 posts in this topic

Hi there,

i'm looking for best visibility culling algorithm for 3D scene where is single room with a lot of objects inside. In seldom cases room can be not rectangular. Scene is static but its rebuilding should not require a lot of time. As for me candidates i'm i see:

- Octree

- BSP

Please, give me advice which one better to choose.
0

Share this post


Link to post
Share on other sites
Octree and BSP are scene partitioning structures, they do not do any culling.
what kind of culling are you looking for? do you want to accelerate frustum culling, occlusion? light sources?
how big is the scene (object count, light count, triangle count) and what part is mainly limiting your performance (drawcalls, vertex work, pixel work...) ?

that would help to give you a better advice.
0

Share this post


Link to post
Share on other sites
Hi Krypt0n,
i want to accelerate frustum culling. in common cases the scene is not too large. it contains from 30 to 100 object that consists from about 200,000 triangles. it has from 1 to 10 light sources. pixel work is bottleneck.

------------------------

EDIT:
200,000 triangles - i mean whole 3D scene has such count of triangles.. Edited by user88
0

Share this post


Link to post
Share on other sites
thanks for answer Krypt0n.

Currently i'm implementing deferred rendering in my engine. maybe you are right and that will be enough for good performance. But because there are a lot of code changes now it is good time to implement anything else and i think maybe Octree or BSP will be useful for my case..
0

Share this post


Link to post
Share on other sites
[quote name='Krypt0n' timestamp='1336998778' post='4940040']
3. you could try to use occlusion culling to further reduce the object count and this way free some compute resources for the pixel work (although I doubt there is much occlusion in typical single rooms)
[/quote]

What kind of occlusion culling are you suggesting in a modern world, where objects could be dynamic and there could be hundreds of rooms in a level, each containing hundreds of objects ?
I heard people are using software rasterizers to build a software depth buffer and test <bounding boxes of rooms> against it..
0

Share this post


Link to post
Share on other sites
By the way, i have profiled frame rendering process in my 3D engine and frustum visibility culling takes 15% from full frame time. Does it say that i need to implement any advanced visibility culling technique?
0

Share this post


Link to post
Share on other sites
I have simple frustum culling (running in flash) and it will culll away 10-20,000 objects in about 1ms... on a more low level languange that number should be 5 - 10 times smaller still!

Sounds suspect to me, are you frustum culling triangles or something?

If that really is an issue for you I recommend caching (it gave me a whopping speed increase). Its real simple to add in, just store the id of the plane of plane that cause the frustum check to fail, then check that one 1st next time round... about 2 minutes of coding and can almost double your speed.

With that in mind for any scene comprising of less then 10,000 objects or so its not really worth implementing any tree structure for me.
1

Share this post


Link to post
Share on other sites
I do simple frustum bounding box culling. 10-20,000 objects in about 1ms is good result. I need to check whether the application performance profiler give me correct results..

Thanks for this suggestion:
[quote name='bwhiting' timestamp='1337005049' post='4940079']
With that in mind for any scene comprising of less then 10,000 objects or so its not really worth implementing any tree structure for me.
[/quote]
0

Share this post


Link to post
Share on other sites
probably wont help you much but if you have your planes in an array, then you can unroll the loop (as it is only ever 6) this can also save you a teeeny bit of time, but might not be noticeable depending on the platform.

ah your checking bounding boxes.... while spheres are not exactly the perfect bounding volume they are by far the fastest test against a frustum, you could easily go on to check a bounding box if you had an intersection, but generally its not needed. spheres all the way
0

Share this post


Link to post
Share on other sites
[quote name='solenoidz' timestamp='1337000812' post='4940049']
[quote name='Krypt0n' timestamp='1336998778' post='4940040']
3. you could try to use occlusion culling to further reduce the object count and this way free some compute resources for the pixel work (although I doubt there is much occlusion in typical single rooms)
[/quote]

What kind of occlusion culling are you suggesting in a modern world, where objects could be dynamic and there could be hundreds of rooms in a level, each containing hundreds of objects ?
I heard people are using software rasterizers to build a software depth buffer and test <bounding boxes of rooms> against it..
[/quote]
well, I'm a bit biased as you might see here: http://www.gamedev.net/page/community/iotd/index.html/_/one-billion-polys-r85
I would always use a software occlusion culler, as there is no latency, no pre-calculation, everything can be dynamic etc. to get a good visibility set.

But if you assume you have really hundrets of rooms and you're not making an earth quake simulator, it could be just as good to setup a portal system or calculate a PVS for every room to room.

[quote name='user88' timestamp='1337002931' post='4940067']
By the way, i have profiled frame rendering process in my 3D engine and frustum visibility culling takes 15% from full frame time. Does it say that i need to implement any advanced visibility culling technique?
[/quote]
as bwhiting said, you can cull 100 times of what you're currently processing with a very low cpu usage.I'm afraid your benchmarking is somehow wrong. are you maybe benchmarking in debug mode, or on a mobile device? tell us how you benchmarked?
if you want to really see what going on, install AMD CodeAnalyst and profile with it. it's maybe one hour to get into it, but it's quite easy to setup and to see the most expensive functions.
0

Share this post


Link to post
Share on other sites
[quote name='Krypt0n' timestamp='1337017657' post='4940147']
install AMD CodeAnalyst and profile with it
[/quote]
not sure that this profiler will work with my Intel CPU properly, but thanks for advice.

I used ANTS Performance Profiler under .Net Framework, it was release. Because the stencil mirror technique was used the count of Frustum vs Bounding Box checking could be more than 100 times, but not too match..
0

Share this post


Link to post
Share on other sites
[quote name='user88' timestamp='1336998234' post='4940038']
200,000 triangles - i mean whole 3D scene has such count of triangles..[/quote]
Is this for a mobile device?

Pretty much any desktop graphics card should be able to brute force 200,000 triangles at a decent framerate - have you considered just not culling at all, since your levels are so small?
0

Share this post


Link to post
Share on other sites
[quote name='user88' timestamp='1337068539' post='4940310']
[quote name='Krypt0n' timestamp='1337017657' post='4940147']
install AMD CodeAnalyst and profile with it
[/quote]
not sure that this profiler will work with my Intel CPU properly, but thanks for advice.[/quote]works fine with intel for me
[quote]
I used ANTS Performance Profiler under .Net Framework, it was release. Because the stencil mirror technique was used the count of Frustum vs Bounding Box checking could be more than 100 times, but not too match..
[/quote].Net? you mean c#? not sure if code analyst works for that, I never used it for time critical code.

[quote name='swiftcoder' timestamp='1337069543' post='4940315']
[quote name='user88' timestamp='1336998234' post='4940038']
200,000 triangles - i mean whole 3D scene has such count of triangles..[/quote]
Is this for a mobile device?

Pretty much any desktop graphics card should be able to brute force 200,000 triangles at a decent framerate - have you considered just not culling at all, since your levels are so small?
[/quote]
that might explain a bit:
[quote name='user88' timestamp='1336998234' post='4940038']
... pixel work is bottleneck.
[/quote]

cheers
0

Share this post


Link to post
Share on other sites
[quote name='swiftcoder' timestamp='1337069543' post='4940315']
View Postuser88, on 14 May 2012 - 08:23 AM, said:
200,000 triangles - i mean whole 3D scene has such count of triangles..
Is this for a mobile device?
[/quote]
No, this is PC Application with 3D visualization.
[quote name='Krypt0n' timestamp='1337070772' post='4940324']
that might explain a bit:

View Postuser88, on 14 May 2012 - 08:23 AM, said:
... pixel work is bottleneck.
[/quote]
This application is targeted to visualize nice designed interior of living rooms. Because the image quality is important the pixel shaders are complicated. Currently the forward rendering is used and pixel shader is bottleneck.

I know that it is better to improve pixel shader than of any visibility culling algorithm. But after profiling i have seen that visibility culling takes 15% of frame and i decided to improve that too. Now i suspect that profiling results are wrong..
0

Share this post


Link to post
Share on other sites
How are you profiling your GPU time? QueryPerformanceCounters around DirectX calls? Edited by jameszhao00
0

Share this post


Link to post
Share on other sites
[quote name='jameszhao00' timestamp='1337072669' post='4940330']
How are you profiling your GPU time? QueryPerformanceCounters around DirectX calls?
[/quote]
i use nVidia PerfHUD
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