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

Nodes: Add GTAONode. #28844

Merged
merged 23 commits into from
Jul 11, 2024
Merged
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion examples/webgpu_postprocessing_ao.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@
const scenePass = pass( scene, camera );
scenePass.setMRT( mrt( {
output: output,
normal: transformedNormalWorld.directionToColor()
normal: transformedNormalWorld
} ) );
postProcessing.outputColorTransform = false;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this just temporarily to better visually debug the shader.

Copy link
Collaborator

@sunag sunag Jul 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could try get positionView from MRT too? like:

scenePass.setMRT( mrt( {
	output: output,
	normal: transformedNormalWorld,
	view: positionView
} ) );

const scenePassView = scenePass.getTextureNode( 'view' );

We could find ways to optimize them too...

Copy link
Collaborator

@sunag sunag Jul 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use cameraProjectionMatrixInverse inside a QuadMesh.render()( PostProcessing ) it will use the current camera OrthographicCamera and not the camera used in pass().

Copy link
Collaborator Author

@Mugen87 Mugen87 Jul 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, using positionView and the correct camera fixes the image!

I want to understand why the inline computation of positionView fails. I think this is related to the different clip space of WebGPU but I'm still not sure.

const scenePassColor = scenePass.getTextureNode( 'output' );
const scenePassNormal = scenePass.getTextureNode( 'normal' );
const scenePassDepth = scenePass.getTextureNode( 'depth' );
Expand Down
Loading