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

RendererUtils: Honor fog. #30178

Merged
merged 2 commits into from
Dec 21, 2024
Merged

RendererUtils: Honor fog. #30178

merged 2 commits into from
Dec 21, 2024

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Dec 20, 2024

Fixed #30177

Description

The PR makes sure RendererUtils honors fog definitions.

@Mugen87 Mugen87 added this to the r172 milestone Dec 20, 2024
Copy link

github-actions bot commented Dec 20, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 339.4
79.05
339.4
79.05
+0 B
+0 B
WebGPU 487.25
135.14
487.34
135.17
+90 B
+25 B
WebGPU Nodes 486.72
135.04
486.81
135.07
+90 B
+24 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.3
112.11
465.3
112.11
+0 B
+0 B
WebGPU 557.41
150.83
557.5
150.86
+90 B
+28 B
WebGPU Nodes 513.49
140.61
513.58
140.64
+90 B
+29 B

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Dec 20, 2024

@sunag Unfortunately, this PR exhibits an issue with toggling fog: If you render the shadow pass with disabled fog and then restore the setting for the beauty pass, you end up with no fog in the beauty pass since the caching system does not detect the change in the scene. If you call Nodes.updateFog() in RenderUtils, the issue is fixed however there is now a constant object creation and deletion overhead in updateFog() every frame.

Maybe we can store the created fogNode in updateFog() in a separate cache so we don't create it over and over again.

@Mugen87 Mugen87 marked this pull request as draft December 20, 2024 16:02
@sunag
Copy link
Collaborator

sunag commented Dec 20, 2024

I'll check that out.

@sunag sunag marked this pull request as ready for review December 21, 2024 15:40
@sunag sunag merged commit 284c5fe into mrdoob:dev Dec 21, 2024
12 checks passed
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.

scene.fog / scene.fogNode draw in the shadow map
2 participants