Crytek Fog Volume

Started by
3 comments, last by InvalidPointer 13 years, 12 months ago
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]
Advertisement
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?

Previously "Krohm"

Quote:Original post by Krohm
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.


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).

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?

Quote:Original post by phresnel
Quote:Original post by Krohm
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.


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 :)
clb: At the end of 2012, the positions of jupiter, saturn, mercury, and deimos are aligned so as to cause a denormalized flush-to-zero bug when computing earth's gravitational force, slinging it to the sun.

This topic is closed to new replies.

Advertisement