[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60853] trunk/blender/intern/cycles/render /buffers.cpp: Fix: ensure cycles mist pass stays in range 0..1, it could have values out of

Brecht Van Lommel brechtvanlommel at pandora.be
Sat Oct 19 01:44:26 CEST 2013


Revision: 60853
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60853
Author:   blendix
Date:     2013-10-18 23:44:25 +0000 (Fri, 18 Oct 2013)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/intern/cycles/render/buffers.cpp

Modified: trunk/blender/intern/cycles/render/buffers.cpp
===================================================================
--- trunk/blender/intern/cycles/render/buffers.cpp	2013-10-18 23:41:11 UTC (rev 60852)
+++ trunk/blender/intern/cycles/render/buffers.cpp	2013-10-18 23:44:25 UTC (rev 60853)
@@ -184,6 +184,12 @@
 					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;




More information about the Bf-blender-cvs mailing list