Rive BETA - Textured meshes

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:

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:

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

24 Likes

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?

1 Like

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

1 Like

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…

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.

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

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

I have uploaded the project here if you want to test it: https://we.tl/t-Qwra6DwHWb

These are the Display Settings:

3 Likes

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:

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

Project:

Issues:
When I tried to build HTML5, there is a build error:
2023-03-21_12-11-18

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

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 :owl:), 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 :sob::

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.

11 Likes

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 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 has a boolean property called Press to trigger an animation.

The receiving source code 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 :slight_smile:

10 Likes

Hey! Another day, another rive. Defold runtime:


Html5: 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 :

Build resources:
new_file.riv - skeleton
new_file2.riv - hero

10 Likes

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.

8 Likes

Seems, this feature called as solos:

11 Likes

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

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

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

9 Likes

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

Defold Beta 1.4.5
Rive 1.2

project: https://github.com/Dragosha/rive_test

7 Likes

I’ll take a look! Thanks!

1 Like