429 Commits

Author SHA1 Message Date
aliasbinman
b3854908e6 Fix path extraction (#10823) 76a19909c5
* Update contour_measure.cpp

* Update trim_test.cpp

* Update trim_test.cpp

* Update contour_measure.cpp

* clang format

* Update contour_measure.cpp

Co-authored-by: John White <aliasbinman@gmail.com>
2025-10-21 16:10:56 +00:00
bodymovin
007969f903 feature: add support for pausing nested artboards (#10833) 0a3cb5ac3e
* feature: add support for pausing nested artboards

Co-authored-by: hernan <hernan@rive.app>
2025-10-20 16:10:14 +00:00
philter
f47345a807 feat: Scripted Enum (#10829) 650a980d41
Adds support for ScriptedEnums (ViewModel enums). This PR does not include enums as Inputs, that will follow subsequently

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2025-10-18 20:22:26 +00:00
bodymovin
33c9051b6a feature: add scroll threshold (#10824) 284c801953
Co-authored-by: hernan <hernan@rive.app>
2025-10-17 22:11:56 +00:00
philter
b76aed4366 feat: Scripted Boolean (#10804) cb93fbb138
Adds support for scripted booleans and boolean inputs.

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2025-10-17 16:27:01 +00:00
csmartdalton
bf56af7f64 feat: Add PLS backings to the RenderContext resource manager (#10793) 2fe0021c07
Before this change, renderer backends were responsible for allocating
any textures or buffers required to back pixel local storage data. They
all did this by allocating separate backings for each render target,
which is wasteful on systems with multiple render targets.

This change adds PLS backings to the RenderContext's resource tracking
system, and allocates one global PLS backing with the dimensions of the
largest recent render targets. For now, only GL is updated to take
advantage of this resource, but other backends should follow soon.

It also merges the transient PLS backings into a single logical
TEXTURE_2D_ARRAY, as opposed to separate TEXTURE_2Ds. Allocating the PLS
backings in a 3D layout appears to get better cache performance on Intel
Arc GPUs.

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-10-16 18:00:13 +00:00
bodymovin
a2e0b08804 feature: add support for artboards as conditions (#10788) dd59b347fb
* feature: add support for artboards as conditions

Co-authored-by: hernan <hernan@rive.app>
2025-10-16 01:32:31 +00:00
JoshJRive
c468e6757b Get the Linux unit tests building and running in the GitHub workflow (#10761) a0b890f273
Co-authored-by: Josh Jersild <joshua@rive.app>
2025-10-15 22:11:25 +00:00
philter
57f06b62e3 Scripting support in CPP (#10685) a34d1ffe15
Get scripting working in CPP runtime. This currently only supports in editor workflow, since some additional backend pieces will be required to get it working in CPP in the runtimes.

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2025-10-15 19:05:13 +00:00
bodymovin
70708343e6 chore: automatically bind view model trees to dependents when any of … (#10782) ae01b2a8c3
* chore: automatically bind view model trees to dependents when any of its children view models is replaced

Co-authored-by: hernan <hernan@rive.app>
2025-10-15 13:56:47 +00:00
philter
6c47e0e4a0 fix(runtime): Font weight layout measure fix (#10766) 0ae985862d
With certain fonts, the expected font features/variations aren't available until a frame after the text is measured, so for example, we measure glyphs using its default weight rather than the weight set in the style, which causes the rendered text not to fit within the measured area, thus incorrectly wrap to the next line. This fix updates variable fonts whenever TextStyle::font() is called IF the variable font hasn't previously been cached.

Specifically this issue was reproducible when using Solos to toggle between components which had text wrapped in layouts.

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2025-10-14 17:32:00 +00:00
bodymovin
a839f067b0 fix: interpolator in cpp runtime (#10752) 01c1b43af9
* fix: interpolator in cpp runtime

Co-authored-by: hernan <hernan@rive.app>
2025-10-14 02:43:50 +00:00
csmartdalton
e4dae96988 feat(gl): Add scissor to GLState (#10748) a3f6433c00
Start tracking scissor state and use it to limit our clear bounds for
pixel local storage backing.

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-10-13 21:29:17 +00:00
bodymovin
334013f14c feature: scripted converters (#10711) a40f07ee54
Co-authored-by: hernan <hernan@rive.app>
2025-10-12 14:03:25 +00:00
philter
d2a3690956 fix(runtime): Invalidate stroke effects on ForegroundLayoutDrawable (#10733) 2f7bed5eb1
Co-authored-by: Philip Chung <philterdesign@gmail.com>
2025-10-08 01:58:08 +00:00
csmartdalton
196a386b7e feat: Add a mechanism to select the integrated GPU on Windows (#10713) 986c92af9a
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-10-07 21:36:44 +00:00
aliasbinman
4753f6fb8d Add mip map lod bias and bilinear types (#10701) 608fb2781f
* Add mip map lod bias and bilinear types

* minor updates

* Removed MAX enums

* Added Image Mesh LOD Bias

* Add metal support

* Add VK support

* WebGPU filter

* Remove lodbias from metal

* clang format

* clang format

* turn off bilinear on GL as a test

* Remove trilinear and miplodbias from sampler states

* Moved miplodbias into shader instructions

* removed trilinear from webgpu

* clang the shaders

* Update image_filter_options.cpp

* fix missing $ in metal.glsl

* fix lua WRT trilinear

* fix missing flushuniforms in metal.glsl for image draw

* Remove lodbias from FRAG_DATA_MAIN

* fix #define

* Update rive_lua_libs.cpp

* Update metal.glsl

* Removed lodbias from image mesh as a test

* Update atomic_draw.glsl

* Update draw_image_mesh.glsl

* Fix unit tests

* Remove whitespace

* Update draw_image_mesh.glsl

* Update image_sampler.hpp

* Update bindings_c2d.cpp

* clang format

* Update render_context_d3d_impl.cpp

* Readd lodbias to draw image mesh

* Update glsl.glsl

* Update draw_image_mesh.glsl

* Update glsl

* Update glsl.glsl

* Update glsl.glsl

* Update glsl.glsl

* Update rhi.glsl

* more lodbias removal

* more lodbias removal

* Update glsl.glsl

* Update glsl.glsl

* Update glsl.glsl

* Remove one image call lodbias

* Update glsl.glsl

* Update glsl.glsl

* Update glsl.glsl

* Update glsl.glsl

* Update glsl.glsl

* Update draw_image_mesh.glsl

* clang format

* Update hlsl.glsl

* Update metal.glsl

* Update rhi.glsl

* clang format

* Update Goldens

* update golden

* more goldens

* Test for metal

* goldens

* metal test fix

* Update gpu.cpp

* revert changes

* Update gpu.cpp

* Update linux golden

* Metal test

* metal test

* Update gpu.cpp

* Update gpu.cpp

* clang format and ios goldens

* Update goldesn

* linux goldens

* move mipmaplodbias in uniforms

* Addres Chris' comments

* More comments addressed

* clang format

Co-authored-by: John White <aliasbinman@gmail.com>
2025-10-07 16:43:45 +00:00
JoshJRive
2c75fcb604 Restructure Vulkan bootstrapping (#10721) 9c66afdd2a
This redoes the Vulkan bootstrapping used by our test apps to use our own internal bootstrapping (rather than VkBootstrap), as well as fixes swapchain issues with a subtly incorrect use of fences.

Co-authored-by: Josh Jersild <joshua@rive.app>
2025-10-07 16:14:16 +00:00
bodymovin
129076c675 fix: cache and reset pointer events (#10707) fd286173b1
* fix: cache and reset pointer events

Co-authored-by: hernan <hernan@rive.app>
2025-10-04 00:10:51 +00:00
blakdragan7
e0b08d44ad Ue fixes (#10705) e6ba6e329a
* Added custom draw function to render targets. Made saving on reimports for rivs not crash. Made generating blueprints 5.6 compatable

* view models now unsettle the state machine.

* now command q gets the view model type name for properties. UE also uses stores this information

* made viewModelProperty work with slashes.

* undo slash support

* removed test slash vm from data_bind_test_cmdq and updated unit tests to match

* updated draw commands

* better saving without crash

* automatic defaults are now working

* don't generate enums every noade. Make them inside the file and cache them.

* make enums public to allow referencing in blueprints

* removed defaults ready delegate

* removed unused class

* PR changes

* missed

Co-authored-by: Jonathon Copeland <jcopela4@gmail.com>
2025-10-03 19:53:21 +00:00
JoshJRive
abd68ec89e fix(vulkan): Correctly support Vulkan 1.0 on Android (#10679) 8e0fadf978
VkBootstrap will incorrecty error with `vulkan_version_1_1_unavailable` on Vulkan 1.0 systems that do not have the vkEnumerateInstanceVersion function, even when we specifically said that it was fine to fall back to 1.0. To work around this, we will detect that error and then try again to create the Vulkan instance, specifically requesting version 1.0.

Additionally fix a "function must return" error when building in MSVC on Windows, and update LOG_ERROR to be LOG_ERROR_LINE to make it clear that it writes lines (and update its use of fprintf to match what the android logging does)

Co-authored-by: Josh Jersild <joshua@rive.app>
2025-10-01 23:33:25 +00:00
bodymovin
89fcbd1e25 Feature: add support for multitouch (#9581) 12764e9a3b
add support for multitouch

Co-authored-by: hernan <hernan@rive.app>
2025-09-30 21:29:34 +00:00
bodymovin
d0faf6e011 feature: add toggle to make scroll constraint not interactive (#10680) 0b069a9936
* feature: add toggle to make scroll constraint not interactive

Co-authored-by: hernan <hernan@rive.app>
2025-09-30 20:23:54 +00:00
bodymovin
6362192a61 data bind artboards rcp file (#10214) c542b9b7ac
* make file ref counted

* migrate File to refcnt

* add bindable artboard class to keep file reference

* feat(unity): support rcp file and BindableArtboard class (#10228)

* refactor(apple): use updated file bindable artboard apis (#10229)

* update command queue to support bindable artboards

* use bindable artboards on command queue

* self manage view model instances in js runtime

* change remaining viewModelInstanceRuntimes to rcp

* refactor(apple): update view model instances to use rcp (#10298)

* refactor(unity): support rcp ViewModelInstanceRuntime (#10309)

* rebase fix

* deprecate getArtboard in favor of getBindableArtboard

* fix merge

* remove unused lambda capture

* fix rive binding

* feat(Android): RCP File, VMI, and add bindable artboards (#10456)

* refactor: C++ refactors

- Import from long (incorrect) -> jlong
- Header clang-tidy fix
- Use reinterpret_cast instead of C-style cast
- Break out some variables instead of long one liners
- Use auto
- Remove unused env and thisObj

# Conflicts:
#	packages/runtime_android/kotlin/src/main/cpp/src/helpers/general.cpp

* docs: Improve documentation on the File class

* feat: Support bindable artboard type and RCP VMIs

# Conflicts:
#	packages/runtime_android/kotlin/src/androidTest/java/app/rive/runtime/kotlin/core/RiveDataBindingTest.kt

* feat: Support RCP files

* refactor: Change from +1/-1 ref to just release

* fix: Moved to the more appropriate null pointer for GetStringUTFChars

* replace unref with release

Co-authored-by: Adam <67035612+damzobridge@users.noreply.github.com>
Co-authored-by: David Skuza <david@rive.app>
Co-authored-by: Erik <erik@rive.app>
Co-authored-by: hernan <hernan@rive.app>
2025-09-30 00:01:40 +00:00
csmartdalton
080ae94b7c test: Add an android_gms_vulkan run to browserstack (#10669) f7613dbf35
Vulkan is ready to stabilize. Let's get it on our nightly runs.

Also disable "atomic" mode on Android unless requested explicitly.
Barriers tend to be expensive on Android and MSAA is usually cheap;
let's stabilize MSAA first.

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-09-29 16:25:14 +00:00
csmartdalton
badcdad8dd fix(vk): Properly preserve render targets when using MSAA (#10630) 5df1a42463
* fix(vk): Properly preserve render targets when using MSAA

Unfortunately, Vulkan does not provide a mechanism to initialize our
(transient) MSAA texture with the contents of the (non-MSAA)
renderTarget texture at the beginning of a render pass. To work around
this limitation while supporting LoadAction::preserveRenderTarget, we
literally draw the previous render target contents into the framebuffer
at the beginning of the pass.

* Fix one more barrier

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-09-27 07:54:28 +00:00
bodymovin
6b729b79e6 chore: add pointer exit support (#10595) d999d6a22c
* add pointer exit support

Co-authored-by: hernan <hernan@rive.app>
2025-09-26 15:42:26 +00:00
susan101566
448877c406 scripting: color and string view model property (#10663) 3acbdfcba7
Description
Adds support for passing a string and color vm property to the scripting engine.
Adds support for defining color and string as inputs.

Co-authored-by: Susan Wang <susan@rive.app>
2025-09-25 21:15:26 +00:00
csmartdalton
fec00ac453 feat: Integrate glfw into the premake build (#10656) 653c8c6040
Build GLFW with premake instead of requiring the user to call out into a
custom script thatbuses their cmake.

feat(scripting): split code panels (#10655) 9d8b49152e
* feature(scripting): command palette

* feature: adding split pane saving

* chore: update to latest luau

* fix: pixel correct scrollbars

* feature: reload scroll position of script pane

* feature: module titles on panes

* chore: merging command palettes

* fix: cleanup

* chore: refactor searchbar tests

* fix: failing test

* chore: cleanup

* chore: cleanup

* chore: cleanup unused commented code

* feature: hover for command palette items

* chore: cleanup mocks

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2025-09-25 20:42:43 +00:00
aliasbinman
1197a7f42c Add loop option to GM (#10649) 0121fd0174
* add loopCount

* add static

* Update gmmain.cpp

* Change while to for

Co-authored-by: John White <aliasbinman@gmail.com>
2025-09-25 18:07:10 +00:00
csmartdalton
abf64c01c1 feat: Web/android testing tweaks and features (#10621) 8cd4d40440
And add a "webserverandroid" target to deploy_tests.py that sets
up reverse port forwarding over ADB so we don't have to rely on the
network.

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-09-24 18:00:26 +00:00
csmartdalton
e54883d909 fix(webgpu): Fix Y orientation on GL zero and nonzero FBOs (#10623) 454b0d2db1
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-09-19 02:18:27 +00:00
philter
4978b05b7d (fix): Artboard list item hit order (#10618) f95ef8fdc5
Since Artboard list items are rendered with z index increasing as the item index increases (ie, later children will sit above earlier children), when doing hit testing, we need to traverse the items in reverse order in order to capture the property z ordering. This is only important when items have overlap.

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2025-09-18 23:05:29 +00:00
JoshJRive
a298c3be23 Add asynchronous shader and pipeline creation to Vulkan renderer (#10591) 3b6e2b6bc4
This gets the Vulkan runtime running with the async pipeline manager.

This required moving a bunch of the internal render context impl classes up to the header, which made the header a bit unwieldy so they got moved out to their own files.

Additionally, this has some changes to the async pipeline manager:
- Vulkan's pipelines have additional information that the other renders' do not, so PipelineProps is now a property of the pipeline type so that it can have its own pipeline type
- Similarly, Vulkan uses a 64-bit index for its pipeline key (so that it can use 32 bits of it as the standard shader key) so that had to be generalized as well
- Moved the vertex shader manager functionality into the pipeline manager because every pipeline should share vertex shaders
- Generalized it so that vulkan can also use it to share other things. This includes fragment shaders which are now managed as shared like vertex shaders were, because on Vulkan multiple pipelines can share the same fragment shader.
- Changed the std::maps to std::unordered_map because the lookup speed should be better (it's a hash map vs. a binary tree)

Co-authored-by: Josh Jersild <joshua@rive.app>
2025-09-18 21:55:53 +00:00
philter
36a807339c chore: Add start/end/offset properties to List follow path (#10606) b2aed6839d
Adds distinct start, end and offset properties for List's follow path as requested by Creative team, to behave similarly to Trim paths. This also fixes an issue where modifying strength wouldn't modify its rotation accordingly.

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2025-09-18 16:26:43 +00:00
philter
ab70997c1a Add silvers for follow path (previously rive_flutter goldens) (#10611) 67f20bfc31
Noticed that the old rive_flutter goldens were removed. With some updates to follow path coming with List follow path, I wanted to make sure those old goldens were captured as silvers prior to the new changes landing. We may want to go back and covert the other goldens in the future.

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2025-09-17 20:08:43 +00:00
bodymovin
7fe208c53c feature: prioritize viewmodel direction from flag (#10514) 4d8e0a9719
* prioritize viewmodel direction from flag

Co-authored-by: hernan <hernan@rive.app>
2025-09-16 21:45:07 +00:00
csmartdalton
edae0548c3 feat(wgpu): Add a wgpu backend to the test suite (#10586) 48bb6538bd
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-09-16 18:32:10 +00:00
JoshJRive
e76d509727 Some vulkan testing fixes (#10597) 21af6591da
- deploy_tests on windows should use `where` which is built in (vs `which` which is not)
- vk bootstrap now displays shaderClipDistance, which was missing from the printing of available features
- vkcore and vksrgb backends now do the correct thing
- added vkmsaacore backend (which currently fails due to a validation error)

Co-authored-by: Josh Jersild <joshua@rive.app>
2025-09-16 17:08:11 +00:00
bodymovin
b70719a157 fix: target to source converter (#10584) 9366e9acea
* feature: add support for color interpolation in converter

* fix: target to source with different types with converter applied

Co-authored-by: hernan <hernan@rive.app>
2025-09-15 20:11:19 +00:00
csmartdalton
66b7376190 fix(gl): Apply ANGLE workarounds in WebGL as well (#10581) 1931264636
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-09-12 21:11:23 +00:00
bodymovin
c71f93176f feature: add support for color interpolation in converter (#10545) b0f6516eec
* feature: add support for color interpolation in converter

Co-authored-by: hernan <hernan@rive.app>
2025-09-12 19:36:02 +00:00
luigi-rosso
a729a7337e feature: scripting prevent infinite exec (#10570) 3afebf3d4f
* feature: working on fullscreen code

* feature(scripting): prevent infinite execution

* fix: missing method for ScriptingTest context

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2025-09-12 18:02:51 +00:00
philter
d68ddf26c6 editor(fix): Fix children collapsed issue when showing/hiding layout (#10566) 15a6eedc71
A layout's collapsed value wasn't being propagated down the tree which resulted in issues if a parent was set to display, but a child layout was set to hidden, it would not hide its contents properly.

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2025-09-11 22:30:33 +00:00
csmartdalton
4e507a4de0 fix(gl): Drop EXT_shader_pixel_local_storage (#10556) 8df4ac1a56
This extension has been an ever-flowing fountain of bugs for us,
especially on PowerVR. Furthermore, it doesn't even work on Pixel 10
(PowerVR D-Series DXT-48-1536).

Let's de-fragment our Android GL renderer and consolidate everything on
MSAA (except for old PowerVR devices where MSAA doesn't work). MSAA is
hopefully a more tried-and-true, less bug-prone rendering mode in the
Android ecosystem anyway, and it's nice to be more consistent across
devices.

The perf story looks positive. On PowerVR, MSAA seems to be generally
faster. On ARM it's always been a mixed bag depending on content.

Either way, this is a nice approach to switch GL to maintenance mode so
we can go all in on Vulkan.

NOTE: We are still keeping EXT_shader_pixel_local_storage as a fallback
for the feather atlas on devices that don't support float rendering.
There are real GPUs where this is our only way to get high quality
feathers.

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-09-11 20:20:23 +00:00
blakdragan7
cdfda2e32d fix(Unreal): Updated UE plugin to no longer do deprecated things (#10555) c799a27dfd
* Remove use of `FRHIResourceCreateInfo` which is now deprecated
* Updated to c++20 because that is the new requirement for UE
* Fixed a bug where the state machine name selection would cause a crash if no state machines are in riv file.
* No longer use raw pointers as `TObjectPtr` are preferred now
* Fixed bug where `#ifdef WITH_RIVE_TOOLS` was missing in `FrameOptions` declaration

Co-authored-by: Jonathon Copeland <jcopela4@gmail.com>
2025-09-11 18:46:47 +00:00
philter
b76cecf1c4 Expose localBounds in CPP (#10537) 0ed12de980
Implement some missing localBounds methods in CPP on core objects that expose this. Basically ported over from Dart. This was requested in order for the new rive_native Flutter runtime to provide a similar API to the legacy Flutter runtime.

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2025-09-10 20:00:09 +00:00
bodymovin
0a6a20a9d5 feature: add support for different random modes (#10538) dab3b5994d
* feature: add support for different random modes

Co-authored-by: hernan <hernan@rive.app>
2025-09-09 23:49:53 +00:00
csmartdalton
78494744c9 fix(gl): Limit the tess/grad instance counts on Mali/PowerVR (#10520) b0646c5c97
fix(gl): Limit the tess/grad instance conts on Mali/PowerVR

Limit the number of instances we draw at a time when rendering the
tessellation and gradient textures. PowerVR and ARM GPUs have been known
to crash when rendering large instance counts. We're already limiting
the instance counts for main draws, but we missed the tessellation and
gradient passes when we added this workaround.

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2025-09-08 17:57:00 +00:00
bodymovin
3524646f44 restore skipping data bind values (#10516) 049120501f
Co-authored-by: hernan <hernan@rive.app>
2025-09-05 18:18:12 +00:00