# Crytek Fog Volume

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

## Recommended Posts

Has anybody successfully implemented Fog Volumes the Crysis way. In object space everything is working nicely. But when I move fog box in world space it gets clipped away, because fog calculated information is still in object space. This is shader code from shaders.pak of Crysis, fogvolume.cfx. [ Removed copyrighted material. --Sneftel ] Any ideas... [Edited by - Sneftel on April 23, 2010 4:56:23 PM]

##### Share on other sites
I only read some presentations on their fog volume approach and I currently don't quite understand their algorithm.
With two supported primitives, box and ellipsoid, I don't quite understand why do they need a raytracer. They could just solve the quadratic/box equation... they probably need a raytracer as they need gradient fog but I had some not-so-fun with quadratics in past and I cannot quite understand why they are working on normal spheres and boxes...
The main issue was in transforming quadratic's domain correctly wrt world space.
POM is likely a resource/algorithm you can somehow adapt to procedurally build the whole thing, alternatively, you can have some basic quadratic support natively in your shaders (although that probably isn't quite as scalable as you'd like to).

By the way, do you have some additional links on the topic to share?

##### Share on other sites
Quote:
 Original post by KrohmI only read some presentations on their fog volume approach and I currently don't quite understand their algorithm.With two supported primitives, box and ellipsoid, I don't quite understand why do they need a raytracer.

Only a wild guess (having looked at the power point file), but maybe they need it for scattered light (i.e. crepiscular rays and the like).

##### Share on other sites
Quick question : With the integrals in those equations, obviously they cant do the equation an infinite amount of times over the integral, so do they just take a number of predefined samples?

So when they have some integral over the hemisphere, do they just take a number of sample points like below? are they clustered? or what?

##### Share on other sites
Quote:
Original post by phresnel
Quote:
 Original post by KrohmI only read some presentations on their fog volume approach and I currently don't quite understand their algorithm.With two supported primitives, box and ellipsoid, I don't quite understand why do they need a raytracer.

Only a wild guess (having looked at the power point file), but maybe they need it for scattered light (i.e. crepiscular rays and the like).

I wish! While their crepuscular ray technique looks nice, it's really a horrendous hack. Think 'radial blur of (1-scene depth)' bad :)

1. 1
Rutin
19
2. 2
3. 3
JoeJ
16
4. 4
5. 5

• 26
• 20
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631700
• Total Posts
3001781
×