You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/tutorials/advanced/2d_shaders/07_sprite_vertex_effect/index.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -215,7 +215,7 @@ Then you will not see much movement at all. This is because the `DebugOffset` va
215
215
216
216
The world-space vertices can have their `x` and `y` values modified in the vertex shader, but what about the `z` component? The orthographic projection essentially _ignores_ the `z` component of a vertex and treats all vertices as though they are an equal distance away from the camera. If you change the `z` value, you may _expect_ the sprite to appear closer or further away from the camera, but the orthographic projection matrix does not do that.
217
217
218
-
To check, try modify the shader code to adjust the `z` value based on one of the debug values:
218
+
To check, try to modify the shader code to adjust the `z` value based on one of the debug values:
|**Figure 7-9: A spinning text with reverse sides**|
270
270
271
+
> [!note]
272
+
> What is _Culling_?
273
+
>
274
+
> The term, "Culling", is used to describe a scenario when some triangles are not drawn due to some sort of optimization. There are many _types_ of culling, but in this case, we are discussing a specific type of optimization called "Back-face Culling". Learn more about it on [wikipedia](https://en.wikipedia.org/wiki/Back-face_culling).
275
+
276
+
271
277
You may find that the field of view is too high for your taste. Try lowering the field of view to 60, and you'll see something similar to this,
272
278
273
279
||
@@ -293,6 +299,7 @@ And instead of manually controlling the spin angle, we can make the title spin g
293
299
## Applying it to the Game
294
300
295
301
It was helpful to use the `TitleScene` to build intuition for the vertex shader, but now it is time to apply the perspective vertex shader to the game itself to add immersion and a sense of depth to the gameplay. The goal is to use the same effect in the `GameScene`.
302
+
296
303
### The Uber Shader
297
304
298
305
A problem emerges right away. The `GameScene` is already using the color swapping effect to draw the sprites, and `SpriteBatch` can only use a single per batch.
0 commit comments