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: extension-rive/index.md
+26-14Lines changed: 26 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,7 @@ brief: This manual describes how to show Rive animations using the Rive extensio
13
13
14
14
15
15
## Requirements
16
-
In order to use Rive animations you need to run Defold 1.2.188 or higher.
17
-
16
+
In order to use Rive content, you will need to run Defold 1.9.5 or higher.
18
17
19
18
## Installation
20
19
Rive animation support in Defold is provided through an official Rive extension. To use Rive animations in a Defold project, add the following URL to the list of `game.project` dependencies:
@@ -23,18 +22,38 @@ Rive animation support in Defold is provided through an official Rive extension.
23
22
24
23
We recommend using a link to a zip file of a [specific release](https://github.com/defold/extension-rive/releases).
25
24
25
+
## Windows
26
+
To use Rive on Windows, you need to make sure OpenGL 4.2 or later is used in the engine. To do this, set the `OpenGL version hint` to either 4.2 or `Use highest available`:
27
+
28
+

29
+
30
+
## Rendering
26
31
27
-
## Render script setup
28
-
Rive components are rendered using a method called "Stencil, then cover" (StC). This requires Rive components to render with the stencil buffer enabled in the render script:
32
+
The Rive extension is using a native renderer from the [Rive runtime]()https://github.com/rive-app/rive-runtime itself by issuing raw graphics API calls behind the scenes.
33
+
The low-level renderer doesn't rasterize rive paths using regular triangles - instead a complex series of draw commands are issued that will produce smooth vector graphics.
34
+
With this in mind, there are a few caveats for how the renderer works together with the regular Defold rendering.
35
+
36
+
### Projection matrix
37
+
The Rive API does not have an exposed projection matrix that can be set, which means that in order to match the Rive coordinate space, a fullscreen projection is used in the render script:
For convenience, there is a modified render script included with this extension. Open your *game.project* file and modify the `Render` field in the `Bootstrap` section to use the `defold-rive/lua/rive.render` file from this extension.
45
+
This means that you can put Defold and Rive content in the same coordinate space if you want to mix and match regular Defold content with Rive.
46
+
47
+
For convenience, there is a modified render script included with the projection matrix extension. Open your *game.project* file and modify the `Render` field in the `Bootstrap` section to use the `defold-rive/lua/rive.render` file from this extension.
48
+
49
+
### View matrix
37
50
51
+
View matrices are supported, but only in 2D space since Rive content is essentially orthographic by design.
52
+
For example, using the view matrix from a camera component can be used to implement camera effects, such as screen shakes or as a regular game camera in 2D.
53
+
54
+
### Blending
55
+
56
+
Blending is currently only supported from within the .riv files themselves. Changing the blend mode on the component or the render script will have no effect.
38
57
39
58
## Concepts
40
59
*Rive data file*
@@ -76,9 +95,6 @@ Apart from the properties *Id*, *Position* and *Rotation* the following componen
76
95
*Rive Scene*
77
96
: Set this to the Rive scene file to use for this model.
78
97
79
-
*Blend Mode*
80
-
: If you want a blend mode other than the default `Alpha`, change this property.
81
-
82
98
*Material*
83
99
: If you need to render the model with a custom material, change this property.
84
100
@@ -89,10 +105,6 @@ Apart from the properties *Id*, *Position* and *Rotation* the following componen
89
105
: Set this to the animation you want the model to start with.
90
106
91
107
92
-
### Blend modes
93
-
{% include shared/en/blend-modes.md %}
94
-
95
-
96
108
## Runtime manipulation
97
109
*Rive Model* components can be manipulated at runtime through a number of different functions and properties (refer to the [API docs for usage](/extension-rive/rive_api/)).
0 commit comments