Skip to content

Commit 4d83827

Browse files
committed
tracking 5.5; note about auto shader parameter
1 parent f3003f8 commit 4d83827

File tree

1 file changed

+7
-0
lines changed
  • articles/tutorials/advanced/2d_shaders/05_transition_effect

1 file changed

+7
-0
lines changed

articles/tutorials/advanced/2d_shaders/05_transition_effect/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ And recall that unless the `Progress` parameter is actually _used_ somehow in th
9393

9494
Now you can use the slider in the debug UI to visualize the `Progress` parameter as the red channel.
9595

96+
> [!caution]
97+
> But wait, how does the game know to render a `Progress` slider?
98+
>
99+
> Recall from [Chapter 03: The Material Class](./../03_the_material_class/index.md#setting-shader-parameters)'s _Setting Shader Parameters_ section that MonoGame's `EffectParameterCollection` knows about all of the compiled shader parameters The Debug UI we created in [Chapter 04: Debug UI](./../04_debug_ui/index.md#building-a-material-debug-ui) draws a slider for each parameter in the `EffectParameterCollection`. This means that as soon as a shader parameter is included in the compiled shader code, it will appear in the Debug UI without us needing to manually add or remove it.
100+
>
101+
> As we add or remove shader parameters in the shader code, the hot reload system will compile the shader and reload it into the game, and the Debug UI will draw everything in the `EffectParameterCollection`.
102+
96103
| ![Figure 5-5: See the Progress parameter in the red value](./gifs/progress-parameter.gif) |
97104
| :---------------------------------------------------------------------------------------: |
98105
| **Figure 5-5: See the Progress parameter in the red value** |

0 commit comments

Comments
 (0)