finally got something working that makes me happy (everything keeping the time for culling below 1ms per frame makes me happy).
im using smaller patches (16x16) to test the limits and disable frustum culling (because it would take all the fun out of it, if theres nearly nothing left).
the pros over horizons:
-no precalculations except bounding box
-no horizon distance
the cons:
-requires line "rasterization"
-therefore many steps per occlusion test
things to change:
-add precalculations for lowest point from 2 directions
-use faster line drawing than bresenham (efld performed 4.5 times faster in my tests)
-stop calculating values for tested object each step (im braindead and didnt notice that one until now)
this will:
-increase the height below things can be culled
-add only 2 unsigned shorts per patch
-reduce time for line drawing (ironically, drawing the line takes longer than all the occlusion tests)
-reduce the work each step by half
problems to check for:
-cull errors due to fast but crude reciprocal sqrt approximation (about 2-3 times as long as a multiplication.. quite nice)
-cull errors due to shortcuts (distance to center instead of center and two corners.. the grid layout _should_ allow for this, but im no mathematician and together with approximations.. who knows)
solutions:
-first refinement step (doubles time for inv sqrt)
-no shortcuts (2 more inv sqrts)
so far i couldnt detect any errors, but i'll have to do tests with different heightmaps and some extremer landscapes.
i took a screenshot showing some numbers and another one giving details about occlusion
Numbers(33k)
Details(63k)
color codes for occluders:
no box: skipped for lack of height (<10% of max)
red: tested but didnt occlude (quite a lot due to using the lowest bbox point)
green: occluded alone
blue: neighbor of patch tested, didnt occlude
cyan: neighbor used, did help to occlude
occluded patches are colored green or cyan, depending on how they were culled.
i'll do some final adjustments (like avoiding those stupid redundant calculations) and do a new upload including source. so far i think it is extremely fast considering it doesnt need any precalculations. (average times: frustum culling: .2ms, occlusion culling: .2ms)
depending on your needs it might be heads on with the horizon approach. it takes more tests, but uses less memory and will cull a patch even if your close to it. as far as i understand you calculate only one horizon for a max distance and below this distance you cant cull. or you store values for different distances.
[edited by - Trienco on August 3, 2003 4:52:44 AM]
Normals and GL_TRIANGLE_STRIP
MARS_999:
I''m not using GL lighting in that. The lighting you see is a static lightmap calculated at loadtime.
Unfortunately I can''t implement anything more for now, my engine just broke and I have no idea why...
Death of one is a tragedy, death of a million is just a statistic.
I''m not using GL lighting in that. The lighting you see is a static lightmap calculated at loadtime.
Unfortunately I can''t implement anything more for now, my engine just broke and I have no idea why...
Death of one is a tragedy, death of a million is just a statistic.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement