Archived

This topic is now archived and is closed to further replies.

Terrain GMM and lod....

This topic is 5303 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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,

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites