-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdemo.html
47 lines (43 loc) · 1018 Bytes
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.6.0/highlight.min.js"></script>
<script type="text/javascript" src="../dist/hlsl.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.6.0/styles/vs2015.min.css">
<script type="text/javascript">
hljs.initHighlightingOnLoad();
</script>
</head>
<body>
<pre><code class="language-hlsl">
cbuffer Constants : register(b0)
{
float4x4 mtxWorld;
float4x4 mtxView;
float4x4 mtxProj;
}
struct VS_INPUT
{
float3 Position : POSITION;
float3 Color : COLOR0;
};
struct VS_OUTPUT
{
float4 Position : SV_Position;
float3 Color : COLOR0;
};
// Vertex Shader
VS_OUTPUT VS_main(VS_INPUT IN)
{
VS_OUTPUT OUT;
OUT.Position = mul(mtxProj, mul(mtxView, mul(mtxWorld, float4(IN.Position, 1.0f))));
OUT.Color = IN.Color;
return OUT;
}
// Pixel Shader
float4 PS_main(VS_OUTPUT IN) : SV_Target0
{
return float4(IN.Color, 0);
}
</code></pre>
</body>
</html>