I would like to use this issue to keep track of the GLTF2 exporter features. I’ve copied the initial list of features discussed on the PR #11917 and I’ll keep updating the list as we progress in the implementation.
Features / TO-DO
-
Export options
-
trs
to export TRS instead of matrix -
input
:- Single scene
- Array of scenes
- Single object
- Array of objects
-
truncateDrawRange
: force exporting just the attribute values defined bydrawRange
: - Non-index buffer geometry
- Indexed buffer geometry
-
-
Include
userData
inextras
? -
Scenes
- Support for multiple scenes
-
Nodes
- Meshes
- Primitive mode:
- TRIANGLES
- TRIANGLE_STRIP
- TRIANGLE_SPAN
- POINTS
- LINES
- LINE_STRIP
- LINE_LOOP
- Geometry types:
- BufferGeometry
- Geometry
- Primitive attributes:
- POSITION
- NORMAL
- TEXCOORD_0
- TEXCOORD_1
- COLOR_0
- JOINTS_0
- WEIGHTS_0
-
TANGENT
- Multi-material meshes as primitives
- Primitive mode:
- Lights
- Camera
- Skin
- Meshes
-
Materials:
-
Ignore if default material is being used - Export as lines if
material.wireframe === true
-
pbrMetallicRoughness
forMeshStandardMaterial
- Attributes:
-
baseColorFactor
-
metallicFactor
-
roughnessFactor
-
baseColorTexture
: It’s supported (material.map
) but thetexCoord
is always set to 0.
-
-
doubleSided
- KHR_material_unlit
- Attributes:
-
-
Samplers
-
Images
-
uri
usingmap.image.src
-
uri
base64 -
bufferView
- Deal with
flipY
images - Merge channels into one texture
-
-
Accessors
- Use the same
bufferView
for the same componentType instead of creating a new one for each attribute (WIP @takahirox) -
Supportsparse
? - Attributes:
-
bufferView
-
byteOffset
: Currently it’s using 0 always as I’m creating a new bufferView for each accessor. -
componentType
-
count
-
max
-
min
-
type
:-
SCALAR
-
VEC2
-
VEC3
-
VEC4
-
-
- Use the same
-
BufferViews: Currently I’m creating a new
bufferView
for eachAccessor
, this should be fixed to use just one for these attributes that share the samecomponentType
- Attributes:
-
buffer
-
byteOffset
-
byteLength
-
byteStride
-
target
-
- Attributes:
-
Buffers: Currently I’m saving everything to a single buffer so it will be just one entry in the buffers array.
- byteLength
- uri
-
Animations
-
misc:
- Validate output (https://github.com/KhronosGroup/glTF-Validator)
- Include
stats
option to log the number of items exported and maybe some timing?
-
GLB
Example
Exported gltf loaded on @donmccurdy ‘s gltf viewer
GLTF: https://gist.github.com/fernandojsg/0e86638d81839708bcbb78ab67142640
Great work, great list and good to know there is already so much support on the format! Also works very well together with gltf blender exporter too. Can’t wait for lights support! Keep up the great work.
Hi @siddhartpai —
THREE.GLTFExporter
only convertsTHREE.AnimationClip
objects to glTF animations, whereas A-Frame’s animation system uses TweenJS. So currently this isn’t possible. You may want to open an issue on A-Frame or the A-Frame Inspector, which also useGLTFExporter
, to request it as a future feature.