glTF/X3D Comparison
WIth 3D/VR becomming practical in the web browser there are a lot of questions concerning the right format to use for various situations. This post looks at two model formats - X3D and glTF. Both formats support full geometric surface modeling, but there are differences between these formats for some specific areas.
X3D has a number of profiles. Most of the profiles include extensive run-time requirements. As this comparison is just for model formats, only the V3.3 Interchange ProfileA of X3D is considered. V2.0 of the glTF binary specificationB with no extensions was used. This comparison is not representing the full capabilities of X3D nor glTF, neither is it a comparison of various viewers for those formats.
In the Visual Effects (VFX) community, standard practice is to produce a model (surface) with animation (if required). Mostly texturing of the surface is applied later during scene integration; however, a textured animated model is frequently desired. The modeling process does not include lights, environmental effects (fog, background, etc.) or other objects. This comparison is just about the capabilities provided by these specifications for an animated, textured model.
The following table lists a number of features that are needed or desirable for the display of 3D models in either a flat-screen or VR/xR approach. This table is derrived from the sources listed below. Many of the comparison marks and examples have footnotes described beneath the table. These provide important qualifications or conditions on the listed item.
Sources
- X3D V3.3 Specification (ISO/IEC 19775-1)
- glTF V2.0 Specification
- A-Frame V0.6.0 documentation
- Babylon.js documentation
- THREE.js documentation
- glTF Converters and Exporters
Feature | X3D1 | Example2.3 | glTF4 | Example5 |
---|---|---|---|---|
Triangulated surface model | ||||
Quad surface model | 6 | example | 7 | |
Custom unit definitions | ||||
Basic geometric solids | example | |||
Uniform surface color | example | |||
Vertex coloring | ||||
Surface texture | example | |||
Texture UV mapping | example | |||
Advanced apperance (bump, occulusion, etc. maps) |
8 | |||
Morph targets9 | 10 | example | ||
Mesh skin11 | ||||
Custom Shaders | ||||
Physically based rendering (PBR) | ||||
GPU pre-formatted12 | 13 | |||
Export by Maya | 14 | 15 | ||
Export by Blender | 16 | |||
Single file | 17 | 16 | ||
RIgid body animation | example | |||
Surface morphing | 19 | example | ||
Joint animation | 20 | |||
Loads in THREE.js | 21 | |||
Loads in Babylon.js | ||||
Loads in A-Frame | ||||
Sketchup Import | documentation | |||
Unity Exporter | code | |||
Sketchup Exporter | documentation |
Notes
- Uses X3D V3.3A Interchange Profile except where noted
- X3D examples may use capabilities beyond that available in Interchange profile. Unless otherwise noted, the illustrated capability is available in the Interchange profile.
- Thumnails of X3D examples are generally not available. The link is a descriptve page and includes source, and an online 3D display.
- Uses glTF Binary V2.0B except where noted
- glTF Examples link to a Github page with a link to the model. Models can be viewed online using the glTF Viewer
- Quad surfaces are available in the CAD Component. This componet is only included in the Full Profile, though it may be made available by browsers.
- glTF allows any GPU primitives. At this time all GPUs allow triangles, but not necessarily quads or higher vertex polygons.
- This particular model also includes PBR.
- A "Morph Target" is a morphable mesh (geometric surface) that is a linear combination of other meshes. This is commonly used for facial animation.
- X3D has the basic capability to do morphing of surfaces (meshes); however, all of the setting up needs to be done manually. There is no requirement for use of a GPU for this calculation.
- Mesh skin is a mapping from each vertex of a mesh to the joints (aka bones) that contribute to the deformation of that mesh vertex by a linear combination of those joint movements. Each mesh vertex requires a weight and a joint reference. Common practice limits the joints to a maximum of four.
- This feature is the ability of the format to directly provide (without additional processing or interpertation) data to the GPU.
- X3DOM has an implementation of SRC and glTF importer which does pass data directly to the GPU; however, these features are not part of the X3D specification
- Autodesk removed VRML exporting from Maya in the 2016 edition. There is no replacement.
- A glTF exporter for Maya is currently being developed.
- The X3D blender exporter produces valid X3D that captures the static scene information. It does not support animations.
- X3D can hold all of the image texture data in a single file with the mesh, though it is common practice to not do so.
- glTF can hold all of the image texture data in a single file with the mesh. Common practice has not yet been established.
- As with note (9), the capability to do so; however, the all of the setup must be programmed into the interpolator weights. There is no requirement for use of a GPU for this calculation.
- The H-Anim componet provides this capability. It is only included in the Full Profile, though it may be made available by browsers. There is no requirement for use of a GPU for this calculation.
- THREE.js has a very limited X3D loader. Among other missing features, the THREE loader does not include X3D animations.
Icons from Icons Land licensed as "Free for commercial use".