terrain scale

Started by
12 comments, last by budipro 20 years, 8 months ago
Hi all, I''m doing my terrain engine right now. I have 4000x6400 heightmap with each heightmap point is at 30 arc-second distance. What scale should I use to render the terrain? Right now I''m using 1 vertex coordinate as 8 meters. But I think the visualized terrain is not big enough. If I increase the scale, then I must increase the far frustum plane, too. Thanks a lot.
Advertisement
quote:Original post by budipro
each heightmap point is at 30 arc-second distance.


What the heck is an arc-second?

it's a measurement unit for angles: a circle has 360 degrees, and each degree is divided into smaller parts. I'm not sure, but guessing 1 degree = 60 arc minutes which are subdivided into 1 arc minute = 60 arc seconds

you can use this for making the distances if you're on a sphere (world), just multiply with the radius of the sphere (since the angles are small, simple multiplication is fine)

[edited by - rick_appleton on August 18, 2003 11:03:57 PM]
Instead of increasing the scale of the terrain you can decrease the scale of the other objects. Place your camera closer to the terrain. Cut all moving speeds in half and decrease the size of your objects.

Meters don''t exits in 3D apps. 8 meters can be 8 units but also 4 units, 2 units, 1 unit, whatever.

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>

It can be a good idea to keep 1 unit = 1 m for physics or overall handling of space. Otherwise, your calculations might need some adjustments and that is pretty unnecessary.
True, but then you need to push the far clipplane away as well (if you want to keep the horizon at the same place).

At the OP: If your near clipplane is at 1.0f or above, you can easily push to far plane up to 1000.0f without getting z-buffer articacts.

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>

Thanks a lot for all your replies.

quote:
Meters don''t exits in 3D apps. 8 meters can be 8 units but also 4 units, 2 units, 1 unit, whatever.


Yes, I understand that. Sorry for not making this clear. In my application, 1 unit is 8 m.

quote:
At the OP: If your near clipplane is at 1.0f or above, you can easily push to far plane up to 1000.0f without getting z-buffer articacts.


What is OP? My near clipplane is at 1.0f and my far clipplane is at 200000.0f. And I do have some z-buffer artifacts.
So, is the ideal far clipping plane 1000.0f?
If it is, then I should scale my terrain smaller, 1 unit for 100 meters maybe?
OP means Original Poster. That''s the person who started the thread (you).

About the clipplanes: 1000.0f is not the ideal far clipplane position. It really depends on what you are rendering. If you use vertices that have very small differences in position (like 0.001f etcetera) that you would be better of with a clipplane at say 100.0f. If you use very course data then you can push the plane further away. But anyway, your 200000.0f is certainly too far away.

The depth resolution is set up in a logarithmic way. That means that it will use more bits of depth at positions that are close by and less for things near the far clipplane (that''s why setting the near plane below 1.0f is a bad idea. log scale increases very fast below 1.0f). You say that you use 1 unit = 8 meters. Because you only have 8 bits of depth your game cannot tell the difference in z value apart near the far clipplane. rendered at 200000.0f in the distance and another one rendered at 199992.0f will get the same z-value in the depth buffer. Probabely 199000.0f as well. So you get z-fighting and z-artifacts.

Using 1 unit to 100 meters sounds like a better idea. Don''t forget to adjust the position of the camera as well! It needs to be 100/8 times closer to the terrain. Your movement speed should also be 100/8 times slower. And bring your far clipplane in to about 1000 or 2000.

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>

But havent you guys downloaded terrain demos where the scale seemed TOO SMALL even when you panned around the entire heightmap.

My point? Well, it seems that the scale of your world is dependant on your point of view, or maybe more directly the FOV.

If your in first-person view, it just seems very odd if the camera is hugging the terrain very low but also seems like the view is too large for the viewpoint. Maybe its just me. I hope someone else understands what Im trying to say and maybe has some scale ideas to relate...

- John
If you want a realistic rendering of terrain, you should calculate the scale factor using the diameter of the planetary body for which you have the heightmap. Assuming you have a 30 arc second grid spacing, and the data is for the Earth, that gives you a grid spacing of 295 meters, unless I''ve calculated it wrong.

I suspect I misunderstood your description of your heightmap data, though, because a resolution of 295 meters sounds quite low for a terrain renderer.

This topic is closed to new replies.

Advertisement