Skip to content

Commit c8dd06b

Browse files
HLSL matrix keyword.
1 parent d771233 commit c8dd06b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Diff for: matrix_example.shader

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Shader "Matrix example"
2+
{
3+
Subshader
4+
{
5+
Pass
6+
{
7+
Cull Off
8+
HLSLPROGRAM
9+
#pragma vertex v
10+
#pragma fragment p
11+
12+
void v (uint i: SV_VertexID, out float4 t: position)
13+
{
14+
t = float4(float2((i<< 1) & 2, i & 2) * float2(2, -2) - float2(1, -1), 0, 1);
15+
}
16+
17+
void p (out float4 c:COLOR)
18+
{
19+
matrix <float, 2, 2> a = { 1.0, 2.0, 0.0, 1.0 };
20+
matrix <float, 2, 1> b = { 1.0, 0.0};
21+
c = float4(mul(a,b),0,1); //red fullscreen quad
22+
}
23+
24+
ENDHLSL
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)