I'm using a small geometry shader to build a "ribbon" from a set of points. For each point, I create 4 vertices that represent a section of the ribbon:
[maxvertexcount(4)]
void GS( point GS_Input v[1],
inout TriangleStream<PS_Input> ptStream )
{
float4 vertices[4];
vertices[0] = float4(v[0].pos.x - 2, 0, v[0].pos.z + 2, 1);
vertices[1] = float4(v[0].pos.x + 2, 0, v[0].pos.z + 2, 1);
vertices[2] = float4(v[0].pos.x - 2, 0, v[0].pos.z - 2, 1);
vertices[3] = float4(v[0].pos.x + 2, 0, v[0].pos.z - 2, 1);
PS_Input ov = (PS_Input)0;
for (int i = 0; i < MVC; i++)
{
ov.posW = mul(vertices[i], g_world);
ov.posH = mul(vertices[i], g_wvp);
ov.normalW = mul(float4(v[0].normal, 0), g_world);
ov.color = v[0].color;
ptStream.Append(ov);
}
}
As mentioned on the MSDN: "A geometry shader generating triangle strips will start a new strip on every invocation", and because of this, I don't get a ribbon, all I get is a set of quads, just like as if I was doing some particle billboarding. Is there any way to circumvent that in order to keep the same strip from on invocation to the next ?