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-09-30 02:01:32 +0400
committerMatt Ebb <matt@mke3.net>2009-09-30 02:01:32 +0400
commit71b3088596feb008e503be6430a30555aaffa586 (patch)
tree0c2e7fe3cb4cc46939cebd80f1027efd7eb3108e /source/blender/makesdna/DNA_material_types.h
parent98ee2a781dd20bb58f72ee5700a11b2dd5124d74 (diff)
Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through. Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use. There's more detailed information and example images here: http://wiki.blender.org/index.php/User:Broken/VolumeRendering Also did some tweaks/optimisation: * Removed shading step size (was a bit annoying, if it comes back, it will be in a different form) * Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...) * Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly * Enabled voxeldata texture in preview render * Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff) More revisions to come later...
Diffstat (limited to 'source/blender/makesdna/DNA_material_types.h')
-rw-r--r--source/blender/makesdna/DNA_material_types.h44
1 files changed, 17 insertions, 27 deletions
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index 55e3c9107e4..b3a7e74e91d 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -50,26 +50,23 @@ struct Ipo;
typedef struct VolumeSettings {
float density;
float emission;
- float absorption;
float scattering;
+ float reflection;
float emission_col[3];
- float absorption_col[3];
+ float transmission_col[3];
+ float reflection_col[3];
+
float density_scale;
float depth_cutoff;
-
- short phasefunc_type;
- short vpad[3];
- float phasefunc_g;
-
- float stepsize;
- float shade_stepsize;
+ float asymmetry;
short stepsize_type;
short shadeflag;
short shade_type;
short precache_resolution;
-
+
+ float stepsize;
float ms_diff;
float ms_intensity;
int ms_steps;
@@ -160,9 +157,8 @@ typedef struct Material {
float sss_front, sss_back;
short sss_flag, sss_preset;
- /* yafray: absorption color, dispersion parameters and material preset menu */
- float YF_ar, YF_ag, YF_ab, YF_dscale, YF_dpwr;
- int YF_dsmp, YF_preset, YF_djit;
+ int mapto_textured; /* render-time cache to optimise texture lookups */
+ int pad4;
ListBase gpumaterial; /* runtime */
} Material;
@@ -320,12 +316,14 @@ typedef struct Material {
#define MAP_LAYER 16384
/* volume mapto - reuse definitions for now - a bit naughty! */
-#define MAP_DENSITY 128
-#define MAP_EMISSION 64
-#define MAP_EMISSION_COL 1
-#define MAP_ABSORPTION 512
-#define MAP_ABSORPTION_COL 8
-#define MAP_SCATTERING 16
+#define MAP_DENSITY 128
+#define MAP_EMISSION 64
+#define MAP_EMISSION_COL 1
+#define MAP_SCATTERING 16
+#define MAP_TRANSMISSION_COL 8
+#define MAP_REFLECTION_COL 4
+#define MAP_REFLECTION 32
+
/* mapto for halo */
//#define MAP_HA_COL 1
@@ -386,13 +384,5 @@ typedef struct Material {
#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
-#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