Browse Source

feat: Add troubleshooting section to custom-shaders and reword the RouterClient issue (#426)

* Add troubleshooting section to custom-shaders and reword the RouterClient issue

* Change 'Error Messages' to 'Error messages'

Updated section heading for consistency and clarity.

---------

Co-authored-by: Vaclav Elias <[email protected]>
Eideren 1 month ago
parent
commit
2a16d3b8c2

+ 8 - 8
en/manual/graphics/effects-and-shaders/compile-shaders.md

@@ -5,12 +5,12 @@
 
 
 Stride converts Stride shaders (`sdsl` and `.sdfx` files) into the shader language used by the [graphics platform](../../platforms/set-the-graphics-platform.md).
 Stride converts Stride shaders (`sdsl` and `.sdfx` files) into the shader language used by the [graphics platform](../../platforms/set-the-graphics-platform.md).
 
 
-| Platform       | Shader language 
-| -------------- | ---- 
-| Direct3D       | HLSL
-| OpenGL         | GLSL
-| Vulkan         | SPIR-V
-| iOS            | OpenGL ES
+| Platform | Shader language |
+|----------|-----------------|
+| Direct3D | HLSL            |
+| OpenGL   | GLSL            |
+| Vulkan   | SPIR-V          |
+| iOS      | OpenGL ES       |
 
 
 Stride can convert the shaders at runtime (when the game is running) or at build time (when the editor builds the game assets). When Stride generates shaders at runtime, rendering stops until the shader is compiled. This is usually something you want to avoid in your release build — especially on mobile platforms, which have less CPU, so the pause can be more noticable.
 Stride can convert the shaders at runtime (when the game is running) or at build time (when the editor builds the game assets). When Stride generates shaders at runtime, rendering stops until the shader is compiled. This is usually something you want to avoid in your release build — especially on mobile platforms, which have less CPU, so the pause can be more noticable.
 
 
@@ -77,6 +77,6 @@ The iOS device should now be able to communicate with the PC via your Mac to bui
 
 
 ## Error messages
 ## Error messages
 
 
-If your application tries to connect to Game Studio to compile a shader or to notify Game Studio that it needs new shaders, but can't connect, the Visual Studio output displays this error:
+You may see the following error in Visual Studio's output pane while running your game:
 
 
-"[RouterClient]: Error: Could not connect to connection router using mode Connect. System.AggregateException: One or more errors occurred. ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:31254"
+> [RouterClient]: Error: Could not connect to connection router using mode Connect. System.AggregateException: One or more errors occurred. ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:31254

+ 21 - 0
en/manual/graphics/effects-and-shaders/custom-shaders.md

@@ -168,6 +168,27 @@ Then you can set the value in the material properties:
 
 
 ![Select shader](media/use-computecolorwave-shader.png)
 ![Select shader](media/use-computecolorwave-shader.png)
 
 
+## Troubleshooting
+
+You can access the compilation logs of your shaders through the Game Studio's debug window's EffectCompilerCache tab (`Ctrl+Shift+D` or `Help`>`Show debug window`).
+
+The launcher hosts a Visual Studio extension specifically for syntax highlighting and errors you may want to use.
+
+The engine's source also provides a good reference point for how one would write shaders. To that end [Stride.ShaderExplorer](https://github.com/tebjan/Stride.ShaderExplorer) facilitates the act of finding and browsing through the different shaders the source contains.
+
+A common issue you may stumble onto is the following:
+> E1202: The mixin X in Y dependency is not in the module
+
+This error often comes about as a result of missing or malformed Generics and Composition nodes.
+When that is the case you have two options:
+
+- Either manually fill these in through the material's Yaml file.
+- Or remove and add the shader back in.
+
+In both cases, you will have to close the Game Studio before doing those operation, for the former it's to ensure that the asset is reloaded from the disk. And for the latter, it's because the cache used by the property grid needs to be rebuilt.
+
+We're currently in the process of rebuilding the shader system's backend, which should hopefully get rid of these friction.
+
 ## Custom shader sample
 ## Custom shader sample
 
 
 For an example of a custom shader, see the **custom material shader** sample project included with Stride.
 For an example of a custom shader, see the **custom material shader** sample project included with Stride.