far cry's occlusion culling

blackpawn

Newcomer
anyone know what algorithm far cry uses for their occlusion culling? running in wireframe i can see it lazily update occluded chunks. also there doesn't seem to be any preprocessing because you can change the data in the editor and the occlusion works immediately. seems very nice.
 
i don't think so. yes i agree it has those things and they are exposed in the editor, but i think it also has an automatic occlusion system for the terrain. for example if you start with a new map and go and make some big hills then put the camera behind it, for a couple frames the terrain behind the hill is still drawn and then one by one those terrain chunks drop out. (you can see this in wireframe)
 
Nope doesn't have that, yeah it has a distance LOD system and culling based on distance (pretty common in all engines), but no terrain based occulusion.
 
Last edited by a moderator:
well I can't say I know exactly how it works, but I'll share how I did something similar a *long* time ago (at least 4 years ago I think).

it doesn't actually have to be spectacuarly complex to work well. Even something rough and basic can proove surprisingly effective.

The way I did it, was given your height map (256x256), I'd split it into 16x16 regions (or there abouts). so say 256 regions. For each region, I'd get the lowest vertex height. Then, using that, I'd treat it as a low detail height map. To work out if a region was visible from the current view point, I'd do a very rough ray trace from the view point to the centre of the region. Sampling at most about 10 times along this path, I'd check if the min height was above the height along the ray, if so, it's occluded.

It sounds spectacuarly innaccurate, but it actually works really quite well. Also, you can be very lazy with it*, you do not need to update every region every frame, as they are so massive. Only large changes in position warrant an update. (not that the update is that expensive).

Here is a picture of it in action (managed to find the old app.. ;-)

terrain.jpg


Note how well it also back-face culls for the regions.

If you are interested, I actually have the app uploaded as well here. Although I warn you the controls are really bizzare, so check them out first before clicking run. *Please ignore the fact I'm being *too* lazy with the updating in this version - that was fixed later but I can't find that one.
 
Last edited by a moderator:
Back
Top