GFX.glTF¶
Name | Mandatory | Description | Default | Type |
---|---|---|---|---|
⬅️ Input |
This shard can take 2 different types of input. It can take a 4x4 transformation for the glTF model to adopt. Or, it can accept a table which contain the transformation matrix and additional information to modify the materials of the glTF model. | [Float4](4) {transform: [Float4](4) none: Any} |
||
Output ➡️ |
Outputs the drawable object. | GFX.Drawable |
||
Path |
No | The path to load the model from | none |
None String Var(String) |
Bytes |
No | The bytes to load the model from | none |
None Bytes Var(Bytes) |
Copy |
No | Reference to another glTF model to copy | none |
None Var(GFX.Drawable) |
Params |
No | Shader parameters used for Drawable rendering | none |
None {GFX.Texture2D GFX.TextureCube GFX.Buffer [Float4](4) Float4 Float3 Float2 Float Int Int2 Int3 Int4 {Any} Var(GFX.Texture2D GFX.TextureCube GFX.Buffer [Float4](4) Float4 Float3 Float2 Float Int Int2 Int3 Int4 {Any})} Var({GFX.Texture2D GFX.TextureCube GFX.Buffer [Float4](4) Float4 Float3 Float2 Float Int Int2 Int3 Int4 {Any} Var(GFX.Texture2D GFX.TextureCube GFX.Buffer [Float4](4) Float4 Float3 Float2 Float Int Int2 Int3 Int4 {Any})}) |
Features |
No | Features to attach to this drawable | none |
None [GFX.Feature] Var([GFX.Feature]) |
AnimationController |
No | The animation controller | none |
Shard [Shard] None |
WrapRootNode |
No | Wrap the root node so animations applied to it still work | none |
None Bool |
This shard takes the glTF model (specified either in the Path, Bytes or Copy parameter) and outputs a drawable object which can be subsequently added to the drawables queue for the render pipline.
Details¶
Loads a glTF model from a file. Outputs a GFX.DrawableHierarchy
that can be passed to Draw.
Static file¶
Loaded when the Wire containing it is warmed up.
{:Transform ...} (GFX.glTF :Path "pathToModel.glb") >= .drawable
Dynamic file¶
Loaded when activated. You should cache the result inside a Setup shard.
{:Transform ... :Path .path} (GFX.glTF) >= .drawable
Raw bytes¶
Loaded when activated. You should cache the result inside a Setup shard.
{:Transform ... :Bytes .gltf-data} (GFX.glTF) >= .drawable
Duplicate existing model¶
Experimental/unstable
This API is experimental and might produce unexpected results or crash.
Generate another GFX.DrawableHierarchy
from an existing GFX.DrawableHierarchy
... (GFX.glTF ...) >= .other-gltf-drawable
{:Transform ... :Copy .other-gltf-drawable} (GFX.glTF) >= .drawable