Terrain GMM and lod....

Started by
5 comments, last by ReType 20 years, 10 months ago
Hi! I try to implement geomipmaps for terrain, i have succesfuly created lod patches, but now i don''t know how to choose the best lod level for a given patch... i can''t understand how to compute d2 and stuff corect, any sugestions? Thanks!
Advertisement
Go to the Geomipmaps tutorial on flipcode by Willem H. de Boer. It will tell you how to calculate the screen error for a given lod. Then, if the screen error is too high, switch to a better lod.

Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]


GSACP: GameDev Society Against Crap Posting
To join: Put these lines in your signature and don''t post crap!

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

Yes, i have read again the paper, and implement exact how it''s it inside, BUT i see the lod switch and there is no vertex poping... i have loose something?
I''ve implemented this as well.
And I get virtually no vertex popping at all even though I don''t use vertex morphing. So I guess you are doing something wrong.

Cheers,
First off, popping is very dependant on your settings. You should have a #define MAX_SCREEN_ERROR somewhere, which is the error threshhold at which a LOD switch occurs. If you set this to 1 you wont see any popping. If you set it to 2 or 3 you will probabely won''t see it eighter if you have a high vertical display resolution (the pop will simply be too small to notice).

There are a few other ways to do it though. One method is described in the Chuncked LOD paper. Another one is to get you math & trig book out:
          A         /|        / |       /  |   Eye ---X--- forward       \  |        \ |         \|          B 

Say, you have a 90 degree vertical FOV and a vertical resolution of 600 pixels. (the asci pic shows a greater FOV but that''s because slashes only come in 60 degrees ). With a 90 degree FOV, the distance from Eye to X is the same as from A to B IN UNITS, NOT PIXELS. (not sure how to do this for other FOV''s though. Anyone around here know trig well?).

So, given a certain Eye-X distance, one unit of vertical displacement will take up 600/(distance Eye-X) pixels. So given a height displacement E (your max error when switching LOD), it will take up:

E * (600/distance) pixels

Given a MAX_SCREEN_ERROR, you can calculate the distance at which a LOD switch should happen with:

(E * 600) / MAX_SCREEN_ERROR = distance

You precalculate these distances for every LOD. At runtime you calculate the distance from the camera to the terrain patch. If it is greater than the distance from the above calculation, you can switch to a lower LOD.

Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]


GSACP: GameDev Society Against Crap Posting
To join: Put these lines in your signature and don''t post crap!

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

YES, That''s it! Thanks smarechal for your time!

Another question, i have the heightmap 1024x1024, one texture, the far camera plane is really far and cover all terrain, and i''m getting 150-300 fps... is a good fps for that?
I can''t really say without a screenshot and some system specs but 150-300 is pretty fast! That''s only 5 milliseconds per frame. You can go up to 20-25 without noticing any decrease in framerate.

Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]


GSACP: GameDev Society Against Crap Posting
To join: Put these lines in your signature and don''t post crap!

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

This topic is closed to new replies.

Advertisement