diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-12-12 18:43:07 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-12-12 18:43:07 +0400 |
commit | 5616c7a0585521ca16f352ce2277cf4ac73eced2 (patch) | |
tree | c3d748185fa49441c39e01ed92365ab6c2ca949a /intern | |
parent | 96cad133f75b22a3ac8045fefe18239bef5a4bf9 (diff) |
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.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_diffuse.h | 8 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_microfacet.h | 28 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_oren_nayar.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_phong_ramp.h | 9 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_ward.h | 6 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_westin.h | 10 |
7 files changed, 2 insertions, 63 deletions
diff --git a/intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h b/intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h index 016fd73204e..60f809159ac 100644 --- a/intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h +++ b/intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h @@ -134,8 +134,6 @@ __device int bsdf_ashikhmin_velvet_sample(const ShaderClosure *sc, float3 Ng, fl // 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 diff --git a/intern/cycles/kernel/closure/bsdf_diffuse.h b/intern/cycles/kernel/closure/bsdf_diffuse.h index 88b40e3d479..46318ecd138 100644 --- a/intern/cycles/kernel/closure/bsdf_diffuse.h +++ b/intern/cycles/kernel/closure/bsdf_diffuse.h @@ -74,8 +74,6 @@ __device int bsdf_diffuse_sample(const ShaderClosure *sc, float3 Ng, float3 I, f // 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 @@ __device int bsdf_translucent_sample(const ShaderClosure *sc, float3 Ng, float3 *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 { diff --git a/intern/cycles/kernel/closure/bsdf_microfacet.h b/intern/cycles/kernel/closure/bsdf_microfacet.h index a564b99e759..019ec105111 100644 --- a/intern/cycles/kernel/closure/bsdf_microfacet.h +++ b/intern/cycles/kernel/closure/bsdf_microfacet.h @@ -199,12 +199,6 @@ __device int bsdf_microfacet_ggx_sample(const ShaderClosure *sc, float3 Ng, floa #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 @@ __device int bsdf_microfacet_ggx_sample(const ShaderClosure *sc, float3 Ng, floa // 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 @@ __device int bsdf_microfacet_beckmann_sample(const ShaderClosure *sc, float3 Ng, #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 @@ __device int bsdf_microfacet_beckmann_sample(const ShaderClosure *sc, float3 Ng, // 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 } } } diff --git a/intern/cycles/kernel/closure/bsdf_oren_nayar.h b/intern/cycles/kernel/closure/bsdf_oren_nayar.h index 066937da6eb..770f06dddc5 100644 --- a/intern/cycles/kernel/closure/bsdf_oren_nayar.h +++ b/intern/cycles/kernel/closure/bsdf_oren_nayar.h @@ -81,8 +81,6 @@ __device int bsdf_oren_nayar_sample(const ShaderClosure *sc, float3 Ng, float3 I // 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 { diff --git a/intern/cycles/kernel/closure/bsdf_phong_ramp.h b/intern/cycles/kernel/closure/bsdf_phong_ramp.h index 575a798aed4..2f57fc1693f 100644 --- a/intern/cycles/kernel/closure/bsdf_phong_ramp.h +++ b/intern/cycles/kernel/closure/bsdf_phong_ramp.h @@ -119,15 +119,6 @@ __device int bsdf_phong_ramp_sample(const ShaderClosure *sc, const float3 colors *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 } } } diff --git a/intern/cycles/kernel/closure/bsdf_ward.h b/intern/cycles/kernel/closure/bsdf_ward.h index dbddcf20dba..c95b0e3f7a0 100644 --- a/intern/cycles/kernel/closure/bsdf_ward.h +++ b/intern/cycles/kernel/closure/bsdf_ward.h @@ -182,12 +182,6 @@ __device int bsdf_ward_sample(const ShaderClosure *sc, float3 Ng, float3 I, floa #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 } } diff --git a/intern/cycles/kernel/closure/bsdf_westin.h b/intern/cycles/kernel/closure/bsdf_westin.h index 968173208b4..29bfa85bcc1 100644 --- a/intern/cycles/kernel/closure/bsdf_westin.h +++ b/intern/cycles/kernel/closure/bsdf_westin.h @@ -108,14 +108,6 @@ __device int bsdf_westin_backscatter_sample(const ShaderClosure *sc, float3 Ng, *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 @@ __device int bsdf_westin_sheen_sample(const ShaderClosure *sc, float3 Ng, float3 // 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 { |