diff options
author | Matt Ebb <matt@mke3.net> | 2008-10-04 16:23:57 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2008-10-04 16:23:57 +0400 |
commit | 67a9d4154d520a98e572e98f680995fca701f728 (patch) | |
tree | c548b56b75d3cc87a92fbea7738d1aaf534386fb /source/blender/makesdna/DNA_material_types.h | |
parent | e114d194ae44cb72aa52954f4fdeb67805a2c7c6 (diff) |
* New volumetrics feature: scattering types
Otherwise known as a phase function, this determines in which directions
the light is scattered in the volume. Until now it's been isotropic
scattering, meaning that the light gets scattered equally in all
directions. This adds some new types for anisotropic scattering, to
scatter light more forwards or backwards towards the viewing direction,
which can be more similar to how light is scattered by particles in nature.
Here's a diagram of how light is scattered isotropically and anisotropically:
http://mke3.net/blender/devel/rendering/volumetrics/phase_diagram.png
The new additions are:
- Rayleigh
describes scattering by very small particles in the atmosphere.
- Mie Hazy / Mie Murky
more generalised, describes scattering from large particle sizes.
- Henyey-Greenstein
a very flexible formula, that can be used to simulate a wide range of
scattering. It uses an additional 'Asymmetry' slider, ranging from -1.0
(backward scattering) to 1.0 (forward scattering) to control the
direction of scattering.
- Schlick
an approximation of Henyey-Greenstein, working similarly but faster.
And a description of how they look visually (just an omnidirectional lamp
inside a volume box)
http://mke3.net/blender/devel/rendering/volumetrics/phasefunctions.jpg
* Sun/sky integration
Volumes now correctly render in front of the new physical sky. Atmosphere
still doesn't work correctly with volumes, due to something that i hope
can be fixed in the atmosphere rendering, but the sky looks quite good.
http://mke3.net/blender/devel/rendering/volumetrics/sky_clouds.png
This also works very nicely with the anisotropic scattering, giving
clouds their signature bright halos when the sun is behind them:
http://mke3.net/blender/devel/rendering/volumetrics/phase_cloud.mov
in comparison here's a render with isotropic scattering:
http://mke3.net/blender/devel/rendering/volumetrics/phase_cloud_isotropic.png
* Added back the max volume depth tracing limit, as a hard coded value -
fixes crashes with weird geometry, like the overlapping faces around
suzanne's eyes. As a general note, it's always best to use volume
materials on airtight geometry, without intersecting or overlapping faces.
Diffstat (limited to 'source/blender/makesdna/DNA_material_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_material_types.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 8215f73d8ce..4e006d17682 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -71,7 +71,8 @@ typedef struct Material { float vol_absorption, vol_scattering; float vol_absorption_col[3]; short vol_shadeflag; - short volpad[3]; + short vol_phasefunc_type; + float vol_phasefunc_g; float fresnel_mir, fresnel_mir_i; float fresnel_tra, fresnel_tra_i; @@ -351,5 +352,13 @@ typedef struct Material { #define MA_VOL_ATTENUATED 2 #define MA_VOL_SHADOWED 4 +/* vol_phasefunc_type */ +#define MA_VOL_PH_ISOTROPIC 0 +#define MA_VOL_PH_MIEHAZY 1 +#define MA_VOL_PH_MIEMURKY 2 +#define MA_VOL_PH_RAYLEIGH 3 +#define MA_VOL_PH_HG 4 +#define MA_VOL_PH_SCHLICK 5 + #endif |