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

InstancedMesh: use renderable instanceMatrix default #24749

Merged
merged 2 commits into from
Oct 13, 2022

Conversation

CodyJasonBennett
Copy link
Contributor

Description

This PR populates InstanceMesh.instanceMatrix with identity matrices so it is renderable by default.

It's a common gotcha I see with new users to render an untransformed InstanceMesh and see nothing onscreen because instanceMatrix is zeroed by default.

@CodyJasonBennett
Copy link
Contributor Author

As an aside, should instanceColor be lazily init with ones or white instead of zeroes? I'm not very familiar with the vertex-colors workflow in three, but that at least seems closer to Material.color.

@Mugen87
Copy link
Collaborator

Mugen87 commented Oct 5, 2022

As an aside, should instanceColor be lazily init with ones or white instead of zeroes?

Not sure this is necessary since the color attribute is only defined when the user actually defines an instance color. I would assume colors for all instances are define in this situation so I don't think we need to catch this use case.

@Mugen87 Mugen87 added this to the r146 milestone Oct 10, 2022
@Mugen87 Mugen87 merged commit 2f5a5e1 into mrdoob:dev Oct 13, 2022
@CodyJasonBennett CodyJasonBennett deleted the instancedmesh-identity-matrix branch October 13, 2022 13:45
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