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@gmail.com>2014-02-06 18:18:34 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-02-06 18:24:15 +0400
commita41648c1dc58fcfdb149bf6839ae237d1dadc704 (patch)
tree25fed9ed0a9d5e3f2dcfe60074e7ae3be19914ba /intern/cycles/render/film.cpp
parent5cbddd4ca47b4b2b45ae7284129db5b83d1a948c (diff)
Cycles: add pass alpha threshold value to render layers.
Z, Index, normal, UV and vector passes are only affected by surfaces with alpha transparency equal to or higher than this threshold. With value 0.0 the first surface hit will always write to these passes, regardless of transparency. With higher values surfaces that are mostly transparent can be skipped until an opaque surface is encountered.
Diffstat (limited to 'intern/cycles/render/film.cpp')
-rw-r--r--intern/cycles/render/film.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/intern/cycles/render/film.cpp b/intern/cycles/render/film.cpp
index f97417b5251..23a70303557 100644
--- a/intern/cycles/render/film.cpp
+++ b/intern/cycles/render/film.cpp
@@ -261,6 +261,7 @@ Film::Film()
{
exposure = 0.8f;
Pass::add(PASS_COMBINED, passes);
+ pass_alpha_threshold = 0.5f;
filter_type = FILTER_BOX;
filter_width = 1.0f;
@@ -399,6 +400,7 @@ void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene)
}
kfilm->pass_stride = align_up(kfilm->pass_stride, 4);
+ kfilm->pass_alpha_threshold = pass_alpha_threshold;
/* update filter table */
vector<float> table = filter_table(filter_type, filter_width);
@@ -425,8 +427,12 @@ bool Film::modified(const Film& film)
{
return !(exposure == film.exposure
&& Pass::equals(passes, film.passes)
+ && pass_alpha_threshold == film.pass_alpha_threshold
&& filter_type == film.filter_type
- && filter_width == film.filter_width);
+ && filter_width == film.filter_width
+ && mist_start == film.mist_start
+ && mist_depth == film.mist_depth
+ && mist_falloff == film.mist_falloff);
}
void Film::tag_passes_update(Scene *scene, const vector<Pass>& passes_)