绕了一圈……知道我们要干啥了吧!
void vertex_shader(
float4 position : POSITION,
float4 color : COLOR,
out float4 oPosition : POSITION,
out float4 oColor : COLOR
) {
float r = rand(position.xyz, seed);
float3 offset = (r - 0.5) * 0.1;
float4 newPos = position + float4(offset, 0.0);
oPosition = mul(newPos, WorldViewProj);
oColor = color;
}
for (int y = 0; y < H; ++y) {
for (int x = 0; x < W; ++x)
putchar(f(x, y) ? '*' : ' ');
putchar('\n');
}