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
I'm new to React Native Skia and I'm trying to understand how RuntimeShader interacts with Group layer rendering.
My goal is to render a layer, access it from a runtime shader, and use an additional ImageShader as a mask texture.
I created a minimal example and noticed that introducing a second uniform shader appears to change the behavior significantly. Before assuming this is a bug, I'd like to confirm whether I'm misunderstanding how shader uniforms are supposed to be passed and evaluated in this setup.
Could someone clarify whether the following usage is expected to work?
There are three shaders in the file.
Variant 1 (my intended effect)
This shader uses:
currentFrameTexture (the layer contents)
alphaTexture (a noise texture)
The goal is to apply the noise texture as an alpha mask over the layer contents.
Currently, it renders a solid opaque circle instead of a masked one.
Screenrecorder-2026-06-04-23-09-46-459.mp4
Variant 2
If I uncomment the second shader, it renders a semi-transparent circle that continuously scrolls horizontally, which is the expected result.
Screenrecorder-2026-06-04-23-09-17-866.mp4
Variant 3
If I uncomment the third shader, which is identical to Variant 2 except for an additional unused line: uniform shader image2;
the result changes back to a solid opaque circle.
In other words, simply declaring a second shader uniform appears to affect the behavior, even though that uniform is never sampled.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm new to React Native Skia and I'm trying to understand how RuntimeShader interacts with Group layer rendering.
My goal is to render a layer, access it from a runtime shader, and use an additional ImageShader as a mask texture.
I created a minimal example and noticed that introducing a second uniform shader appears to change the behavior significantly. Before assuming this is a bug, I'd like to confirm whether I'm misunderstanding how shader uniforms are supposed to be passed and evaluated in this setup.
Could someone clarify whether the following usage is expected to work?
There are three shaders in the file.
Variant 1 (my intended effect)
This shader uses:
currentFrameTexture(the layer contents)alphaTexture(a noise texture)The goal is to apply the noise texture as an alpha mask over the layer contents.
Currently, it renders a solid opaque circle instead of a masked one.
Screenrecorder-2026-06-04-23-09-46-459.mp4
Variant 2
If I uncomment the second shader, it renders a semi-transparent circle that continuously scrolls horizontally, which is the expected result.
Screenrecorder-2026-06-04-23-09-17-866.mp4
Variant 3
If I uncomment the third shader, which is identical to Variant 2 except for an additional unused line:
uniform shader image2;the result changes back to a solid opaque circle.
In other words, simply declaring a second shader uniform appears to affect the behavior, even though that uniform is never sampled.
Here's the full code:
I'm happy to open an issue if this turns out to be unintended behavior.
Thanks!
Environment
Device: Physical Android
@shopify/react-native-skia: 2.6.3
react-native:0.83.1
react:19.2.0
react-native-reanimated:4.3.1
Beta Was this translation helpful? Give feedback.
All reactions