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

Equivalent of Three.js's InstancedMesh #342

Open
4 tasks done
andretchen0 opened this issue Feb 5, 2024 · 7 comments
Open
4 tasks done

Equivalent of Three.js's InstancedMesh #342

andretchen0 opened this issue Feb 5, 2024 · 7 comments
Assignees
Labels
feature New feature or request p2-nice-to-have Not breaking anything but nice to have (priority)

Comments

@andretchen0
Copy link
Contributor

Description

As a developer using TresJS, I would like an equivalent of Three.js's instancedMesh to improve performance.

Suggested solution

Drei's <Instances />

Alternative

No response

Additional context

No response

Validations

@andretchen0 andretchen0 self-assigned this Feb 5, 2024
@Sea-DH1
Copy link

Sea-DH1 commented Feb 6, 2024

Hi, you can use TresInstancedMesh
<TresInstancedMesh
ref="instancedMesh"
:args="[geometry, material, maxGeometryCount]"
@click="instanceMeshClick"
/>

@andretchen0
Copy link
Contributor Author

andretchen0 commented Feb 6, 2024

@Sea-DH1

Hi, you can use TresInstancedMesh

Sure thing. The idea is to bring it to Tres/Cientos so it's possible to do something like:

<InstancedMesh :count="1000">
  <Box>
    <TresMeshNormalMaterial />
  </Box>
</InstancedMesh>

@Sea-DH1
Copy link

Sea-DH1 commented Feb 7, 2024

@andretchen0
Well, I understand what you mean. I feel like I can help implement this component.

@andretchen0
Copy link
Contributor Author

@Sea-DH1

Sure thing. If you're new to Tres, this particular issue might be a bit of a challenge, but you're more than welcome to give it a shot!

@andretchen0
Copy link
Contributor Author

Hey @Sea-DH1 , are you interested in trying to make a component for InstancedMesh? If so, I'll assign you.

@alvarosabu
Copy link
Member

Hey @andretchen0 @Sea-DH1 we got a interesting feedback from @Dekier on Discord about creating an abstraction with Frustum Culling support https://stackblitz.com/edit/instancedmesh2-forest?embed=1&file=src%2Fmain.ts

Is this already on the scope of this ticket?

@andretchen0
Copy link
Contributor Author

@alvarosabu

Thanks! Looks interesting! That might be a nice way to approach things.

@alvarosabu alvarosabu added feature New feature or request p2-nice-to-have Not breaking anything but nice to have (priority) and removed enhancement labels Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

No branches or pull requests

3 participants