Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/rendering/tsl/PostProcessing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,17 +466,15 @@ export class RenderPipeline {
);
outputNode = scenePassColor.mul(mix(float(1.0), aoValue, this.uAOIntensity));
} else {
// Full-res AO - temporarily disabled normal pass to test if MRT normals
// are causing InstancedMesh artifacts. Passing null forces depth-based
// normal reconstruction.
// Full-res AO with scene normals for accurate occlusion
const result = createGTAOPass(
scenePassDepth,
this.camera,
{
radius: this.config.aoRadius,
intensity: this.config.aoIntensity,
},
null // TODO: Fix InstancedMesh normal issue then restore scenePassNormal
scenePassNormal
);
if (result) {
this.aoPass = result.pass;
Expand Down
5 changes: 5 additions & 0 deletions src/rendering/tsl/effects/EffectPasses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ export function createGTAOPass(
// The ao() function accepts null for normalNode even though types say otherwise
const aoPass = ao(scenePassDepth, scenePassNormal ?? (null as any), camera);
aoPass.radius.value = config.radius;
// Set thickness to help with depth discontinuity artifacts on InstancedMesh
// Higher thickness = more tolerance for depth differences = fewer edge artifacts
if (aoPass.thickness) {
aoPass.thickness.value = 0.5;
}
const aoValueNode = aoPass.getTextureNode().r;

return { pass: aoPass, aoValueNode };
Expand Down
Loading