My thoughts (and the problems that occurs while trial and error) are that my maxvertexcount is 8. So i can't generate more points dependent of any variable/value what ever. But how can i call the GS then? I thought to call the GS out of the GS Method. I've tried something like that:
// inside the GeometryShader VertexOut t[3]; t[0] = v[1]; t[1] = v[2]; t[2] = v[3]; GS(t, stream);
but the error is: Fehler 5 error X3500: 'GS': recursive functions not allowed in gs_5_0 as already expected but at least I've tried it.
My GeometryShder looks like that at the moment.
Does someone has an idea how i can solve the problem?
[maxvertexcount(8)]
void GS(triangle VertexOut gin[3], inout TriangleStream<GeoOut> stream)
{
float distance;
ComputeDistance(gin[0], distance);
[branch]
if(distance < 15.0f)
{
VertexOut v[6];
Subdivide(gin, v);
OutputSubdivision(v, stream);
}
else if(distance > 15.0f && distance < 30.0f)
{
// here i want to get double tessellation
VertexOut v[6];
Subdivide(gin, v);
OutputSubdivision(v, stream);
}
else if(distance > 30.0f)
{
GeoOut v[3];
for(int i = 0; i < 3; ++i)
{
v[i].PosW = mul(float4(gin[i].PosL, 1.0f), gWorld).xyz;
v[i].NormalW = mul(gin[i].NormalL, (float3x3)gWorldInvTranspose);
v[i].PosH = mul(float4(gin[i].PosL, 1.0f), gWorldViewProj);
v[i].Tex = mul(gin[i].Tex, (float3x3)gWorldInvTranspose);
stream.Append(v[i]);
}
}
}
Regards Helgon
Edited by ~Helgon, 01 December 2012 - 05:35 PM.






