• Advertisement

Archived

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

GAP BETWEEN TERRAIN & SKYBOX!

This topic is 6008 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 all! I am struggling with sometnig..I'll explain! In my flight sim engine I have 2048x2048 heightmap which is working fine. Obvoiusly I am not rendering the whole terrain at once! I render only a part of the heightmap ie. I have a small patch 128x128 which is extracted from the whole heightmap and render the patch in place where the camera is positioned so, the viewer is all the time in the middle of the terrain patch (all you can see is a huge skybox and a small 128x128 terrain patch somewhere in the middle (on Z,X axis)depending where the camera is). (the patch moves toghether with the camera) this works fine too but the probelem is that when I fly really high over the terrain then the patch obviously gets smaller and then I can see the edges of my 128x128 terrain patch and then a black gap between the rendered terrain patch and the skybox! I am trying to fill somehow the black gap but don't really know how! I tried to match the bottom of my front sky wall texture colour (light blue) with the glClearColor(0.75, 1.0, 1.0, 1.0); (clearing colour which is normally set to black as default) but its still not that what I want! I am just wonderring how do professional programmers do this in professional games that you can see a great distance (miles) in front of you when flying really high (eg. MIG-29 simulator)? I could do that but I would have to draw the whole terrain at once then I could fill the gaps but this means i would get 2 FPS haha!! Do they really draw the terrain that far or cheat with some tricky bitmaps?? Any idea? Any help will be really appreciated! Thanks !! Edited by - robert_s on September 8, 2001 8:25:37 PM

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Many games use skyboxes with terrain painted on to them. That way, as the viewer looks into the distance, they see mountains, but they aren''t rendered mountains, just part of the skybox. Another way to get detail a far way away, it to render your landscape in the distance, but at a lower resolution.

Share this post


Link to post
Share on other sites
Hi!
First of all you should create a real sky box. I mean you should draw all six box''s walls. It should be a small box which won''t move i.e. camera must always be in box''s center. And don''t forget to switch Z-buffering off while drawing the skybox so your terrain won''t overdraw the box.

In the majority of flysims they use distance fog to hide terrain patch edges.

And of course your engine must support terrain Level Of Detail so when you fly high you''ll see the hole terrain but consisting of 16 triangles

All the best!
P.S. I''m sorry for my terrible english.

Share this post


Link to post
Share on other sites
HI its Me again!
So, you guys suggest two ways!
1. painting some clouds at the bottom of the sky texture ie. Front, B, L, R
2. using fog around at the edges of my terrain patch to cover the gap. is that right?? (this probably will take a bit more CPU work?)
Any other Ideas???

You Antoxa also suggested to use LOD. I did not implemented it yet! Do u mean when you fly really high then I should reduce the number of rendered triangles (ie. terrain will become a bit more blocky) and when I am closer to the surface then I should increase the number of triangles (smoother surface)?? is that right?? why do u suggest to have 16 triangles not 18 or 20? is it a kind of rule or just an example? If you guys could explain a bit more about LOD I would be greatful!!
Thank you very much 4 ur replies!!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:

So, you guys suggest two ways!
1. painting some clouds at the bottom of the sky texture ie. Front, B, L, R



this is always a good idea, but has to be combined with fog to look nice.

quote:

2. using fog around at the edges of my terrain patch to cover the gap. is that right?? (this probably will take a bit more CPU work?)



Thats right, the fog is distance based (higher distance equals more fog) and doesn''t take any CPU power, since your 3D card will do the work in hardware.

quote:

You Antoxa also suggested to use LOD. I did not implemented it yet! Do u mean when you fly really high then I should reduce the number of rendered triangles (ie. terrain will become a bit more blocky) and when I am closer to the surface then I should increase the number of triangles (smoother surface)?? is that right?? why do u suggest to have 16 triangles not 18 or 20? is it a kind of rule or just an example? If you guys could explain a bit more about LOD I would be greatful!!



LOD is a must for a terrain engine. Your ideas above are quite right, the terrain will get blockier when you are farther away, but you won''t really notice, since the terrain details will nevertheless fade away in the distance (pixel resolution). The 16 triangle-thing was IMO an example, but it''s a power of 2, lots of advanced LOD algorithms (based on hierarchic quad trees) require the tesselation to be a power of 2. But be warned: LOD is not the easiest thing to implement and can be quite frustrating at the beginning. But there are lots of good tutorials about it, have a look at one of the best terrain sites out there: www.vterrain.org they have a section about LOD algorithms, with examples and source.

- AH

Share this post


Link to post
Share on other sites
Ok thanks guys 4 help!
I''ll have to do a search on LOD.
this site (www.vterrain.org)is really cool! woooouuuuw!!!
loads of meat there!!!!!

Share this post


Link to post
Share on other sites

  • Advertisement