# Rive BETA - Textured meshes

**URL:** <https://forum.defold.com/t/rive-beta-textured-meshes/72874>\
**Category:** Announcements\
**Created:** [March 16, 2023, 7:16am UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874 "2023-03-16T07:16:56Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [March 16, 2023, 7:16am UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/1 "2023-03-16T07:16:57Z")

</div>

We’re pleased to share the latest update to the Rive integration in Defold: **Textured mesh support**!

The new runtime can now mix vector and raster graphics in the same scene, or used raster graphics exclusively. The use of raster graphics combined with Rive animations can quickly breathe life into images:

The new runtime is now available for testing and we invite you to take it for a spin. Here’s how to test it:

- Use the [Defold 1.4.4 beta](https://forum.defold.com/t/defold-1-4-4-beta/72854) when testing.
- Use the [textured mesh pre-release](https://github.com/defold/extension-rive/releases/tag/1.1) of the Rive extension.

Notes: The editor preview is currently not rendering the raster graphics. This will be fixed in an update next week.

To use raster graphics you provide the .rivescene file with an Atlas file containing the images used:

 ![Screenshot 2023-03-16 at 08.15.41](https://forum-defold-uploads.b-cdn.net/original/3X/4/d/4de4401073f8990252478fd0eaf95c2028bee718.png)

Note: The names of the images in the atlas must match the names used in the Rive editor when creating the .riv file.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [March 16, 2023, 2:45pm UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/2 "2023-03-16T14:45:41Z")

</div>



---

<div class="post-metadata">

**Author:** ![Pedro\_Alpera](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pedro_alpera/32/31727_2.png) [@Pedro\_Alpera](https://forum.defold.com/u/Pedro_Alpera)\
**Post date:** [March 17, 2023, 7:43am UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/3 "2023-03-17T07:43:27Z")

</div>

Hi!, I’m using a character made in Rive, and I can import it, and use it, but there is this darker border .  
For example the cheeks are in a different image (everything are PNGs), and they have like a dark pixel in the outside. Is this normal?

![](https://media.discordapp.net/attachments/847403264197787698/1085998022187565238/image.png)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [March 17, 2023, 7:56am UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/4 "2023-03-17T07:56:01Z")

</div>

> [@Pedro\_Alpera](#):
>
> For example the cheeks are in a different image (everything are PNGs), and they have like a dark pixel in the outside. Is this normal?

Did you try enabling multi-sampling like @jhonny.goransson suggested on Discord yesterday?

> **[Samples - Defold project settings](https://defold.com/manuals/project-settings/#samples)**
>
> The file game.project contains all project wide settings. It must stay in the root folder of the project and must be named game.project. The first thing the engine does when starting up and launching your game is look for this file. | This manual...

---

<div class="post-metadata">

**Author:** ![jhonny.goransson](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jhonny.goransson/32/3864_2.png) [@jhonny.goransson](https://forum.defold.com/u/jhonny.goransson)\
**Post date:** [March 17, 2023, 8:23am UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/5 "2023-03-17T08:23:00Z")

</div>

I think it’s a different issue related to alpha blending. I have noticed the same thing on other textured meshes, but I don’t know exactly what the issue is but I’ll take a look..

---

<div class="post-metadata">

**Author:** ![Pedro\_Alpera](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pedro_alpera/32/31727_2.png) [@Pedro\_Alpera](https://forum.defold.com/u/Pedro_Alpera)\
**Post date:** [March 17, 2023, 8:33am UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/6 "2023-03-17T08:33:40Z")

</div>

Yes, I tried that, but it’s the same. I tried for example to put the same color over the body, and if the spot has aliasing it makes this darker border too.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [March 17, 2023, 8:36am UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/7 "2023-03-17T08:36:46Z")

</div>

@jhonny.goransson Could it be a premultiplied alpha issue?

---

<div class="post-metadata">

**Author:** ![jhonny.goransson](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jhonny.goransson/32/3864_2.png) [@jhonny.goransson](https://forum.defold.com/u/jhonny.goransson)\
**Post date:** [March 17, 2023, 9:04am UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/8 "2023-03-17T09:04:05Z")

</div>

Yes, that’s what I’m thinking as well

---

<div class="post-metadata">

**Author:** ![Pedro\_Alpera](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pedro_alpera/32/31727_2.png) [@Pedro\_Alpera](https://forum.defold.com/u/Pedro_Alpera)\
**Post date:** [March 17, 2023, 3:00pm UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/9 "2023-03-17T15:00:36Z")

</div>

I have uploaded the project here if you want to test it: [Unique Download Link | WeTransfer](https://we.tl/t-Qwra6DwHWb)

These are the Display Settings:

 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/c/6/c6e2495f942e57e460e424ff967213541c31c65b.png)

---

<div class="post-metadata">

**Author:** ![Dragosha](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dragosha/32/5103_2.png) [@Dragosha](https://forum.defold.com/u/Dragosha)\
**Post date:** [March 21, 2023, 8:14am UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/10 "2023-03-21T08:14:54Z")

</div>

Well, this is the very first time I have tried Rive. And here is some early feedback.  
I’ve reworked an idle animation from my Spine skeleton model in Rive. Here it’s in the Rive html5 preview:

> **[Test](https://rive.app/s/rvm9tShXyECLqB9Ogs1dNA/)**

This is what it looks like in Defold (pretty fine):

**Project:**

> **[GitHub - Dragosha/rive\_test](https://github.com/Dragosha/rive_test)**
>
> Contribute to Dragosha/rive\_test development by creating an account on GitHub.

**Issues:**  
When I tried to build HTML5, there is a build error:

 ![2023-03-21_12-11-18](https://forum-defold-uploads.b-cdn.net/original/3X/3/1/316b1305b28e227de1037d4e4afdd05bd7967774.png)

_Not an issue at all, but touches on performance question:_  
Each mesh/object within Rive model generates one drawcall?  
Also I found that duplicate on scene the same model make x2 to drawcalls.  
one model: 10  
two: 18

 ![2023-03-21_11-00-01](https://forum-defold-uploads.b-cdn.net/original/3X/3/3/3379a3ec09758bdedcf7c6277cf0408a87b0a9db.png)

It looks the Spine component has much more optmized batching proccess. As far as I can remember, the same skeleton was rendered in 1 drawcall and duplicate models in world coordinates met the same drawcall.

**Workflow or “Rive compare to Spine?”**

It seems to me, I could be wrong of course, that Rive is much better than Spine for UI, splash screens and characters in mobile applications (ideal for make an app mascot like an owl in Duolingo 🦉), and most importantly it has vector animation.

However, there are some compromises or things that are not obvious in Rive.  
For example. I missed in the Rive documentation any mention of swapping images at runtime, or even just during animation (sequencing). What in Spine is called the slot and the attachments. And more generally, **skins**. I’m not sure if it’s possible to make a dressup doll now.

There are also questions about whether the IK system can be controlled at runtime, e.g. is it possible for a character’s hands with a weapon to follow the cursor. Maybe this is solved by state machines and the input system in Rive, I haven’t figured it out yet, and as far as I know we can’t pass inputs within the Rive component yet.

There are certain differences in the construction of the skeleton and the rigging model. You have to be careful when creating the bones and editing the mesh. I am a beginner, but a skilled caller of this image in the desktop version of Rive Editor 😭:

 ![2023-03-21_12-28-31](https://forum-defold-uploads.b-cdn.net/original/3X/9/4/94524bf1f29d130daa6a04a6e81d54fed4ca8b86.png)

Fortunately, the editor loads very quickly and all changes are synchronised with the cloud.  
Overall, I find the Rive.app very interesting and promising for game development.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [March 21, 2023, 8:33am UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/11 "2023-03-21T08:33:14Z")

</div>

HI @Dragosha !

Thanks for your detailed feedback!

Yes, the number of draw calls is an issue with the current renderer.  
Later this year, it’ll get the [updated renderer](https://twitter.com/guidorosso/status/1595187838454140928?s=20) which is tesselated on the gpu and should generate 1 draw call. You’ll get perfectly rounded corners and antialiasing.

As for setting properties on a state machine, that is already possible via `go.set()`:  
[This example](https://github.com/defold/extension-rive/blob/main/main/statemachine/statemachine.script#L18) has a boolean property called `Press` to trigger an animation.

The receiving [source code](https://github.com/defold/extension-rive/blob/main/defold-rive/src/comp_rive.cpp#L1130-L1177) can currently handle boolean and numbers.  
For a specific IK thing, we might need to look into how that’s currently handled in Rive.

As for the other comparisons to Spine, I think they’ll get there. They just need more feedback, requests and time 🙂

---

<div class="post-metadata">

**Author:** ![Dragosha](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dragosha/32/5103_2.png) [@Dragosha](https://forum.defold.com/u/Dragosha)\
**Post date:** [March 24, 2023, 12:01pm UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/12 "2023-03-24T12:01:58Z")

</div>

Hey! Another day, another rive. Defold runtime:

  
Html5: [rive\_test 1.0](https://dragosha.com/defold/rive_test/)

I have a question about integrating Rive into the project. The Rive editor has an export to a “.riv” file. If the file contains multiple Artboards and we export the selected one to ._riv_, Defold selects that artboard as connected in rivescene. But looking at the size of the _riv_ file, I will assume the file contains _all the artboards_ of the project at once. **Is it possible to make an additional setting of which artboard should be included in the rivescene?** This will avoid duplication of resources.

Rive artboards :

 ![2023-03-24_14-46-44](https://forum-defold-uploads.b-cdn.net/original/3X/9/e/9eee77b93b8d5edb9623403bf3ab484c387fc6ce.png)

Build resources:  
new\_file.riv - skeleton  
new\_file2.riv - hero

 ![2023-03-24_15-28-35](https://forum-defold-uploads.b-cdn.net/original/3X/e/9/e9c4c7fbdc006ea046118a078256a6bb19ab9ef9.png)

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [March 24, 2023, 12:24pm UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/13 "2023-03-24T12:24:39Z")

</div>

They have a different setup, where all assets goes into a single .riv file.  
That’s not how our engine is designed in general.  
However, it should still be possible to select artboard from a rive file. Let’s add it as a feature request.

Also, we’ve asked them for a feature where the .pngs aren’t included in the .riv file.  
But it’s not live yet afaik.

---

<div class="post-metadata">

**Author:** ![Dragosha](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dragosha/32/5103_2.png) [@Dragosha](https://forum.defold.com/u/Dragosha)\
**Post date:** [April 13, 2023, 7:09am UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/14 "2023-04-13T07:09:06Z")

</div>

> [@Dragosha](#):
>
> I missed in the Rive documentation any mention of swapping images at runtime, or even just during animation (sequencing). What in Spine is called the slot and the attachments. And more generally, **skins**. I’m not sure if it’s possible to make a dressup doll now.

Seems, this feature called as _solos_:

[![](https://img.youtube.com/vi/4z364R6YpJw/maxresdefault.jpg "Solos just dropped!") ](https://www.youtube.com/watch?v=4z364R6YpJw)

---

<div class="post-metadata">

**Author:** ![jhonny.goransson](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jhonny.goransson/32/3864_2.png) [@jhonny.goransson](https://forum.defold.com/u/jhonny.goransson)\
**Post date:** [April 19, 2023, 8:14am UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/15 "2023-04-19T08:14:10Z")

</div>

We have just released a new version of the extension that adds support for previewing textured meshes in the editor:

> **[Release Textured mesh support in editor · defold/extension-rive](https://github.com/defold/extension-rive/releases/tag/1.2)**
>
> Added previews for textured meshes in the editor.
> Requires Defold 1.4.5+

For the editor preview, this version requires Defold 1.4.5+ to work correctly, which is currently in beta [Release v1.4.5 - beta · defold/defold · GitHub](https://github.com/defold/defold/releases/tag/1.4.5-beta)

Please give it a spin and let us know if there are any issues!

---

<div class="post-metadata">

**Author:** ![Dragosha](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dragosha/32/5103_2.png) [@Dragosha](https://forum.defold.com/u/Dragosha)\
**Post date:** [April 19, 2023, 11:00am UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/16 "2023-04-19T11:00:53Z")

</div>

> [@jhonny.goransson](#):
>
> Please give it a spin and let us know if there are any issues!

Hm, in editor preview works, but something broken with runtime render now:

 ![2023-04-19_15-49-35](https://forum-defold-uploads.b-cdn.net/original/3X/b/2/b25c4a592710b9bbd82854a7fb37f288566a786c.png)

Defold Beta 1.4.5  
Rive 1.2

project: [GitHub - Dragosha/rive\_test · GitHub](https://github.com/Dragosha/rive_test)

---

<div class="post-metadata">

**Author:** ![jhonny.goransson](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jhonny.goransson/32/3864_2.png) [@jhonny.goransson](https://forum.defold.com/u/jhonny.goransson)\
**Post date:** [April 19, 2023, 11:56am UTC](https://forum.defold.com/t/rive-beta-textured-meshes/72874/17 "2023-04-19T11:56:46Z")

</div>

I’ll take a look! Thanks!
