Skip to content

SSRPass: Ensure metalness pass is not affected by fog and background.#29585

Merged
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev3
Oct 8, 2024
Merged

SSRPass: Ensure metalness pass is not affected by fog and background.#29585
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev3

Conversation

@Mugen87
Copy link
Copy Markdown
Collaborator

@Mugen87 Mugen87 commented Oct 8, 2024

Related issue: -

Description

The metalness pass of SSRPass should save the metalness of the scene's objects so it's possible to decide what objects are affected by SSR. However, the pass is not correctly configured since the scene's background and fog currently affects the metalness data which is wrong.

@Mugen87 Mugen87 added this to the r170 milestone Oct 8, 2024
@Mugen87 Mugen87 merged commit 36ae025 into mrdoob:dev Oct 8, 2024
@Mugen87
Copy link
Copy Markdown
Collaborator Author

Mugen87 commented Oct 8, 2024

@sunag This is also an issue with WebGPURenderer. When I configure a background color and use this MRT setup:

scene.background = new THREE.Color( 0x443333 );
scene.fog = new THREE.Fog( 0x443333, 1, 4 );

const scenePass = pass( scene, camera );
scenePass.setMRT( mrt( {
	output: output,
	normal: transformedNormalView,
	metalness: metalness
} ) );

The background of the normal and metalness output is affected as well which is not correct.

The following screenshot shows the metalness output of the SSR example (without ground).

image

The background should be black though.

I guess we need the ability in PassNode to define different clear colors per MRT target. The scene's background should only apply for the beauty pass by default, imo.

@Mugen87
Copy link
Copy Markdown
Collaborator Author

Mugen87 commented Oct 8, 2024

I'm currently develop SSRNode in https://github.com/Mugen87/three.js/commits/dev3/.

There is already webgpu_postprocessing_ssr for testing. Just replace the WIP SSRNode instance in postProcessing.outputNode = ssrPass; with the output node you want to debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant