SkiaTexture output

Hello everyone :)
I don’t understand why skiaTexture doesn’t give me the texture output that I’m expecting.
I’ve tried different formats but the output is always different from the input.
For sure I’m missing something… Someone can help me?


renders.vl (39.5 KB)

Thank you very much :)
Marti

I guess this is a transparency issue. looks like your boxes come with transparent background and your “ClearColor” on skia texture draws a white background. Set Clear color alpha to zero.

@tebjan why is 16bit set as standard?

image

Hi @schlonzo!
Thanks for the answer :)
The alpha doesn’t solve the problem :(

image

skiatexture-test.vl (9.0 KB)
this is the semplified patch

thanks!

image

you don’t need to render the image twice. “SkiaTexture” is a renderer itself. Just input your SKIA elements directly into it. Still, it is interesting why the double renderer construction fails. Can anybody shed some light on this?

image

Yes,
you are right! I can manage in another way the patch… Thanks a lot :)

@schlonzo Trying to shed some light on this:

Stride and Skia use different graphics devices. The images / textures they produce via nodes like Renderer (Offscreen) or TextureRenderer are bound to their specific devices. Accessing them from another device is not possible. In your example patch we run exactly into that situation, the DrawImage wants to read from an image which belongs to the device of the “Skia world” while it itself is rendering onto a surface of the “Stride world”.

A workaround would be to “download” the image from GPU to CPU accessible memory in between with a node called ToRasterImage. Sadly such a download is rather expensive. There’s more efficient way with the SkImageToVideoStream and then going back with VideoStreamToSkImage, but those nodes will introduce some sort of delay of ~2-3 frames.

The optimal solution would be that both Skia and Stride use the same graphics device, however there are some still unsresolved issues which prevent us from doing that.

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.