Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2009-01-26 05:42:17 +0300
committerMatt Ebb <matt@mke3.net>2009-01-26 05:42:17 +0300
commit1ed26fffb88ffcf70aa62c65964cc98348712b9d (patch)
tree30c858e298e90d0d2de680c06fdab3fda85c223a /source/blender/makesdna/DNA_material_types.h
parent6cfbb0017a525262f55767bf3b560ba3ae2e8d42 (diff)
Volume rendering: multiple scattering
This is mostly a contribution from Raul 'farsthary' Hernandez - an approximation for multiple scattering within volumes. Thanks, Raul! Where single scattering considers the path from the light to a point in the volume, and to the eye, multiple scattering approximates the interactions of light as it bounces around randomly within the volume, before eventually reaching the eye. It works as a diffusion process that effectively blurs the lighting information that's already stored within the light cache. A cloudy sky setup, with single scattering, and multiple scattering: http://mke3.net/blender/devel/rendering/volumetrics/vol_sky_ss_ms.jpg http://mke3.net/blender/devel/rendering/volumetrics/sky_ms.blend To enable it, there is a menu in the volume panel (which needs a bit of cleanup, for later), that lets you choose between self-shading methods: * None: No attenuation of the light source by the volume - light passes straight through at full strength * Single Scattering: (same as previously, with 'self-shading' enabled) * Multiple Scattering: Uses multiple scattering only for shading information * Single + Multiple: Adds the multiple scattering lighting on top of the existing single scattered light - this can be useful to tweak the strength of the effect, while still retaining details in the lighting. An example of how the different scattering methods affect the visual result: http://mke3.net/blender/devel/rendering/volumetrics/ss_ms_comparison.jpg http://mke3.net/blender/devel/rendering/volumetrics/ss_ms_comparison.blend The multiple scattering methods introduce 3 new controls when enabled: * Blur: A factor blending between fully diffuse/blurred lighting, and sharper * Spread: The range that the diffuse blurred lighting spreads over - similar to a blur width. The higher the spread, the slower the processing time. * Intensity: A multiplier for the multiple scattering light brightness Here's the effect of multiple scattering on a tight beam (similar to a laser). The effect of the 'spread' value is pretty clear here: http://mke3.net/blender/devel/rendering/volumetrics/ms_spread_laser.jpg Unlike the rest of the system so far, this part of the volume rendering engine isn't physically based, and currently it's not unusual to get non-physical results (i.e. much more light being scattered out then goes in via lamps or emit). To counter this, you can use the intensity slider to tweak the brightness - on the todo, perhaps there is a more automatic method we can work on for this later on. I'd also like to check on speeding this up further with threading too.
Diffstat (limited to 'source/blender/makesdna/DNA_material_types.h')
-rw-r--r--source/blender/makesdna/DNA_material_types.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index 5172f6a970c..dafa816cb96 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -70,13 +70,18 @@ typedef struct Material {
short vol_precache_resolution;
float vol_stepsize, vol_shade_stepsize;
float vol_depth_cutoff;
- float vpad;
+ short vol_shade_type;
+ short vpad;
float vol_density_scale;
float vol_absorption, vol_scattering;
float vol_absorption_col[3];
short vol_shadeflag;
short vol_phasefunc_type;
float vol_phasefunc_g;
+ float vpad2;
+
+ float vol_ms_diff, vol_ms_intensity;
+ int vol_ms_steps;
float fresnel_mir, fresnel_mir_i;
float fresnel_tra, fresnel_tra_i;
@@ -358,11 +363,16 @@ typedef struct Material {
/* vol_shadeflag */
#define MA_VOL_SHADED 1
-#define MA_VOL_ATTENUATED 2
#define MA_VOL_RECVSHADOW 4
#define MA_VOL_PRECACHESHADING 8
#define MA_VOL_USEALPHA 16
+/* vol_shading_type */
+#define MA_VOL_SHADE_NONE 0
+#define MA_VOL_SHADE_SINGLE 1
+#define MA_VOL_SHADE_MULTIPLE 2
+#define MA_VOL_SHADE_SINGLEPLUSMULTIPLE 3
+
/* vol_phasefunc_type */
#define MA_VOL_PH_ISOTROPIC 0
#define MA_VOL_PH_MIEHAZY 1