Skip to content

Commit

Permalink
Fix direct emitter hits when emitter sampling is enabled and prevent …
Browse files Browse the repository at this point in the history
…normal emitter when using emitter sampling is enabled.
  • Loading branch information
ThatRedox committed Aug 25, 2024
1 parent f28add6 commit a011d1f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ private static boolean doDiffuseReflection(Ray ray, Ray next, Material currentMa
Vector3 emittance = new Vector3();
Vector4 indirectEmitterColor = new Vector4(0, 0, 0, 0);

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

// Quadratic emittance mapping, so a pixel that's 50% darker will emit only 25% as much light
// This is arbitrary but gives pretty good results in most cases.
Expand Down

0 comments on commit a011d1f

Please sign in to comment.