From 450a2b8a258f09ec7e0824861e2306340ccbb3f4 Mon Sep 17 00:00:00 2001 From: Adrien Gruson Date: Fri, 10 Aug 2018 17:54:21 +0900 Subject: [PATCH] evaluate the orientation value when calling 'HeterogeneousMedium::eval' if needed. (#84) --- src/medium/heterogeneous.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/medium/heterogeneous.cpp b/src/medium/heterogeneous.cpp index 4c9833ca..1f59614f 100644 --- a/src/medium/heterogeneous.cpp +++ b/src/medium/heterogeneous.cpp @@ -668,11 +668,15 @@ public: Float mintDensity = lookupDensity(ray(ray.mint), ray.d) * m_scale; Float maxtDensity = 0.0f; Spectrum maxtAlbedo(0.0f); + Vector orientation(0.0f); if (ray.maxt < std::numeric_limits::infinity()) { Point p = ray(ray.maxt); maxtDensity = lookupDensity(p, ray.d) * m_scale; maxtAlbedo = m_albedo->lookupSpectrum(p); + orientation = m_orientation != NULL + ? m_orientation->lookupVector(p) : Vector(0.0f); } + mRec.orientation = orientation; mRec.transmittance = Spectrum(expVal); mRec.pdfFailure = expVal; mRec.pdfSuccess = expVal * maxtDensity;