Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Cewein opened this issue Mar 6, 2020 · 0 comments
Open

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

Cewein opened this issue Mar 6, 2020 · 0 comments

Comments

@Cewein
Copy link

Cewein commented Mar 6, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant