Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37907385
en ru br
ALT Linux repos
S:3.6.3-alt1
5.0: 2.48a-alt2
4.1: 2.45-alt2.2.1.qa1
4.0: 2.45-alt0.M40.2
3.0: 2.36-alt1.1

Other repositories
Upstream:2.45

Group :: Graphics
RPM: blender

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: 0001-Cycles-Fix-MNEE-not-accounting-for-closure-Fresnel.patch
Download


From 8639bf013cdc93ee13fb6eec3f49203625a13e01 Mon Sep 17 00:00:00 2001
From: Lukas Stockner <lukas.stockner@freenet.de>
Date: Sat, 22 Jul 2023 04:01:41 +0200
Subject: [PATCH] Cycles: Fix MNEE not accounting for closure Fresnel
Previously Glass Fresnel used to get baked into the closure weight,
so the MNEE code could just ignore it.
However, now that it's part of the closure implementation, we need
to account for it in the MNEE throughput calculation as well.
---
 intern/cycles/kernel/integrator/mnee.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/intern/cycles/kernel/integrator/mnee.h b/intern/cycles/kernel/integrator/mnee.h
index 7af104f6096..2c1434dbc10 100644
--- a/intern/cycles/kernel/integrator/mnee.h
+++ b/intern/cycles/kernel/integrator/mnee.h
@@ -623,6 +623,8 @@ ccl_device_forceinline Spectrum mnee_eval_bsdf_contribution(ccl_private ShaderCl
     G = bsdf_G<MicrofacetType::GGX>(alpha2, cosNI, cosNO);
   }
 
+  Spectrum F = microfacet_fresnel(bsdf, wi, Ht, true);
+
   /*
    * bsdf_do = (1 - F) * D_do * G * |h.wi| / (n.wi * n.wo)
    *  pdf_dh = D_dh * cosThetaM
@@ -631,7 +633,7 @@ ccl_device_forceinline Spectrum mnee_eval_bsdf_contribution(ccl_private ShaderCl
    * contribution = bsdf_do * |do/dh| * |n.wo / n.h| / pdf_dh
    *              = (1 - F) * G * |h.wi / (n.wi * n.h^2)|
    */
-  return bsdf->weight * G * fabsf(cosHI / (cosNI * sqr(cosThetaM)));
+  return bsdf->weight * F * G * fabsf(cosHI / (cosNI * sqr(cosThetaM)));
 }
 
 /* Compute transfer matrix determinant |T1| = |dx1/dxn| (and |dh/dx| in the process) */
-- 
2.33.8
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin