Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


data structure needed for frustum culling


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 newtechnology   Crossbones+   -  Reputation: 1075

Like
0Likes
Like

Posted 03 April 2014 - 01:11 AM

As my game is growing with hundreds of objects, performance issues are growing up. I'm doing 200 frustum intersection tests against object every frame. I thought a data structure would be good to reduce frustum tests.

 

I know about quadtree and octree and how they work. But, I just don't know how to implement it. Can anyone help me?

 

I'm doing terrain culling in hull shader (GPU based patch culling.)

10245285_860125380680484_1305655902_n.jp


Edited by newtechnology, 03 April 2014 - 01:29 AM.


Sponsor:

#2 Hodgman   Moderators   -  Reputation: 40856

Like
3Likes
Like

Posted 03 April 2014 - 01:17 AM

This is pretty interesting:

http://dice.se/wp-content/uploads/CullingTheBattlefield.pdf



#3 alek314??   Members   -  Reputation: 336

Like
0Likes
Like

Posted 03 April 2014 - 07:36 PM

As Hodman point out, SIMD optimised frustum culling will be fast enough. 

 

http://zeuxcg.org/2009/01/31/view-frustum-culling-optimization-introduction/

http://fgiesen.wordpress.com/2010/10/17/view-frustum-culling/



#4 newtechnology   Crossbones+   -  Reputation: 1075

Like
0Likes
Like

Posted 04 April 2014 - 01:44 AM

Well, but my idea is to subdivide terrain into octree (not for terrain culling) and then some how add objects list which lie in a specific node then do AABB-frustum test down tree to see if the object was visible. Any idea how to do this? or any other method (I don't understand the SIMD method properly)


Edited by newtechnology, 04 April 2014 - 02:13 AM.


#5 cozzie   Members   -  Reputation: 3330

Like
1Likes
Like

Posted 04 April 2014 - 12:33 PM

Hi. SIMD is a way of doing calculations, it's not a method for culling.
- you can optimize the obb or aabb cull function using SIMD
- besides this you could initially subdivide you world into sectors (big AABB's)'
then when you start culling objects, you check in which segment/AABB the camera is
- now you can just check the big AABB's which the camera is not in, and only cull objects in the sector if it's inside or intersecting the frustum
Crealysm game & engine development: http://www.crealysm.com
My games: http://www.crealysm.com/games

Looking for a passionate, disciplined and structured producer? PM me

#6 newtechnology   Crossbones+   -  Reputation: 1075

Like
0Likes
Like

Posted 07 April 2014 - 07:36 AM

Hi. SIMD is a way of doing calculations, it's not a method for culling.
- you can optimize the obb or aabb cull function using SIMD
- besides this you could initially subdivide you world into sectors (big AABB's)'
then when you start culling objects, you check in which segment/AABB the camera is
- now you can just check the big AABB's which the camera is not in, and only cull objects in the sector if it's inside or intersecting the frustum

I know that but I just don't know how to implement it.

 

EDIT: thanks for the sector idea, i'll try to implement it.


Edited by newtechnology, 12 April 2014 - 01:34 AM.


#7 newtechnology   Crossbones+   -  Reputation: 1075

Like
0Likes
Like

Posted 12 April 2014 - 02:10 AM

Hey, my idea is as follows:

 

1. Divide world into 8 big sectors (AABB)
2. Load all objects on map
3. Check Intersection between object-AABB and all sectors-AABB (only once for static objects.)
4. Find out which world sector intersects object
5. Save that world sector into object's model structure 
6. Check intersection between all sectors and camera frustum (every frame)
7. save results into memory (which sectors are visible)
8. for all models, if its sector is visible, then move down to see if
object was visible (else skip because sector is not visible then its model is not visible, note: this time we are using the saved result
in memory i.e we are not doing intersection, it has been done already in step 6.)
9. If visible then draw else skip.
10. Goto step 6 (for next frame)
 
But I dunno how to implement it, yet I'll try. Anyone seeing a problem in this method? (I know a problem arises when objects are in between sectors, but in that case we would assume it has 2 sectors as its parent.)
 
(Just for understanding.)
IHXjiYK.png
 
 
(Also, sorry for bad painting skills.)

Edited by newtechnology, 12 April 2014 - 02:26 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS