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

Add multiple canvas sample. #389

Merged
merged 3 commits into from
Mar 11, 2024
Merged

Conversation

greggman
Copy link
Collaborator

@greggman greggman commented Mar 9, 2024

Note: AFAICT the stanford dragon was getting flat shading. If that was the intent I can remove the genarateNormals code but I assumed the intent was smooth shading.

I do kind of wonder if we should just genearte then once and put them in the data file 😛

Note: AFAICT the stanford dragon was getting flat shading.
If that was the intent I can remove the genarateNormals code
but I assumed the intent was smooth shading.

I do kind of wonder if we should just genearte then once
and put them in the data file 😛
@greggman greggman requested a review from shrekshao March 9, 2024 07:09
Copy link
Collaborator

@shrekshao shrekshao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New sample looks great!

meshes/utils.ts Outdated
// this assumes vertex positions are an exact match

function getVertIndex(vert: [number, number, number]): number {
const vertId = `${vert[0]},${vert[1]},${vert[2]}`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This vertId doesn't look super ... cool? but I'm good with everything that just works :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to JSON.stringify(vert) which works.

@shrekshao
Copy link
Collaborator

Note: AFAICT the stanford dragon was getting flat shading. If that was the intent I can remove the genarateNormals code but I assumed the intent was smooth shading.

No I don't think flat shading is specially intended.

I do kind of wonder if we should just genearte then once and put them in the data file 😛

I'm good with either way. In that case less effort is prferred, so we can just keep things as-is :)

@greggman greggman merged commit 314297f into webgpu:main Mar 11, 2024
1 check passed
@greggman greggman deleted the multiple-canvases branch March 11, 2024 20:30
@kainino0x
Copy link
Collaborator

There is #302 about artifacts in the dragon model because I think we are using the original 3d scanned model file instead of a cleaned-up version. If we replace it then we can add normals and stuff.

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

Successfully merging this pull request may close these issues.

3 participants