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

A layered approach would use a series of massive alpha-textured quads arranged parallel to the ground, intersecting all intervening terrain geometry, to provide the illusion of ground fog quite effectively from high up, looking down, and somewhat less effectively when inside the fog and looking toward the horizon (see image below).

Alternatively, a primarily shader-based approach would instead calculate density as function of view distance into the ground fog substrate, and output the fragment value based on that.

Without having to performance-test each approach myself, I would like first to hear others' experiences (not speculation!) on what sort of performance impact the layered alpha texture approach is likely to have. I ask specifically due to the oft-cited impacts of overdraw (not sure how fill-rate bound your average desktop system is). A list of games using this approach, particularly older games, would be immensely useful: if this was viable on pre DX9/OpenGL2 hardware, it is likely to work fine for me.

One big question is in regards to this sort of effect:

enter image description here

(Image credit goes to Lume of lume.com)

Notice how the vertical fog gradation is continuous / smooth. OTOH, using textured quad layers, I can only assume that layers would be mighty obvious when walking through them -- the more sparse they were, the more obvious this would be. This is in contrast to where fog planes are aligned to face the player every frame, where this coarseness would be much less obvious.

share|improve this question
Why would you want to use alpha quad layers for this? The "shader-heavy approach" is not only more accurate, it's also not exactly known for being slow. – Nicol Bolas Nov 29 '12 at 18:55
1  
@StephanvandenHeuvel Sure, but that's view-space-aligned, distance-based fog. Not ground-aligned fog. Correct? – Nick Wiggill Nov 29 '12 at 22:25
1  
@NickWiggill Yeah you are correct. – Stephan van den Heuvel Nov 30 '12 at 2:57
1  
IIRC, the Wii had ground-aligned fog in its (semi-)fixed pipeline. Apparently the glFogCoord extension in legacy OpenGL allowed to do that as well. Although it sounds limited: it's either ground-based or distance-based. – Laurent Couvidou Nov 30 '12 at 9:58
1  
Quake 3 did something similar to this, using a fixed-pipeline approach that worked with GL1.1. The big concern I'd have is that fillrate/overdraw may pile up badly, but it's probably worth downloading the Q3 source code and reviewing their implementation; you may not do exactly the same but at least it may help you in making a decision. – mh01 Nov 30 '12 at 15:15
show 5 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.