blob: e58659252b17cea5f4722a1c73e8c58ef942f987 (
plain)
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
|
struct VertexOutput
{
float4 position : SV_Position;
};
struct PixelInput
{
float4 position : SV_POSITION;
};
cbuffer buf : register(b0)
{
float radius : packoffset(c0);
};
[maxvertexcount(7)]
void main(point VertexOutput input[1], inout LineStream<PixelInput> OutputStream)
{
PixelInput output;
for (int i = 0; i < 7; ++i) {
float theta = float(i) / 6.0f * 2.0 * 3.14159265;
output.position = input[0].position;
output.position.xy += radius * float2(cos(theta), sin(theta));
OutputStream.Append(output);
}
}
|