File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
articles/tutorials/advanced/2d_shaders/07_sprite_vertex_effect Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,16 @@ The vertex shader declares a semantic for each input using the `:` syntax:
53
53
54
54
[ !code-hlsl[ ] ( ./snippets/snippet-7-04.hlsl )]
55
55
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
+
56
66
> [ !warning]
57
67
> You cannot change the ` SpriteBatch ` vertex shader.
58
68
>
Original file line number Diff line number Diff line change 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
+ // ...
You can’t perform that action at this time.
0 commit comments