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

How to cull objects behind terrain like CryEngine2

10 posts in this topic

I found CryEngine2 could cull every thing behind terrain blocks, including terrain itself, i thought it might use the hardware query to do this ,but i found nothing in NvperfHud,the only thing i found was some one metioned in a forum: 'So you cant use terrain slopes and hills as a trick to optimize your level like Crysis does' in [url="http://leadwerks.com/werkspace/topic/3192-occlusion-culling/"]http://leadwerks.com/werkspace/topic/31 ... n-culling/[/url]
does any one know some hints or relative links about the solution?
thanks :)
0

Share this post


Link to post
Share on other sites
I was actually just recently discussing this problem with a friend. He had very hilly terrain and wanted to optimize the rendering by culling the objects occluded by the hills. [url="http://assaultwars.com/javascript/heightmapocclusion.html"]I wrote up a very simple test[/url]. Given a heightmap that's NxN, in the example's case 64 by 64, and a player's position you can perform an optimized 2DDDA grid traversal from the player to a point of interest see if it's occluded. In the example the player is the mouse position 2 meters above the terrain. The points of interest that are tested are points randomly positioned above the terrain.

You might be wondering how this helps for culling large amounts of entities. If you store your entities in an octree and perform frustum culling already you know that you have to expand nodes that intersect the frustum. So you can exploit this occlusion by doing a test for nodes of a certain depth (basically for nodes that represent a cube size that's small enough to be hidden behind a mountain). If you have to expand a node in the octree you first test the top 4 points of the cube by traversing the heightmap from the player and seeing if it can see the point. It's not perfect and really weird terrain can break the algorithm, but ideally it works and allows you to not expand nodes and thus not include entities in those nodes. I haven't test it myself, but it seems cheap enough to perform.
1

Share this post


Link to post
Share on other sites
Will it be a little expensive? for example ,the terrain is 1024*1024 ,a lot of test are needed for every object in the scene,and if the object is very large(a big castle far away from the camera ),it is very possible to get a wrong result if only top 4 points of the castle's node are tested against terrain grid, we can avoid this by splitting the node into small segments(smaller than terrain's grid),but the number of test grows greatly in this case.
any suggestion?
0

Share this post


Link to post
Share on other sites
According to my tests.
If implemented right, occlusion culling doesn't stall the rendering and actually helps.
Culling objects behind terrain simple. You don't even need to sort anything. Just draw the terrain first.
Occlusion culling conflicts with other "speeding up" techniques like instancing, so doing it on individual objects isn't the perfect way.
You should, for example occlusion cull octree nodes against one another and the terrain in that nodes you should have instanced objects that you draw in one draw call. It depends of the scene, since there maybe nodes that contain lost of different meshes, so instancing won't help much, and maybe you will be better off in this situation have per-object culling, not per node, especially if the nodes are big and objects are complex. I think there's alway a compromise, and there isn't an ideal solution for every situation.
1

Share this post


Link to post
Share on other sites
the simplest way to do it would be to save for octree nodes what other ocetree nodes are visible from this node. you wouldn't save it for billion of nodes, but bit-tests for the octree-traversal. this can be computed offline in any way you'd like to. it's similar to the PVS the quake engines use, but on octree level, not on convex-bsp-cell level, if you sort objects into the octree, you'll get their visibility like free candy.

Tho, in cryengine it's done by a software occlusion culler, this way all kind of test: entity vs brush vs tree vs terrain work uniformly and it's editable in realtime, it's also quite fast, just some more work and experience is needed to get it running fast.

1

Share this post


Link to post
Share on other sites
There is also [url="http://research.cs.queensu.ca/%7Ejstewart/terrainSummary/"]Horizon Occlusion Culling[/url]
1

Share this post


Link to post
Share on other sites
thanks for your answers ![img]http://public.gamedev.net/public/style_emoticons/default/smile.gif[/img]
i asked the same question in ogre forum,they told me CryEngine utilize [color=#333333][url="http://www.cg.tuwien.ac.at/~scherzer/chc/index.html"]Coherent Hierarchical Culling[/url](CHC) to cull the scene.this algorithm make use of hardware occlusion query, but [/color][color=#333333] when [/color][color=#333333]i put crysis in NvperHud[/color][color=#333333] i found [/color][color=#333333]only one IDirect3DQuery9 was called [/color][color=#333333] [/color][color=#333333]after i scanned all DX API calls in one frame[/color][color=#333333], it was the called before rendering the ocean. so i was puzzled..[/color]
[color=#333333]
[/color]

0

Share this post


Link to post
Share on other sites
[quote name='jdyyx1984' timestamp='1301325699' post='4791358']
i asked the same question in ogre forum,they told me CryEngine utilize [color="#333333"][url="http://www.cg.tuwien.ac.at/~scherzer/chc/index.html"]Coherent Hierarchical Culling[/url](CHC) to cull the scene.[/color]

[color="#333333"][/quote]:), people come up with funky ideas :)
[/color]
[quote name='jdyyx1984' timestamp='1301325699' post='4791358']
[color="#333333"]this algorithm make use of hardware occlusi[/color][color="#333333"]on query, but [/color][color="#333333"] when [/color][color="#333333"]i put crysis in NvperHud[/color][color="#333333"] i found [/color][color="#333333"]only one IDirect3DQuery9 was called [/color] [color="#333333"]after i scanned all DX API calls in one frame[/color][color="#333333"], it was the called before rendering the ocean. so i was puzzled..[/quote][/color]


[color="#333333"]this one is really just for the water and especially for rendering the reflection map. (if you don't see the water, no need to render the reflection), and in contrast to most objects in a level, that have simple boundaries, ocean water has waves and is kinda infinite in size, so using the occlusion hardware occlusion results for this one makes really sense. you can check that out in the editor, move close to some wall where the ocean is behind, and when you move through the wall (in editor mode), you see the ocean appears some frames later.
[/color]

[color="#333333"]you can also experiment with the occlusion culling, just enable the drawcall and polycounter and watch how it rises and drops when you move behind objects, terrain is obviously culled by that, but you won't see any latency issues like you'd see with hardware occlusion queries.
[/color]
1

Share this post


Link to post
Share on other sites
so they use some kind of [color=#1C2837][size=2]software occlusion culler , i 'm so curious~~~[/size][/color][img]http://public.gamedev.net/public/style_emoticons/default/angry.gif[/img]
0

Share this post


Link to post
Share on other sites
[quote name='jdyyx1984' timestamp='1301329533' post='4791375']
so they use some kind of [color="#1C2837"][size="2"]software occlusion culler , i 'm so curious~~~[/size][/color][img]http://public.gamedev.net/public/style_emoticons/default/angry.gif[/img]
[/quote]

yes, software occlusion culling <3


what are you curious about? I might know it from somewhere ;)

1

Share this post


Link to post
Share on other sites
i'm using horizon occlusion culling with hierarchical Z occlusion map, the result is very satisfied.
horizon occlusion culling is very fast but in some situation it can not work( like stand on top of the hill), so mixed with hierarchical Z occlusion map.



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