diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-10-19 03:44:25 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-10-19 03:44:25 +0400 |
commit | 4ecfb215e2af8ab824eb634915da2fc8ec54db98 (patch) | |
tree | 228072e2938cfc774d8da0a5b63f4dd11147b1c2 /intern/cycles/render/buffers.cpp | |
parent | 3887d333744e1a0c3b42b8a229af814e0b25d9ec (diff) |
Fix: ensure cycles mist pass stays in range 0..1, it could have values out of
this range due to sampling noise.
Side note: I looked into the mist pass because it was apparently not calculating
mist correctly on characters with transparent hair. Turns out this is just
sampling noise that goes away with more samples.
This noise is because the ray will randomly go to the next transparency layer or
get reflected, the path tracing integrator will not branch the path and only pick
one of the two directions each time.
Branched path tracing however will shade all transparent layers for each AA
sample, which means this source of noise is eliminated.
Diffstat (limited to 'intern/cycles/render/buffers.cpp')
-rw-r--r-- | intern/cycles/render/buffers.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp index 5fb648cec5f..44a050ca530 100644 --- a/intern/cycles/render/buffers.cpp +++ b/intern/cycles/render/buffers.cpp @@ -184,6 +184,12 @@ bool RenderBuffers::get_pass_rect(PassType type, float exposure, int sample, int pixels[0] = (f == 0.0f)? 1e10f: f*scale_exposure; } } + else if(type == PASS_MIST) { + for(int i = 0; i < size; i++, in += pass_stride, pixels++) { + float f = *in; + pixels[0] = clamp(f*scale_exposure, 0.0f, 1.0f); + } + } else { for(int i = 0; i < size; i++, in += pass_stride, pixels++) { float f = *in; |