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>2012-03-28 16:18:12 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-03-28 16:18:12 +0400
commite12adeb8c98d0ef211aba2cb5c0e87ff775fe217 (patch)
tree3a4381971596645f55401490e19a3672b28745ec /intern/cycles/render/film.cpp
parented61bfc9a6580360805a3daae1003df43a7f2c11 (diff)
Fix #30551: cycles passes combining did not always give identical result combined
with antialiasing/defocus, now divide out color at the very end instead of for each sample.
Diffstat (limited to 'intern/cycles/render/film.cpp')
-rw-r--r--intern/cycles/render/film.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/intern/cycles/render/film.cpp b/intern/cycles/render/film.cpp
index 5fd98e20240..ed4d0b2dcde 100644
--- a/intern/cycles/render/film.cpp
+++ b/intern/cycles/render/film.cpp
@@ -38,11 +38,16 @@ static bool compare_pass_order(const Pass& a, const Pass& b)
void Pass::add(PassType type, vector<Pass>& passes)
{
+ foreach(Pass& existing_pass, passes)
+ if(existing_pass.type == type)
+ return;
+
Pass pass;
pass.type = type;
pass.filter = true;
pass.exposure = false;
+ pass.divide_type = PASS_NONE;
switch(type) {
case PASS_NONE:
@@ -82,26 +87,32 @@ void Pass::add(PassType type, vector<Pass>& passes)
case PASS_DIFFUSE_INDIRECT:
pass.components = 4;
pass.exposure = true;
+ pass.divide_type = PASS_DIFFUSE_COLOR;
break;
case PASS_GLOSSY_INDIRECT:
pass.components = 4;
pass.exposure = true;
+ pass.divide_type = PASS_GLOSSY_COLOR;
break;
case PASS_TRANSMISSION_INDIRECT:
pass.components = 4;
pass.exposure = true;
+ pass.divide_type = PASS_TRANSMISSION_COLOR;
break;
case PASS_DIFFUSE_DIRECT:
pass.components = 4;
pass.exposure = true;
+ pass.divide_type = PASS_DIFFUSE_COLOR;
break;
case PASS_GLOSSY_DIRECT:
pass.components = 4;
pass.exposure = true;
+ pass.divide_type = PASS_GLOSSY_COLOR;
break;
case PASS_TRANSMISSION_DIRECT:
pass.components = 4;
pass.exposure = true;
+ pass.divide_type = PASS_TRANSMISSION_COLOR;
break;
case PASS_EMISSION:
@@ -127,6 +138,9 @@ void Pass::add(PassType type, vector<Pass>& passes)
/* order from by components, to ensure alignment so passes with size 4
come first and then passes with size 1 */
sort(passes.begin(), passes.end(), compare_pass_order);
+
+ if(pass.divide_type != PASS_NONE)
+ Pass::add(pass.divide_type, passes);
}
bool Pass::equals(const vector<Pass>& A, const vector<Pass>& B)