Skip to content

Commit 3bf0f4b

Browse files
committed
tracking 5.6
1 parent 4d83827 commit 3bf0f4b

File tree

1 file changed

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

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ The following shader helps visualize the x-coordinate of each pixel:
121121

122122
That results in this image, where the left edge has an x-coordinate of `0`, it has no red value, and where the right edge has an x-coordinate of `1`, the image is fully red. In the middle of the image, the red value interpolates between `0` and `1`.
123123

124+
> [!caution]
125+
> Where did the `Progress` slider go?
126+
>
127+
> When the shader is compiled, the `Progress` parameter is being optimized out of the final compiled code, because it was not being used in the final output of the shader in any way. The MonoGame shader compiler is good at optimizing away unused parameters, which is good because it helps the performance of your game. However, it can be confusing, because the `Progress` parameter appears to _vanish_ from the shader. Indeed, it no longer appears in the `EffectParameterCollection`, so the debug UI has no way of knowing it exists to render it.
128+
129+
124130
| ![Figure 5-6: the x coordinate of each pixel represented in the red channel](./images/x-pos.png) |
125131
| :----------------------------------------------------------------------------------------------: |
126132
| **Figure 5-6: the x coordinate of each pixel represented in the red channel** |

0 commit comments

Comments
 (0)