triangle fan support

This commit is contained in:
James Fulop
2016-09-19 01:13:31 -04:00
committed by baldurk
parent ea861ed3e1
commit becf01701f
3 changed files with 17 additions and 2 deletions
+1
View File
@@ -133,6 +133,7 @@ INST_NAME(general);
#define MESH_OTHER 0 // this covers points and lines, logic is the same
#define MESH_TRIANGLE_LIST 1
#define MESH_TRIANGLE_STRIP 2
#define MESH_TRIANGLE_FAN 3
BINDING(0) uniform MeshPickUBOData
{
vec3 rayPos;
+8
View File
@@ -108,6 +108,14 @@ void trianglePath(uint threadID)
idx2 = meshpick.use_indices != 0u ? ib.data[vertid+2] : vertid+2;
break;
}
case MESH_TRIANGLE_FAN:
{
vertid *= 2;
idx0 = meshpick.use_indices != 0u ? ib.data[0 ] : 0;
idx1 = meshpick.use_indices != 0u ? ib.data[vertid ] : vertid;
idx2 = meshpick.use_indices != 0u ? ib.data[vertid+1] : vertid+1;
break;
}
}
vec4 pos0 = vb.data[idx0];
+8 -2
View File
@@ -1092,10 +1092,16 @@ uint32_t GLReplay::PickVertex(uint32_t eventID, const MeshDisplay &cfg, uint32_t
isTriangleMesh = true;
break;
};
default:
case eTopology_TriangleFan:
{
cdata->meshMode = MESH_TRIANGLE_FAN;
isTriangleMesh = true;
break;
};
// TODO: TriangleList_Adj, TriangleStrip_Adj
default: // points, lines, patchlists
{
cdata->meshMode = MESH_OTHER;
RDCWARN("Mesh type defaulting to screenspace point picking");
};
}