You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gltf is what most model sites hand you now, sketchfab included. p5 can load obj and stl, so anyone who finds a gltf model has to go convert it first, and conversions routinely lose the materials. supporting it directly means the models people actually find are the models they can use.
a lot of the groundwork is in place now. models are drawn one part per material, so a gltf file's separate meshes and materials have somewhere to go, and normalTexture() already takes tangent space normal maps, which is the kind gltf uses.
the main thing standing in the way is materials: gltf 2.0 describes them with metallic-roughness rather than phong, so #9092 (pbr materials) is really a prerequisite if imported models are going to look the way they were authored.
rough shape of the work:
parse .gltf (json) and .glb (binary), including buffers, accessors and embedded or referenced images
map each gltf primitive onto a geometry part with its material state
as discussed on discord, it may be worth doing this as an addon outside p5 first, so its behaviour can settle before committing to it in core. happy to help guide whoever picks this up.
Increasing access
gltf is what most model sites hand you now, sketchfab included. p5 can load obj and stl, so anyone who finds a gltf model has to go convert it first, and conversions routinely lose the materials. supporting it directly means the models people actually find are the models they can use.
Most appropriate sub-area of p5.js?
Feature request details
follow up from the multi-material work in #8879, #8955, #9066, #9067 and #9089.
a lot of the groundwork is in place now. models are drawn one part per material, so a gltf file's separate meshes and materials have somewhere to go, and
normalTexture()already takes tangent space normal maps, which is the kind gltf uses.the main thing standing in the way is materials: gltf 2.0 describes them with metallic-roughness rather than phong, so #9092 (pbr materials) is really a prerequisite if imported models are going to look the way they were authored.
rough shape of the work:
.gltf(json) and.glb(binary), including buffers, accessors and embedded or referenced imagesas discussed on discord, it may be worth doing this as an addon outside p5 first, so its behaviour can settle before committing to it in core. happy to help guide whoever picks this up.