Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for some ideas/algorithm name for alternative to distance fog.

I'm playing around an "infinite" terrain engine. I can't draw the whole map because there are no borders and I don't like the idea of hiding the terrain at a distance with fog.

share|improve this question
Note that distance fog isn't fog of war. "Fog of war" isn't really a literal fog (although games often depict it that way); it is a metaphor for lacking knowledge about certain areas of the battlefield. – jhocking Jun 14 '11 at 1:41
I removed the question references to FOW since it was distracting. – Tetrad Jun 14 '11 at 2:32
Thanks for the change! – the_lotus Jun 14 '11 at 14:18
up vote 10 down vote accepted

A standard approach to this is to use Level of Detail algorithms to draw less-detailed versions of far-off terrain. These lower-detail versions can either be pre-generated, or may be generated on the fly, if you have dynamically changing terrain. (But in almost all cases, you want to pre-generate these terrain LODs, as that's dramatically simpler)

A good starting point for researching different methods of implementing terrain level of detail can be found at

share|improve this answer
This is a good answer but I don't at all se how it answers the question... – Jonathan Connell Jun 14 '11 at 14:27
I perhaps wasn't explicit enough. The idea is that by using level of detail, you actually can afford to draw an (effectively) infinite terrain without using fog, because the far-off bits of terrain are rendered using far fewer triangles than they do when close to the camera. – Trevor Powell Jun 14 '11 at 23:01
I understand, but you can't really draw an imfinite terrain because even with LOD, you don't have the memory or the power to draw your terrain. Any high-up mountains will still have to be drawn until their representation on screen is less than one pixel. This would also produce horrible artefacts if you try to render more than one triangle to one pixel, as one would arbitrarily 'win' and colour the pixel. Fog is just an easy way to reproduce a natural effect, because things 'blur' when they are too far away. – Jonathan Connell Jun 15 '11 at 7:43
LOD algorithms are designed to avoid precisely the problems you mentioned -- solving those problems are really their only purpose. Please do explore the link I provided; some of the research in this area has been quite interesting and exciting. – Trevor Powell Jun 15 '11 at 22:34
But yes, if you take "infinite" in its literal meaning, then the whole question is meaningless because no computer can cope with a literally infinite amount of world geometry, regardless of whether or not you are rendering with fog. Can we agree that in this context, "infinite" actually is intended to mean "absurdly large but still technically finite"? Because otherwise we have nothing useful to talk about. – Trevor Powell Jun 15 '11 at 22:45

As jhocking said in the comment, FOW is unknown areas.

Computers can't draw infinite terrain. The lag would be incredible. Fog is used to blend in the edge of the render distance, which doesn't need to be close to the camera, nor does there need to be a large blend range.

You sound like you are thinking of a very short view range. Increasing your view range to a large number (this is set in your projection matrix), and sticking fog at the end, makes it seem like an endlessly shown terrain. And the fog isn't really that noticable.

However if you still want a precise answer to your question,

Weather, such as rain, snow, wind, etc. can help obscure the out of range area.

Terrain which reaches the clouds... Having mountains in your terrain, then having clouds at the top of the world, means that in the distance, you will find the edge of the world hidden by mountains, (or if your high up, clouds).

Finally, if your really desperate you could stick a curve onto your world, so that it appears that things in the difference are disappearing over the horizon.

However i still suggest you use fog, as it is simply a blending for the out of range area.

share|improve this answer
Infinitely drawn terrain? Lag? Terrible? It wouldn't ever finish drawing. :P – dcousens Jun 14 '11 at 3:58
The title was slightly confusing, but his question wasn't that long, read it! You are suggesting exactly what he is trying to avoid doing. And what do you mean by "Computers can't infinitely draw terrain"? – AttackingHobo Jun 14 '11 at 5:38
No, what i am suggesting is that he rethinks his question, however i did suggest some answers to his problem. And, no, i didn't suggest infinitely drawing the terrain in there at all. And sorry, i meant computers can't draw infinitely large terrain. Edits the answer – Randomman159 Jun 14 '11 at 12:36

In addition to terrain LOD, you can render distant game objects and other things like buildings and vehicles using impostors. A good example/visualization of this technique can be seen here:

Cloud Impostors

The idea being that you render distant objects once into a texture, then, as long as your viewpoint doesn't change dramatically, or the object itself doesn't change you can continue to render the texture for very little cost.

share|improve this answer

Maybe you could draw your terrain with a spherical bend to it like on real planets :) The clipping would be hidden naturally as you wouldn't have to draw anything that is hidden by the terrain you're on.

Of course, you wouldn't want (or be able) to infinately draw terrain anyway, as your objects will be too small to be correctly drawn on screen (less than 1 pixel) and it will aliaze like mad.

Your terrain will also never be infinate as you have finite resources (VRAM, RAM, HDD) on your computer. I am therefore guessing it is a terrain generator, that generated terrain randomly in front of you.

In this case you get nasty artefacts when geomety starts 'popping-up' out of your far plane. If your far plane is 'far' enough, only objects of certain height will noticabely 'pop' out of the plane. In this case you could maybe pre-calculate the large objects and always draw them, sclaed dependant on the distance from the far plane.

Or you could just use fog.

share|improve this answer
+1 for the final sentence. – kaoD Jun 15 '11 at 6:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.