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

Normal attributes are removed with --transform #278

Open
hichemfantar opened this issue Sep 21, 2024 · 1 comment · May be fixed by #279
Open

Normal attributes are removed with --transform #278

hichemfantar opened this issue Sep 21, 2024 · 1 comment · May be fixed by #279

Comments

@hichemfantar
Copy link

Need a way to override this behavior because three.js throws an error because it expects the normal attribute to be present

related mrdoob/three.js#29462

@donmccurdy
Copy link
Member

Currently gltfjsx (via glTF Transform) will remove a normal attribute is if the geometry is either unlit (MeshBasicMaterial) or a point cloud. three.js does not in general require a normal attribute in these cases, but it sounds like you're hitting a problem with Decal geometry. That could be fixed upstream in three.js, but I think a PR here would be OK too.

If you'd like to disable that, it would be necessary to enable the keepAttributes flag here:

prune({ keepAttributes: false, keepLeaves: false }),

This change would also cause unused UVs and tangents to be kept, relevant to #235.

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 a pull request may close this issue.

2 participants