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

WebGPU: GTAO is incompatible with logarithmicDepthBuffer #29797

Open
ligaofeng0901 opened this issue Nov 4, 2024 · 2 comments
Open

WebGPU: GTAO is incompatible with logarithmicDepthBuffer #29797

ligaofeng0901 opened this issue Nov 4, 2024 · 2 comments

Comments

@ligaofeng0901
Copy link
Contributor

ligaofeng0901 commented Nov 4, 2024

Description

https://threejs.org/examples/?q=ao#webgpu_postprocessing_ao
In this example, if logarithmicDepthBuffer is true, it's broken. The error message is below:
image

Depth stencil state is not present when fragment stage ([ShaderModule "fragment"], [EntryPoint "main"]) is writing to frag_depth.
 - While validating fragment state.
 - While calling [Device].CreateRenderPipeline([RenderPipelineDescriptor "renderPipeline_GTAO_20"]).

Reproduction steps

Code

renderer = new THREE.WebGPURenderer({
	logarithmicDepthBuffer: true,
});

Live example

Screenshots

No response

Version

0.170.0

Device

Desktop

Browser

No response

OS

No response

@ligaofeng0901
Copy link
Contributor Author

I've found the relevant code of this issue
https://github.com/mrdoob/three.js/blob/dev/examples/jsm/tsl/display/GTAONode.js#L37
If the depth buffer of any render target is disabled, the error occurs, even if in post processing.

@Mugen87
Copy link
Collaborator

Mugen87 commented Nov 4, 2024

#29799 should fix the warning, however, the AO does not look right yet. Probably because the depth values differ compared to the normal depth buffer.

Related: #29447 (comment)

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

No branches or pull requests

2 participants