Skip to content

Commit

Permalink
Refactor clear color to use boolean instead of null
Browse files Browse the repository at this point in the history
Passing null is more error-prone
  • Loading branch information
StuckiSimon committed Aug 14, 2024
1 parent 7303c45 commit be20391
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions strahl-lib/src/path-tracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export type PathTracerOptions = {
viewProjectionConfiguration?: ViewProjectionConfiguration;
environmentLightConfiguration?: EnvironmentLightConfig;
samplesPerIteration?: number;
clearColor?: number[];
clearColor?: number[] | false;
maxRayDepth?: number;
finishedSampling?: (result: {
bvhBuildTime: number;
Expand Down Expand Up @@ -704,8 +704,8 @@ async function runPathTracer(
sunPower: Math.pow(10, environmentLightConfiguration.sun.power),
sunAngularSize: environmentLightConfiguration.sun.angularSize,
sunColor: environmentLightConfiguration.sun.color,
clearColor: isNil(clearColor) ? [0, 0, 0] : clearColor,
enableClearColor: isNil(clearColor) ? 0 : 1,
clearColor: clearColor === false ? [0, 0, 0] : clearColor,
enableClearColor: clearColor === false ? 0 : 1,
maxRayDepth,
objectDefinitionLength: groups.length,
});
Expand Down

0 comments on commit be20391

Please sign in to comment.