From 75f9dad5cc0e387a0d07843e34b9ddfaf2a5c14f Mon Sep 17 00:00:00 2001 From: Ferafiks Date: Wed, 13 May 2026 11:33:25 +0200 Subject: [PATCH 1/5] Initial work --- en/manual/graphics/graphics-api.md | 70 +++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 16 deletions(-) diff --git a/en/manual/graphics/graphics-api.md b/en/manual/graphics/graphics-api.md index 4c5506d02..02239c068 100644 --- a/en/manual/graphics/graphics-api.md +++ b/en/manual/graphics/graphics-api.md @@ -1,25 +1,63 @@ # Graphics API -To run your projects through a different API than the default one, add the following line to the `PropertyGroup` of your executable's `.csproj` file: -`Vulkan` +Graphics APIs are responsible for performing basic rendering operations. They differ in platform availability and have their own benefits and drawbacks. + +## Changing Graphics API + +To change the Graphics API that your project is using, add the following line to the `PropertyGroup` of a [platform package's](../files-and-folders/project-packages/index.md#platform-packages) `.csproj` file: + +`NameOfGraphicsAPIHere` ![image](https://user-images.githubusercontent.com/5742236/155832596-48165499-51ac-4026-9140-30b35dfa4f0b.png) -Supported values are as follows: -``` -Null -Direct3D11 -Direct3D12 -OpenGL -OpenGLES -Vulkan -``` +Stride supports the following values: + +* Direct3D11 +* Direct3D12 +* Vulkan +* OpenGLES +* Null + +## Supported Graphics APIs + +### Direct3D11 + +**Available on platforms:** Windows + +Direct3D is a graphics API developed by Microsoft for Windows. Stride's implementation for version 11 is the most mature one out of all, which is why it's used as the default. + +### Direct3D12 + +**Available on platforms:** Windows -You *may* also have to add `` to your *main* `.csproj`, and don't forget to replace `Version` appropriately. +Version 12 of Direct3D is the newest version of the API. Currently, Stride's implementation for it isn't as stable as the one for 11, which is why it isn't used as default. -![image](https://github.com/stride3d/stride/assets/5742236/fbe35875-fb07-4f2f-ae8a-e9ea34eed471) +### Vulkan + +**Available on platforms:** Windows, Linux, Android + +Vulkan is a modern graphics API that provides great performance benefits and control over how rendering is done. It's the most recommended choice for **Linux**. + +### OpenGLES + +**Available on platforms:** Windows, Linux, Android + +OpenGLES is a subset of OpenGL designed for embedded systems (such as smartphones). + +## Checking the API at runtime + +You can check which API your project is using from [`GraphicsDevice.Platform`](xref:Stride.Graphics.GraphicsDevice.Platform). + +## Building the engine with a different Graphics API + +When building the engine from source code, it will be built with support for only `Direct3D11`. You can change that using build parameters by setting `StrideGraphicsApiDependentBuildAll` to true. + +```bash +dotnet build ./build/Stride.sln /p:StrideGraphicsApiDependentBuildAll=true +``` -## Engine -If you are using a local build of the engine you should run the build again with the following command: +## See also -`msbuild /t:Build /p:StrideGraphicsApiDependentBuildAll=true Stride.sln` +* [Platforms](../platforms/index.md) +* [Project structure](../files-and-folders/project-structure.md) +* [Project packages](../files-and-folders/project-packages/index.md) From 23bf4c24a13ecb110bb551ad2cd68db14d07787e Mon Sep 17 00:00:00 2001 From: Ferafiks Date: Wed, 13 May 2026 21:33:21 +0200 Subject: [PATCH 2/5] Polish --- en/manual/graphics/graphics-api.md | 74 ++++++++++++------- .../media/graphics-api-xml-property.webp | 3 + 2 files changed, 50 insertions(+), 27 deletions(-) create mode 100644 en/manual/graphics/media/graphics-api-xml-property.webp diff --git a/en/manual/graphics/graphics-api.md b/en/manual/graphics/graphics-api.md index 02239c068..e61865be8 100644 --- a/en/manual/graphics/graphics-api.md +++ b/en/manual/graphics/graphics-api.md @@ -1,61 +1,81 @@ # Graphics API -Graphics APIs are responsible for performing basic rendering operations. They differ in platform availability and have their own benefits and drawbacks. +**Graphics APIs** are responsible for performing basic rendering operations. They differ in platform availability and have their own benefits and drawbacks. -## Changing Graphics API +## Supported graphics APIs -To change the Graphics API that your project is using, add the following line to the `PropertyGroup` of a [platform package's](../files-and-folders/project-packages/index.md#platform-packages) `.csproj` file: - -`NameOfGraphicsAPIHere` - -![image](https://user-images.githubusercontent.com/5742236/155832596-48165499-51ac-4026-9140-30b35dfa4f0b.png) - -Stride supports the following values: - -* Direct3D11 -* Direct3D12 -* Vulkan -* OpenGLES -* Null - -## Supported Graphics APIs +Stride has support for the following APIs: ### Direct3D11 **Available on platforms:** Windows -Direct3D is a graphics API developed by Microsoft for Windows. Stride's implementation for version 11 is the most mature one out of all, which is why it's used as the default. +Direct3D is a graphics API developed by Microsoft. Stride's implementation for version 11 is the most mature, which is why it's used as the default on Windows. ### Direct3D12 **Available on platforms:** Windows -Version 12 of Direct3D is the newest version of the API. Currently, Stride's implementation for it isn't as stable as the one for 11, which is why it isn't used as default. +Version 12 of Direct3D is the newest release of the API. Currently, Stride's implementation for it isn't as stable as the one for 11, which is why it isn't used by default. ### Vulkan -**Available on platforms:** Windows, Linux, Android +**Available on platforms:** Windows, Linux, MacOS, Android, iOS -Vulkan is a modern graphics API that provides great performance benefits and control over how rendering is done. It's the most recommended choice for **Linux**. +Vulkan is a modern graphics API that provides great performance benefits and control over how rendering is performed. It's used as the default on non-Windows platforms. -### OpenGLES +## Changing the graphics API -**Available on platforms:** Windows, Linux, Android +To change the graphics API used by your project, add the following line to the `PropertyGroup` of a [platform package's](../files-and-folders/project-packages/index.md#platform-packages) `.csproj` file: + +```xml +NameOfGraphicsAPIHere +``` + +![](media/graphics-api-xml-property.webp) + +Stride supports the following values: -OpenGLES is a subset of OpenGL designed for embedded systems (such as smartphones). +* Direct3D11 +* Direct3D12 +* Vulkan +* Null ## Checking the API at runtime You can check which API your project is using from [`GraphicsDevice.Platform`](xref:Stride.Graphics.GraphicsDevice.Platform). -## Building the engine with a different Graphics API +```csharp +public override void Update() +{ + DebugText.Print($"Graphics API: {GraphicsDevice.Platform}", new(50, 50)); +} +``` + +## Building the engine with a different API -When building the engine from source code, it will be built with support for only `Direct3D11`. You can change that using build parameters by setting `StrideGraphicsApiDependentBuildAll` to true. +When building the engine from source code, it will be built with support only for the default API for your OS. You can change that by setting `StrideGraphicsApiDependentBuildAll` to `true` in build parameters. ```bash -dotnet build ./build/Stride.sln /p:StrideGraphicsApiDependentBuildAll=true +msbuild -p:StrideGraphicsApiDependentBuildAll=true ./build/Stride.sln ``` +To only build selected api's, set the `StrideGraphicsApis` property to your desired value. + +### [Powershell](#tab/powershell) + +```powershell +msbuild -p:StrideGraphicsApis=`"Api1`;Api2`" +``` + +### [Bash](#tab/bash) + +```bash +msbuild -p:StrideGraphicsApis=\"Api1\;Api2\" +``` + +--- + ## See also * [Platforms](../platforms/index.md) diff --git a/en/manual/graphics/media/graphics-api-xml-property.webp b/en/manual/graphics/media/graphics-api-xml-property.webp new file mode 100644 index 000000000..45323e7a2 --- /dev/null +++ b/en/manual/graphics/media/graphics-api-xml-property.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3723c94b83e2e8ca2fb6e764216a85c2fa34477fb5bbfe569b6ea82ddf31ae37 +size 63450 From 8aa5fc4f697651400589e4169f03940767885f8c Mon Sep 17 00:00:00 2001 From: Ferafiks Date: Sat, 16 May 2026 14:32:19 +0200 Subject: [PATCH 3/5] Removed an unnecessary escape character in the ps multiple apis command --- en/manual/graphics/graphics-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/manual/graphics/graphics-api.md b/en/manual/graphics/graphics-api.md index e61865be8..0d9ffece0 100644 --- a/en/manual/graphics/graphics-api.md +++ b/en/manual/graphics/graphics-api.md @@ -65,7 +65,7 @@ To only build selected api's, set the `StrideGraphicsApis` property to your desi ### [Powershell](#tab/powershell) ```powershell -msbuild -p:StrideGraphicsApis=`"Api1`;Api2`" +msbuild -p:StrideGraphicsApis=`"Api1;Api2`" ``` ### [Bash](#tab/bash) From 4eca3f0b110c3f17ed1791a4f97d80d98c02a794 Mon Sep 17 00:00:00 2001 From: Ferafiks Date: Sat, 16 May 2026 20:37:47 +0200 Subject: [PATCH 4/5] Re-added the escape character to the powershell command --- en/manual/graphics/graphics-api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/en/manual/graphics/graphics-api.md b/en/manual/graphics/graphics-api.md index 0d9ffece0..af32b3756 100644 --- a/en/manual/graphics/graphics-api.md +++ b/en/manual/graphics/graphics-api.md @@ -65,13 +65,13 @@ To only build selected api's, set the `StrideGraphicsApis` property to your desi ### [Powershell](#tab/powershell) ```powershell -msbuild -p:StrideGraphicsApis=`"Api1;Api2`" +msbuild -p:StrideGraphicsApis=`"Api1`;Api2`" ./build/Stride.sln ``` ### [Bash](#tab/bash) ```bash -msbuild -p:StrideGraphicsApis=\"Api1\;Api2\" +msbuild -p:StrideGraphicsApis=\"Api1\;Api2\" ./build/Stride.sln ``` --- From 3c4ea9912ea22797c05dd396cb4ef58bef4f8d70 Mon Sep 17 00:00:00 2001 From: Ferafiks Date: Tue, 26 May 2026 08:32:25 +0200 Subject: [PATCH 5/5] Added badge --- en/manual/graphics/graphics-api.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/en/manual/graphics/graphics-api.md b/en/manual/graphics/graphics-api.md index af32b3756..5dc710ddf 100644 --- a/en/manual/graphics/graphics-api.md +++ b/en/manual/graphics/graphics-api.md @@ -1,5 +1,7 @@ # Graphics API +Intermediate + **Graphics APIs** are responsible for performing basic rendering operations. They differ in platform availability and have their own benefits and drawbacks. ## Supported graphics APIs