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

GTAONode: Implement composite. #28851

Merged
merged 2 commits into from
Jul 11, 2024
Merged

GTAONode: Implement composite. #28851

merged 2 commits into from
Jul 11, 2024

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Jul 11, 2024

Related issue: #28844

Description

This PR implements a basic composite for GTAONode so the AO is blended to the beauty pass.

A simple GUI in the example allows to change the AO blend intensity.

@Mugen87 Mugen87 marked this pull request as ready for review July 11, 2024 19:08
@Mugen87 Mugen87 added this to the r167 milestone Jul 11, 2024
Copy link

github-actions bot commented Jul 11, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
683.5 kB (169.2 kB) 683.5 kB (169.2 kB) +0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
460.7 kB (111.1 kB) 460.7 kB (111.1 kB) +0 B

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Jul 11, 2024

We might want to make GTAONode a bit more flexible so it reports the raw AO (without the composite). In this way, the dev can to blend the AO with a custom function or even apply a custom blur before doing the blend.

@Mugen87 Mugen87 merged commit 0c11af3 into mrdoob:dev Jul 11, 2024
12 checks passed
@Mugen87
Copy link
Collaborator Author

Mugen87 commented Jul 11, 2024

Current progress:

Previous GTAO with EffectComposer: Beauty, Normal + Depth, AO, Blend, Output: 5 Passes
New GTAO with PostProcessong: Beauty + Normal + Depth (via MRT), AO, Blend + Output (merged thanks to node material): 3 Passes

The denoise pass is still missing but we can maybe make this step configurable so if you don't need best quality you get a bit more performance. I'll do that next.

@@ -53,12 +54,6 @@ class GTAONode extends TempNode {

}

getTextureNode() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I made some changes to this PR, I think it's important to keep getTextureNode() for external manipulation level, like adding a custom Denoise filter or just a blur without having to do a new render-pass.

I'm removing blendIntensity too, now with TSL I think it's better that this level of abstraction stays outside the internal Nodes, intensity, blend are things that would only bring more load to the examples since we could use blendIntensity.mix( beauty, beauty.mul( ao ) externally if necessary.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, you think the same think <3 #28851 (comment)
I'm reading the comments now :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm fine with your suggested changes. I've only added blendIntensity now so the implementation can be considered as "complete" and usable in apps.

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.

2 participants