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
Copy file name to clipboardExpand all lines: docs/en/manuals/glossary.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,7 +125,7 @@ Here, `"#weapon"` is the address of the current object's sprite component. `"dis
125
125
126
126
## Model
127
127
128
-
{.left} The 3D model component can import glTF and Collada mesh, skeleton and animation assets into your game. See the [Model manual](/manuals/model/) for more information.
128
+
{.left} The 3D model component can import glTF mesh, skeleton and animation assets into your game. See the [Model manual](/manuals/model/) for more information.
Copy file name to clipboardExpand all lines: docs/en/manuals/importing-assets.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ When the assets are imported into Defold they can be used by the various compone
26
26
* Images can be used to create many kinds of visual components frequently used in 2D games. Read more about [how to import and use 2D graphics here](/manuals/importing-graphics).
27
27
* Sounds can be used by the [Sound component](/manuals/sound) to play sounds.
28
28
* Fonts are used by the [Label component](/manuals/label) and by [text nodes](/manuals/gui-text) in a GUI.
29
-
* glTF and Collada models can be used by the [Model component](/manuals/model) to show 3D models with animations. Read more about [how to import and use 3D models here](/manuals/importing-models).
29
+
* glTF models can be used by the [Model component](/manuals/model) to show 3D models with animations. Read more about [how to import and use 3D models here](/manuals/importing-models).
Copy file name to clipboardExpand all lines: docs/en/manuals/importing-models.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ brief: This manual covers how to import 3D models used by the model component.
4
4
---
5
5
6
6
# Importing 3D models
7
-
Defold currently support models, skeletons and animations in GL Transmission Format *.glTF*and Collada *.dae*format. You can use tools such as Maya, 3D Max, Sketchup and Blender to create and/or convert 3D models into glTF and Collada format. Blender is a powerful and popular 3D modeling, animation and rendering program. It runs on Windows, macOS and Linux and is freely available for download at http://www.blender.org
7
+
Defold currently support models, skeletons and animations in GL Transmission Format *.glTF* format. You can use tools such as Maya, 3D Max, Sketchup and Blender to create and/or convert 3D models into glTF format. Blender is a powerful and popular 3D modeling, animation and rendering program. It runs on Windows, macOS and Linux and is freely available for download at http://www.blender.org
8
8
9
9

10
10
@@ -17,8 +17,8 @@ To import the model, simply drag and drop the *.gltf* file or *.dae* file and th
17
17
Once you have the model imported into Defold you can use it in a [Model component](/manuals/model).
18
18
19
19
20
-
## Exporting to glTF and Collada
21
-
The exported *.gltf*or *.dae*file contain all the vertices, edges and faces that make up the model, as well as _UV coordinates_ (what part of the texture image maps to a certain part of the mesh) if you have defined them, the bones in the skeleton and animation data.
20
+
## Exporting to glTF
21
+
The exported *.gltf* file contain all the vertices, edges and faces that make up the model, as well as _UV coordinates_ (what part of the texture image maps to a certain part of the mesh) if you have defined them, the bones in the skeleton and animation data.
22
22
23
23
* A detailed description on polygon meshes can be found on http://en.wikipedia.org/wiki/Polygon_mesh.
24
24
@@ -30,8 +30,6 @@ Defold imposes some limitations on exported animation data:
30
30
31
31
* Animations are also linearly interpolated. If you do more advanced curve interpolation the animations needs to be prebaked from the exporter.
32
32
33
-
* Animation clips in Collada are not supported. To use multiple animations per model, export them into separate *.dae* files and gather the files into an *.animationset* file in Defold.
34
-
35
33
### Requirements
36
34
When you export a model it's good to know that we don't yet support all features.
37
35
Currently known issues/not supported features from the glTF format:
Copy file name to clipboardExpand all lines: docs/en/manuals/model-animation.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,8 +28,6 @@ end
28
28
Defold currently supports only baked animations. Animations need to have matrices for each animated bone each keyframe, and not position, rotation and scale as separate keys.
29
29
30
30
Animations are also linearly interpolated. If you do more advanced curve interpolation the animations needs to be prebaked from the exporter.
31
-
32
-
Animation clips in Collada are not supported. To use multiple animations per model, export them into separate *.dae* files and gather the files into an *.animationset* file in Defold.
Copy file name to clipboardExpand all lines: docs/en/manuals/model.md
+18-10Lines changed: 18 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,21 @@ With the model created you need to specify a number of properties:
23
23
Apart from the properties *Id*, *Position* and *Rotation* the following component specific properties exist:
24
24
25
25
*Mesh*
26
-
: This property should refer to the glTF *.gltf* or Collada *.dae* file that contains the mesh to use. If the file contains multiple meshes, only the first one is read.
26
+
: This property should refer to the glTF *.gltf* file that contains the mesh to use. If the file contains multiple meshes, only the first one is read.
27
+
28
+
*Create GO Bones*
29
+
: Check this to create a game object for every bone of the model. You can use the game objects to attach other game objects such as weapons to hand bones and so on.
30
+
31
+
*Skeleton*
32
+
: This property should refer to the glTF *.gltf* file that contains the skeleton to use for animation. Note that Defold requires a single root bone in your hierarchy.
33
+
34
+
*Animations*
35
+
: Set this to the *Animation Set File* that contains the animations you want to use on the model.
36
+
37
+
*Default Animation*
38
+
: This is the animation (from the animation set) that will be automatically played on the model.
39
+
40
+
In addition to the properties above there will also be a field to assign a material for every mesh of the model:
27
41
28
42
*Material*
29
43
: Set this property to a material you have created that is suitable for a textured 3D object. There are a number of built-in materials that you can use as a starting point:
@@ -33,17 +47,11 @@ Apart from the properties *Id*, *Position* and *Rotation* the following componen
33
47
* Use *model_skinned.material* for skinned (animated) non-instanced models
34
48
* Use *model_skinned_instances.material* for skinned (animated) instanced models
35
49
50
+
Depending on the material there will be one or more texture properties:
51
+
36
52
*Texture*
37
53
: This property should point to the texture image file that you want applied to the object.
38
54
39
-
*Skeleton*
40
-
: This property should refer to the glTF *.gltf* or Collada *.dae* file that contains the skeleton to use for animation. Note that Defold requires a single root bone in your hierarchy.
41
-
42
-
*Animations*
43
-
: Set this to the *Animation Set File* that contains the animations you want to use on the model.
44
-
45
-
*Default Animation*
46
-
: This is the animation (from the animation set) that will be automatically played on the model.
47
55
48
56
## Editor manipulation
49
57
@@ -95,7 +103,7 @@ A model also has a number of different properties that can be manipulated using
95
103
96
104
## Material
97
105
98
-
3D software commonly allows you to set properties on your object vertices, like coloring and texturing. This information goes into the glTF *.gltf*or Collada *.dae*file that you export from your 3D software. Depending on the requirements of your game you will have to select and/or create appropriate and _performant_ materials for your objects. A material combines _shader programs_ with a set of parameters for rendering of the object.
106
+
3D software commonly allows you to set properties on your object vertices, like coloring and texturing. This information goes into the glTF *.gltf* file that you export from your 3D software. Depending on the requirements of your game you will have to select and/or create appropriate and _performant_ materials for your objects. A material combines _shader programs_ with a set of parameters for rendering of the object.
99
107
100
108
There are a number of built-in materials that you can use as a starting point:
Copy file name to clipboardExpand all lines: docs/en/tutorials/grading.md
+3-8Lines changed: 3 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,14 +114,9 @@ That's all we need to do. If you run the game now it will draw everything to the
114
114
115
115
To draw the pixels in the render target's color buffer onto the screen, we need to set something up that we can texture with the pixel data. For that purpose we are going to use a flat, quadratic 3D model.
116
116
117
-
Create a quadratic plane mesh in Blender (or any other 3D modelling program). Set the vertex coordinates to -1 and 1 on the X-axis and -1 and 1 on the Y axis. Blender has the Z-axis up by default so you need to rotate the mesh 90° around the X-axis. You should also make sure that you generate correct UV-coordinates for the mesh. In Blender, enter Edit Mode with the mesh selected, then select <kbd>Mesh ▸ UV unwrap... ▸ Unwrap</kbd>.
118
-
119
-

120
-
121
-
1. Export the model as a Collada file called *`quad.dae`* and drag it into your Defold project.
122
-
2. Open *`main.collection`* and create a new game object called "`grade`".
123
-
3. Add a Model component to the "`grade`" game object.
124
-
3. Set the *Mesh* property of the model component to the *`quad.dae`* file.
117
+
1. Open *`main.collection`* and create a new game object called "`grade`".
118
+
2. Add a Model component to the "`grade`" game object.
119
+
3. Set the *Mesh* property of the model component to the *`quad.gltf`* file found in `builtins/assets/meshes`.
125
120
126
121
Leave the game object unscaled at origin. Later, when we render the quad we will project it so it fills the whole screen. But first we need a material and shader programs for the quad:
Copy file name to clipboardExpand all lines: docs/en/tutorials/shadertoy.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,11 +29,10 @@ Blender is a free, open-source 3D software which can be downloaded from [blender
29
29
30
30

31
31
32
-
1. Export the model as a *Collada* file called *`quad.dae`* and drag it into a new Defold project.
33
-
2. Open your "main.collection" file in Defold and create a new game object "star-nest".
34
-
3. Add a *Model* component to "star-nest".
35
-
4. Set the *Mesh* property to the *`quad.dae`* file.
36
-
5. The model is small (2⨉2 units) so we need to scale the "star-nest" game object to a reasonable size. 600⨉600 is a nice large size so set the X and Y scale to 300.
32
+
1. Open your "main.collection" file in Defold and create a new game object "star-nest".
33
+
2. Add a *Model* component to "star-nest".
34
+
3. Set the *Mesh* property to the *`quad.gltf`* file found in `builtins/assets/meshes`.
35
+
4. The model is small (2⨉2 units) so we need to scale the "star-nest" game object to a reasonable size. 600⨉600 is a nice large size so set the X and Y scale to 300.
37
36
38
37
The model should appear in the scene editor, but it is rendered all black. That is because it has no material set yet:
0 commit comments