[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52929] trunk/blender/intern/cycles/kernel /closure: Cycles: disable scaling up of ray differentials after diffuse/ glossy bounce, this

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Dec 12 15:43:08 CET 2012


Revision: 52929
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52929
Author:   blendix
Date:     2012-12-12 14:43:07 +0000 (Wed, 12 Dec 2012)
Log Message:
-----------
Cycles: disable scaling up of ray differentials after diffuse/glossy bounce, this
isn't working well for OSL texture filtering and wasn't very helpful to begin
with, a better solution should be possible.

Modified Paths:
--------------
    trunk/blender/intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h
    trunk/blender/intern/cycles/kernel/closure/bsdf_diffuse.h
    trunk/blender/intern/cycles/kernel/closure/bsdf_microfacet.h
    trunk/blender/intern/cycles/kernel/closure/bsdf_oren_nayar.h
    trunk/blender/intern/cycles/kernel/closure/bsdf_phong_ramp.h
    trunk/blender/intern/cycles/kernel/closure/bsdf_ward.h
    trunk/blender/intern/cycles/kernel/closure/bsdf_westin.h

Modified: trunk/blender/intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h
===================================================================
--- trunk/blender/intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h	2012-12-12 14:34:21 UTC (rev 52928)
+++ trunk/blender/intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h	2012-12-12 14:43:07 UTC (rev 52929)
@@ -134,8 +134,6 @@
 			// TODO: find a better approximation for the retroreflective bounce
 			*domega_in_dx = (2 * dot(N, dIdx)) * N - dIdx;
 			*domega_in_dy = (2 * dot(N, dIdy)) * N - dIdy;
-			*domega_in_dx *= 125.0f;
-			*domega_in_dy *= 125.0f;
 #endif
 		}
 		else

Modified: trunk/blender/intern/cycles/kernel/closure/bsdf_diffuse.h
===================================================================
--- trunk/blender/intern/cycles/kernel/closure/bsdf_diffuse.h	2012-12-12 14:34:21 UTC (rev 52928)
+++ trunk/blender/intern/cycles/kernel/closure/bsdf_diffuse.h	2012-12-12 14:43:07 UTC (rev 52929)
@@ -74,8 +74,6 @@
 		// TODO: find a better approximation for the diffuse bounce
 		*domega_in_dx = (2 * dot(N, dIdx)) * N - dIdx;
 		*domega_in_dy = (2 * dot(N, dIdy)) * N - dIdy;
-		*domega_in_dx *= 125.0f;
-		*domega_in_dy *= 125.0f;
 #endif
 	}
 	else
@@ -126,10 +124,8 @@
 		*eval = make_float3(*pdf, *pdf, *pdf);
 #ifdef __RAY_DIFFERENTIALS__
 		// TODO: find a better approximation for the diffuse bounce
-		*domega_in_dx = (2 * dot(N, dIdx)) * N - dIdx;
-		*domega_in_dy = (2 * dot(N, dIdy)) * N - dIdy;
-		*domega_in_dx *= -125.0f;
-		*domega_in_dy *= -125.0f;
+		*domega_in_dx = -((2 * dot(N, dIdx)) * N - dIdx);
+		*domega_in_dy = -((2 * dot(N, dIdy)) * N - dIdy);
 #endif
 	}
 	else {

Modified: trunk/blender/intern/cycles/kernel/closure/bsdf_microfacet.h
===================================================================
--- trunk/blender/intern/cycles/kernel/closure/bsdf_microfacet.h	2012-12-12 14:34:21 UTC (rev 52928)
+++ trunk/blender/intern/cycles/kernel/closure/bsdf_microfacet.h	2012-12-12 14:43:07 UTC (rev 52929)
@@ -199,12 +199,6 @@
 #ifdef __RAY_DIFFERENTIALS__
 					*domega_in_dx = (2 * dot(m, dIdx)) * m - dIdx;
 					*domega_in_dy = (2 * dot(m, dIdy)) * m - dIdy;
-					// Since there is some blur to this reflection, make the
-					// derivatives a bit bigger. In theory this varies with the
-					// roughness but the exact relationship is complex and
-					// requires more ops than are practical.
-					*domega_in_dx *= 10.0f;
-					*domega_in_dy *= 10.0f;
 #endif
 				}
 			}
@@ -251,14 +245,6 @@
 				// eq. 38 and eq. 17
 				*pdf = pm * (m_eta * m_eta) * fabsf(cosHI) / Ht2;
 				*eval = make_float3(out, out, out);
-#ifdef __RAY_DIFFERENTIALS__
-				// Since there is some blur to this refraction, make the
-				// derivatives a bit bigger. In theory this varies with the
-				// roughness but the exact relationship is complex and
-				// requires more ops than are practical.
-				*domega_in_dx *= 10.0f;
-				*domega_in_dy *= 10.0f;
-#endif
 			}
 		}
 	}
@@ -430,12 +416,6 @@
 #ifdef __RAY_DIFFERENTIALS__
 					*domega_in_dx = (2 * dot(m, dIdx)) * m - dIdx;
 					*domega_in_dy = (2 * dot(m, dIdy)) * m - dIdy;
-					// Since there is some blur to this reflection, make the
-					// derivatives a bit bigger. In theory this varies with the
-					// roughness but the exact relationship is complex and
-					// requires more ops than are practical.
-					*domega_in_dx *= 10.0f;
-					*domega_in_dy *= 10.0f;
 #endif
 				}
 			}
@@ -486,14 +466,6 @@
 				// eq. 38 and eq. 17
 				*pdf = pm * (m_eta * m_eta) * fabsf(cosHI) / Ht2;
 				*eval = make_float3(out, out, out);
-#ifdef __RAY_DIFFERENTIALS__
-				// Since there is some blur to this refraction, make the
-				// derivatives a bit bigger. In theory this varies with the
-				// roughness but the exact relationship is complex and
-				// requires more ops than are practical.
-				*domega_in_dx *= 10.0f;
-				*domega_in_dy *= 10.0f;
-#endif
 			}
 		}
 	}

Modified: trunk/blender/intern/cycles/kernel/closure/bsdf_oren_nayar.h
===================================================================
--- trunk/blender/intern/cycles/kernel/closure/bsdf_oren_nayar.h	2012-12-12 14:34:21 UTC (rev 52928)
+++ trunk/blender/intern/cycles/kernel/closure/bsdf_oren_nayar.h	2012-12-12 14:43:07 UTC (rev 52929)
@@ -81,8 +81,6 @@
 		// TODO: find a better approximation for the bounce
 		*domega_in_dx = (2.0f * dot(sc->N, dIdx)) * sc->N - dIdx;
 		*domega_in_dy = (2.0f * dot(sc->N, dIdy)) * sc->N - dIdy;
-		*domega_in_dx *= 125.0f;
-		*domega_in_dy *= 125.0f;
 #endif
 	}
 	else {

Modified: trunk/blender/intern/cycles/kernel/closure/bsdf_phong_ramp.h
===================================================================
--- trunk/blender/intern/cycles/kernel/closure/bsdf_phong_ramp.h	2012-12-12 14:34:21 UTC (rev 52928)
+++ trunk/blender/intern/cycles/kernel/closure/bsdf_phong_ramp.h	2012-12-12 14:43:07 UTC (rev 52929)
@@ -119,15 +119,6 @@
 				*pdf = (m_exponent + 1) * common;
 				float out = cosNI * (m_exponent + 2) * common;
 				*eval = bsdf_phong_ramp_get_color(sc, colors, cosp) * out;
-				
-#ifdef __RAY_DIFFERENTIALS__
-				// Since there is some blur to this reflection, make the
-				// derivatives a bit bigger. In theory this varies with the
-				// exponent but the exact relationship is complex and
-				// requires more ops than are practical.
-				*domega_in_dx *= 10;
-				*domega_in_dy *= 10;
-#endif
 			}
 		}
 	}

Modified: trunk/blender/intern/cycles/kernel/closure/bsdf_ward.h
===================================================================
--- trunk/blender/intern/cycles/kernel/closure/bsdf_ward.h	2012-12-12 14:34:21 UTC (rev 52928)
+++ trunk/blender/intern/cycles/kernel/closure/bsdf_ward.h	2012-12-12 14:43:07 UTC (rev 52929)
@@ -182,12 +182,6 @@
 #ifdef __RAY_DIFFERENTIALS__
 				*domega_in_dx = (2 * dot(N, dIdx)) * N - dIdx;
 				*domega_in_dy = (2 * dot(N, dIdy)) * N - dIdy;
-				// Since there is some blur to this reflection, make the
-				// derivatives a bit bigger. In theory this varies with the
-				// roughness but the exact relationship is complex and
-				// requires more ops than are practical.
-				*domega_in_dx *= 10.0f;
-				*domega_in_dy *= 10.0f;
 #endif
 			}
 		}

Modified: trunk/blender/intern/cycles/kernel/closure/bsdf_westin.h
===================================================================
--- trunk/blender/intern/cycles/kernel/closure/bsdf_westin.h	2012-12-12 14:34:21 UTC (rev 52928)
+++ trunk/blender/intern/cycles/kernel/closure/bsdf_westin.h	2012-12-12 14:43:07 UTC (rev 52929)
@@ -108,14 +108,6 @@
 				*pdf = 0.5f * M_1_PI_F * powf(cosTheta, m_invroughness);
 				*pdf = (m_invroughness + 1) * (*pdf);
 				*eval = make_float3(*pdf, *pdf, *pdf);
-#ifdef __RAY_DIFFERENTIALS__
-				// Since there is some blur to this reflection, make the
-				// derivatives a bit bigger. In theory this varies with the
-				// exponent but the exact relationship is complex and
-				// requires more ops than are practical.
-				*domega_in_dx *= 10.0f;
-				*domega_in_dy *= 10.0f;
-#endif
 			}
 		}
 	}
@@ -176,8 +168,6 @@
 		// TODO: find a better approximation for the diffuse bounce
 		*domega_in_dx = (2 * dot(N, dIdx)) * N - dIdx;
 		*domega_in_dy = (2 * dot(N, dIdy)) * N - dIdy;
-		*domega_in_dx *= 125.0f;
-		*domega_in_dy *= 125.0f;
 #endif
 	}
 	else {




More information about the Bf-blender-cvs mailing list