Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Jul 5, 2024

Related issue: #28785

Description

Basic, lambert and phong materials now support ambient occlusion.

@Mugen87 Mugen87 added this to the r167 milestone Jul 5, 2024
@github-actions
Copy link

github-actions bot commented Jul 5, 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.6 kB (111.1 kB) 460.6 kB (111.1 kB) +0 B

@sunag sunag merged commit 0200eb1 into mrdoob:dev Jul 5, 2024
reflectedLight.indirectDiffuse.assign( diffuseColor.rgb );
reflectedLight.indirectDiffuse.addAssign( diffuseColor.rgb );

reflectedLight.indirectDiffuse.mulAssign( ambientOcclusion );
Copy link
Collaborator

Choose a reason for hiding this comment

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

I was thinking in we move this to LighthingModel.ambientOcclusion(), since we already have this function.

Copy link
Collaborator Author

@Mugen87 Mugen87 Jul 6, 2024

Choose a reason for hiding this comment

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

Um, maybe it is easier to read the code when the final computation of indirect diffuse (accumulation + modulation) happens at one place.

Although when the line is moved to LighthingModel.ambientOcclusion(), we don't have to repeat it in derived models. I'm just afraid it will make it more hard to understand the lighting models in the end...

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