Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

Mugen87
Copy link
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
11 checks passed
@Mugen87
Copy link
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
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