delve-framework icon indicating copy to clipboard operation
delve-framework copied to clipboard

Ability to pass multiple materials to a Mesh

Open nicoabie opened this issue 9 months ago • 3 comments

Currently the Mesh accepts a single Material but it may have multiple through primitives.

I did that change locally to support what I'm working in, would you be open to integrate it?

If yes, would you prefer passing a slice of materials or maintain the single material + extra_materials slice?

nicoabie avatar Apr 09 '25 17:04 nicoabie

That could be a cool addition. I'd like to keep the API simple, but allowing a mesh to use multiple materials could be useful for importing a scene from a gltf file. Could I see what you've done locally to support that?

Interrupt avatar Apr 12 '25 18:04 Interrupt

It is not finished yet. I'm able to create multiple materials from the gltf file but the draw method only accepts one still and it is applying the texture to the whole mesh, seems there is some handling of UVs that is not working as expected. I'm learning all this so I could be wrong

nicoabie avatar Apr 12 '25 18:04 nicoabie

update: UVs seems to be fine. the problem is draw accepting a single material. so now it is using the same texture for all its parts.

Imagine this is an F1 car Wheels have the texture correctly applied so UVs are fine.

I need to see how to pass all the materials and use the correct one for each part.

Image

nicoabie avatar Apr 12 '25 19:04 nicoabie