Skip to content

Commit e1a4fb4

Browse files
committed
tracking 7.3
1 parent c20b94e commit e1a4fb4

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

articles/tutorials/advanced/2d_shaders/07_sprite_vertex_effect/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ The vertex shader declares a semantic for each input using the `:` syntax:
5353

5454
[!code-hlsl[](./snippets/snippet-7-04.hlsl)]
5555

56+
The semantics align with the values from the `VertexElementUsage` values. The table shows the correlation of the common semantics.
57+
58+
| Shader Semantic | `VertexElementUsage` Value |
59+
| :-------------- | :------------------------------------- |
60+
| `POSITION` | `VertexElementUsage.Position` |
61+
| `COLOR` | `VertexElementUsage.Color` |
62+
| `TEXCOORD` | `VertexElementUsage.TextureCoordinate` |
63+
64+
These semantics are responsible for mapping the values written into the `VertexPositionColorTexture` to the corresponding inputs in the shader file.
65+
5666
>[!warning]
5767
> You cannot change the `SpriteBatch` vertex shader.
5868
>
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1-
// the POSITION0 is the semantic
2-
float4 position : POSITION0,
1+
// ...
2+
3+
VSOutput SpriteVertexShader(float4 position : POSITION0,
4+
float4 color : COLOR0,
5+
float2 texCoord : TEXCOORD0)
6+
{
7+
// ...
8+
}
9+
10+
// ...

0 commit comments

Comments
 (0)