Marching-Cubes icon indicating copy to clipboard operation
Marching-Cubes copied to clipboard

HLSL build-in triangle object instead of the Triangle struct ?

Open Cewein opened this issue 4 years ago • 0 comments

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

Cewein avatar Mar 06 '20 21:03 Cewein