Skip to content

Commit 3bff5b3

Browse files
authored
Fix the option prevent normal emitters (#718)
1 parent bec30be commit 3bff5b3

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

chunky/src/java/se/llbit/chunky/renderer/scene/PathTracer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public static boolean pathTrace(Scene scene, Ray ray, WorkerState state, int add
156156

157157
Vector4 indirectEmitterColor = new Vector4(0, 0, 0, 0);
158158

159-
if (scene.emittersEnabled && (!scene.isPreventNormalEmitterWithSampling() || scene.getEmitterSamplingStrategy() == EmitterSamplingStrategy.NONE) && currentMat.emittance > Ray.EPSILON) {
159+
if (scene.emittersEnabled && (!scene.isPreventNormalEmitterWithSampling() || scene.getEmitterSamplingStrategy() == EmitterSamplingStrategy.NONE || ray.depth == 0) && currentMat.emittance > Ray.EPSILON) {
160160

161161
emittance = addEmitted;
162162
ray.emittance.x = ray.color.x * ray.color.x *

chunky/src/java/se/llbit/chunky/renderer/scene/Scene.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ public synchronized void copyState(Scene other, boolean copyChunks) {
415415
emittersEnabled = other.emittersEnabled;
416416
emitterIntensity = other.emitterIntensity;
417417
emitterSamplingStrategy = other.emitterSamplingStrategy;
418+
preventNormalEmitterWithSampling = other.preventNormalEmitterWithSampling;
418419
transparentSky = other.transparentSky;
419420
fogDensity = other.fogDensity;
420421
skyFogDensity = other.skyFogDensity;

0 commit comments

Comments
 (0)