[Bf-blender-cvs] [f89fbf5] master: Cycles: Fix T49952: Bad MIS sampling of backgrounds with single bright pixels

Lukas Stockner noreply at git.blender.org
Sun Nov 6 20:37:23 CET 2016


Commit: f89fbf580eae6202cef9da08756fd415ca34a8f3
Author: Lukas Stockner
Date:   Sun Nov 6 19:12:45 2016 +0100
Branches: master
https://developer.blender.org/rBf89fbf580eae6202cef9da08756fd415ca34a8f3

Cycles: Fix T49952: Bad MIS sampling of backgrounds with single bright pixels

With this fix, using a MIS map resolution equal to the image size for closest imterpolation or twice the size for linear interpolation gets rid of all fireflies.
Previously, a much higher resolution was needed to get acceptable noise levels.

===================================================================

M	intern/cycles/render/light.cpp

===================================================================

diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp
index 777f322..c43d646 100644
--- a/intern/cycles/render/light.cpp
+++ b/intern/cycles/render/light.cpp
@@ -43,8 +43,8 @@ static void shade_background_pixels(Device *device, DeviceScene *dscene, int res
 
 	for(int y = 0; y < height; y++) {
 		for(int x = 0; x < width; x++) {
-			float u = x/(float)width;
-			float v = y/(float)height;
+			float u = (x + 0.5f)/width;
+			float v = (y + 0.5f)/height;
 
 			uint4 in = make_uint4(__float_as_int(u), __float_as_int(v), 0, 0);
 			d_input_data[x + y*width] = in;




More information about the Bf-blender-cvs mailing list