如何通过 Win2d 使用顶点着色器

How to use vertex shader via Win2d

我阅读并查看了很多关于 Win2D 的资料,发现 I can use custom pixel and vertex shaders

我找到了如何创建自定义像素着色器资源

        var bitmapTiger = await CanvasBitmap.LoadAsync(sender, "imageTiger.jpg");
        tigerSize = bitmapTiger.Size.ToVector2();

        effect = new PixelShaderEffect(await Utils.ReadAllBytes("my_pixel_shader.fxo"))
        {
            Source1 = bitmapTiger,
            Source1BorderMode = EffectBorderMode.Hard,
            Source1Mapping = SamplerCoordinateMapping.Offset,
            MaxSamplerOffset = 1
        };

但是我找不到如何通过 Win2D 创建顶点着色器资源。

提前致谢

正如 site you linked 所述:

Unfortunately, it is not possible to add custom image effects to Win2D today.

现在这是错误的!
但不幸的是,目前 Win2D 只提供了一种使用 pixel shaders. If you want to use vertex shaders you have to use Direct3D. There is an Example Gallery with an example how to mix Direct3D with Win2D (the one with the teapot) and you can find the code on GitHub 的方法。我不知道这是否对你有帮助,但我能找到的就这些了。