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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-06-07 16:45:26 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-06-07 16:45:26 +0400
commita604fb730dd62a2730a3a753adc057abb93296cb (patch)
treeba8733ea17c330407455404abbbc64717cc78f63 /intern/cycles/render/film.cpp
parentddee696bc76481846673f613344d85310ecf0524 (diff)
Cycles: mist pass added, with start/depth/falloff control. If the pass is
enabled in a render layer a Mist Pass panel will be shown in the world properties.
Diffstat (limited to 'intern/cycles/render/film.cpp')
-rw-r--r--intern/cycles/render/film.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/intern/cycles/render/film.cpp b/intern/cycles/render/film.cpp
index 50b7534f7a0..1fe30376adc 100644
--- a/intern/cycles/render/film.cpp
+++ b/intern/cycles/render/film.cpp
@@ -65,6 +65,9 @@ void Pass::add(PassType type, vector<Pass>& passes)
pass.components = 1;
pass.filter = false;
break;
+ case PASS_MIST:
+ pass.components = 1;
+ break;
case PASS_NORMAL:
pass.components = 4;
break;
@@ -252,6 +255,10 @@ Film::Film()
filter_width = 1.0f;
filter_table_offset = TABLE_OFFSET_INVALID;
+ mist_start = 0.0f;
+ mist_depth = 100.0f;
+ mist_falloff = 1.0f;
+
need_update = true;
}
@@ -284,6 +291,10 @@ void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene)
case PASS_DEPTH:
kfilm->pass_depth = kfilm->pass_stride;
break;
+ case PASS_MIST:
+ kfilm->pass_mist = kfilm->pass_stride;
+ kfilm->use_light_pass = 1;
+ break;
case PASS_NORMAL:
kfilm->pass_normal = kfilm->pass_stride;
break;
@@ -366,6 +377,11 @@ void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene)
filter_table_offset = scene->lookup_tables->add_table(dscene, table);
kfilm->filter_table_offset = (int)filter_table_offset;
+ /* mist pass parameters */
+ kfilm->mist_start = mist_start;
+ kfilm->mist_inv_depth = (mist_depth > 0.0f)? 1.0f/mist_depth: 0.0f;
+ kfilm->mist_falloff = mist_falloff;
+
need_update = false;
}