Skip to content

Commit

Permalink
Fix the option prevent normal emitters (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
aTom3333 authored Nov 8, 2020
1 parent bec30be commit 3bff5b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public static boolean pathTrace(Scene scene, Ray ray, WorkerState state, int add

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

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

emittance = addEmitted;
ray.emittance.x = ray.color.x * ray.color.x *
Expand Down
1 change: 1 addition & 0 deletions chunky/src/java/se/llbit/chunky/renderer/scene/Scene.java
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ public synchronized void copyState(Scene other, boolean copyChunks) {
emittersEnabled = other.emittersEnabled;
emitterIntensity = other.emitterIntensity;
emitterSamplingStrategy = other.emitterSamplingStrategy;
preventNormalEmitterWithSampling = other.preventNormalEmitterWithSampling;
transparentSky = other.transparentSky;
fogDensity = other.fogDensity;
skyFogDensity = other.skyFogDensity;
Expand Down

0 comments on commit 3bff5b3

Please sign in to comment.