Skip to content
xtuzy edited this page Feb 28, 2023 · 22 revisions

What is it?

It provide samples show how to use Veldrid in Maui,macOS,WPF project.

What you can do if you use Veldrid in Maui?

Veldrid use some same class and method wrap OpenGL, Metal, D3D11, and Vulkan, so you can get consistent experience when operate GPU on different platform. You can use Veldrid to do things that when use GPU better than use CPU in Maui, such as you can create a library like android-gpuimage, or create cool dynamic background, or show a 3D model.

Supported backend in Maui

  • iOS backend use Metal(bug)/OpenGLES(bug)/Vulkan, Vulkan is better
  • Maccatalyst backend use Vulkan,
  • Android backend use Vulkan/OpenGLES,
  • Windows use D3D11.

Notice:

  • From Samples Run Result to know which backend meets your needs. I advice you use Vulkan in iOS, Maccatalyst.

Process Shader

We know iOS's Metal use msl(Metal shading language), OpenGL use glsl, D3D11 use hlsl, Vulkan use spirv but it is unreadable. We want write shader only use one language, then convert it to others. We can find some solution:

Official Veldrid use shaderc convert glsl to spirv, then use spirv-cross to convert spirv to other language. You can create your tool chain according to these opensource library.

Process model

Official Veldrid use Assimp to load model, dotnet community have c# binding.

glTF model you can use:

Clone this wiki locally