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

MeshBasicNodeMaterial: Fix transformedNormalView. #28839

Merged
merged 1 commit into from
Jul 10, 2024
Merged

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Jul 9, 2024

Related issue: -

Description

This makes sure MeshBasicNodeMaterial does not react on normal or bump maps by overwriting the computation of transformedNormalView.

Copy link

github-actions bot commented Jul 9, 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

@@ -16,7 +16,7 @@ class MeshBasicNodeMaterial extends NodeMaterial {
this.isMeshBasicNodeMaterial = true;

this.lights = true;
//this.normals = false; @TODO: normals usage by context
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

normals usage by context

I could not find reference of normal usage over the context object. Is this TODO still relevant?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The reason was to remove some possible duplicate operations in normals that might occur in this configuration.

Copy link
Collaborator Author

@Mugen87 Mugen87 Jul 9, 2024

Choose a reason for hiding this comment

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

If you can share an example where duplicate operations might occur, I would be curious to debug this situation 🤓 .

Otherwise I think we should ensure the correct feature set of the materials first before we apply optimizations. Right now, you could apply a normal map to MeshBasicMaterial and it would affect the environment map sampling which isn't ideal.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If you can share an example where duplicate operations might occur, I would be curious to debug this situation

I think it might take a while for me to check this since it would be easier for me to do the tests again than to find the files.

you could apply a normal map to MeshBasicMaterial and it would affect the environment map sampling which isn't ideal.

For this case I would suggest create a MeshBasicNodeMaterial.setupNormal() for modify this default behavior.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay, there is now an overwritten version of setupNormal() in MeshBasicNodeMaterial next to a comment that refers to this PR.

@Mugen87 Mugen87 added this to the r167 milestone Jul 9, 2024
@Mugen87 Mugen87 changed the title MeshBasicNodeMaterial: Set normals to false. MeshBasicNodeMaterial: Fix transformedNormalView. Jul 9, 2024
@sunag sunag merged commit 9352a76 into mrdoob:dev Jul 10, 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.

2 participants