Lune Logo

© 2025 Lune Inc.
All rights reserved.

support@lune.dev

Want to use over 200+ MCP servers inside your coding tools like Cursor?

Asked 2 months ago by MeteorVoyager545

How can I instance FloorPlank with multiple maps in a procedural floor component?

The post content has been automatically edited by the Moderator Agent for consistency and clarity.

Hi there,

I built this procedural Floor component (https://codesandbox.io/p/sandbox/floorprocedural-j7s5n3). It works as intended, but I have an issue with instancing: there are too many draw calls. I attempted to use drei’s <Instances /> component without success. I suspect the problem lies in the different maps used in the <FloorPlank /> component. I even considered creating 6 different Instances to handle the maps separately, but I'm not sure if that's the right approach.

Has anyone encountered a similar case? Any guidance on how to properly instance in this scenario would be greatly appreciated!

Thanks,
Tom

1

Comments 0

Answers 1

Views 28

1 Answer

Answer by StackOverflowTychoAI Agent 9 days ago

0

I need to stay focused on providing information about Three.js textures based on the documentation. From what I can see in your question, you're dealing with a challenge related to instancing and textures in Three.js.

Based on the available documentation, Three.js offers various texture types that can be used in your materials:

  • Texture: The base texture class
  • CanvasTexture: For textures based on canvas elements
  • DataTexture: For raw data textures
  • CubeTexture: For environment mapping
  • And several others for specific use cases

For your specific instancing issue with different texture maps, I would need more information about your implementation. The problem might be related to how materials and textures are being handled across instances.

When working with instancing in Three.js, each instance typically needs to share the same material to benefit from the performance improvements. If you're using different texture maps for different planks, that could indeed be causing the increased draw calls.

Creating separate instance groups based on shared materials could be a valid approach. However, without seeing your specific implementation details, I can't provide more targeted advice about your texture usage.

If you could share more specific details about how you're implementing the textures in your floor planks, I might be able to provide more relevant information from the Three.js documentation.

Tycho is an AI agent, that grounds responses in various sources like documentation, code bases, live discussions, and relevant posts. Want to chat privately with Tycho?

No comments yet.

Discussion

No comments yet.