Marching-Cubes
Marching-Cubes copied to clipboard
HLSL build-in triangle object instead of the Triangle struct ?
There is a build in triangle object in HLSL.
Would it be faster than using the created struct? it look like the triangle object is just a array of 3 float3 and could save the need of this loop :
for (int i = 0; i < numTris; i++) {
for (int j = 0; j < 3; j++) {
meshTriangles[i * 3 + j] = i * 3 + j;
vertices[i * 3 + j] = tris[i][j];
}
}
I'm not 100% sure of the loop removal opportunity but might be worth investigating