[go: up one dir, main page]

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

DecalGeometry: Check for existence of normal attribute. #29462

Closed
wants to merge 2 commits into from

Conversation

hichemfantar
Copy link

Related issue: #XXXX

Description

fixes error when normal attribute isn't present

Uncaught TypeError: Cannot read properties of undefined (reading 'getX')
    at _Vector3.fromBufferAttribute

image

@Mugen87 Mugen87 changed the title Check for existence of normal attribute DecalGeometry: Check for existence of normal attribute. Sep 22, 2024
@Mugen87
Copy link
Collaborator
Mugen87 commented Sep 22, 2024

I'm afraid this change is incomplete.

DecalGeometry expects that a normal attribute is always present right now. Hence, the module always generates normals for the resulting decal geometry.

If no normals are available in the base geometry and you want to support this input, you have to make sure:

  • Normals are optional in DecalVertex.
  • Normals are optional during the clipping process.
  • Normals are optional in the final decal geometry.

@hichemfantar
Copy link
Author
hichemfantar commented Sep 23, 2024

I'm afraid this change is incomplete.

DecalGeometry expects that a normal attribute is always present right now. Hence, the module always generates normals for the resulting decal geometry.

If no normals are available in the base geometry and you want to support this input, you have to make sure:

  • Normals are optional in DecalVertex.
  • Normals are optional during the clipping process.
  • Normals are optional in the final decal geometry.

should a specific parameter be passed to skip normals ( useNormals: boolean ) or should it be inferred based on the presence of the attribute?

@hichemfantar
Copy link
Author

I'm afraid this change is incomplete.

DecalGeometry expects that a normal attribute is always present right now. Hence, the module always generates normals for the resulting decal geometry.

If no normals are available in the base geometry and you want to support this input, you have to make sure:

  • Normals are optional in DecalVertex.
  • Normals are optional during the clipping process.
  • Normals are optional in the final decal geometry.

also wanted to mention that the current change with the simple check fixes the issue and doesn't throw any errors.
tested locally with the normal attribute missing and everything went smoothly.

@Mugen87
Copy link
Collaborator
Mugen87 commented Sep 24, 2024

should a specific parameter be passed to skip normals ( useNormals: boolean ) or should it be inferred based on the presence of the attribute?

The normal generation for decals should be inferred from the base geometry. So no parameter.

also wanted to mention that the current change with the simple check fixes the issue and doesn't throw any errors.
tested locally with the normal attribute missing and everything went smoothly.

The decals still end up with invalid normal data which isn't right.

@Mugen87
Copy link
Collaborator
Mugen87 commented Sep 30, 2024

Closing in favor of #29536.

@Mugen87 Mugen87 closed this Sep 30, 2024
@Mugen87 Mugen87 added this to the r170 milestone Sep 30, 2024
@hichemfantar hichemfantar deleted the hichemfantar-patch-1 branch September 30, 2024 20:44
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