SkiaRenderer(Stride) ignores Blend Mode

The issue is, that “SkiaTexture” and “SkiaRenderer” are ignoring Blend Modes of Skia. Also the PixelFormat cannot be changed.
When using a Stride Render Window the output is correct.


SkiaRendererBug.vl (17.9 KB)

Hey there, looks like a bug to me, for the blending you can atleast try to use “precompose” to fix it, not sure if this has a negative impact on the output quality.

SkiaRendererBug.vl (18.7 KB)

1 Like

Back then I left the following comment in the code(VL.StandardLibs/VL.Stride.Runtime/src/SkiaRenderer.cs at a16f0124e144bbe5d62e4cb06a7b1b5b9864c4b3 · vvvv/VL.StandardLibs · GitHub):

// Output looks correct in the following cases:
// - Rendering to swap chain, the render target is non-srgb while the view is srgb
// - Rendering to a typeless texture with a srgb view
// In those cases we can assume the hardware is taking care of interpreting the bits correctly.

// In all other cases we can somewhat "fix" the colors by telling Skia to use a linear colorspace,
// but alpha blending is still somewhat broken leading to wrong output. For example use the "Randomwalk" Skia help patch.
                
// Blending results are even worse when using a floating point texture. This also seems independent of the used color space.

// TODO: Should we change the default of the RenderTexture node to use a typeless format? Or at least adjust the SkiaTexture node?
// TODO: Re-evaluate this part once Skia has the srgb flags (see comment in https://discourse.vvvv.org/t/combining-stride-and-skia-render-engine/19798/8)

The first TODO I just tried and it seems something reasonable comes out, see attached patch (I copied the relevant nodes out from Stride and prefixed them with Typeless).

The second one we need to wait on SkiaSharp 3, but since that one has a lot of breaking changes and is still in preview it will take a while to actually see whether it works there.

SkiaRendererBug_Typeless.vl (83.1 KB)

1 Like

This fixes my use cases for now. Thanks for looking into it.