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

WebGPU: NodeMaterial updates #21208

Merged
merged 19 commits into from
Feb 7, 2021
Merged

WebGPU: NodeMaterial updates #21208

merged 19 commits into from
Feb 7, 2021

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Feb 5, 2021

NodeMaterial

  • new example webgpu_materials
  • new nodes NormalNode, MathNode d95eb36 4c2ab57
  • build node in custom shader stage eef49b1
  • fixes nodes: VaryNode, PositionNode.LOCAL
  • fix displace with normals example webgpu_sandbox 2337179

@mrdoob mrdoob requested a review from Mugen87 February 5, 2021 09:35
@mrdoob mrdoob added this to the r126 milestone Feb 5, 2021
examples/files.json Outdated Show resolved Hide resolved
@sunag
Copy link
Collaborator Author

sunag commented Feb 6, 2021

Some known reason to those extra lines?

image

@mrdoob
Copy link
Owner

mrdoob commented Feb 6, 2021

That looks like my first programs in GWBasic! :')
Is it a WebGPU thing?

@sunag
Copy link
Collaborator Author

sunag commented Feb 6, 2021

@mrdoob Yes! in WebGPU :)

@mrdoob
Copy link
Owner

mrdoob commented Feb 6, 2021

@sunag I mean like an implementation thing... I guess we can't try on Firefox yet?

@sunag
Copy link
Collaborator Author

sunag commented Feb 6, 2021

@sunag I mean like an implementation thing... I guess we can't try on Firefox yet?

Ah yeah, nice question... I try run in Firefox Nightly but not work the example.

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 7, 2021

Sidenote: You can enable WebGPU in Firefox Nightly by opening about:config and setting the flags dom.webgpu.enabled and gfx.webrender.all to true. However, the current implemented WebGPU API differs between Canary and Nightly quite noticeably. So none of the three.js examples work right now.

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 7, 2021

The CI fails because there is no screenshot for the new example webgpu_materials.

You can add one by doing this: npm run make-screenshot webgpu_materials

@mrdoob
Copy link
Owner

mrdoob commented Feb 7, 2021

I'll merge and generate the screenshot on my end.

@mrdoob mrdoob merged commit 5e6fa8c into mrdoob:dev Feb 7, 2021
@mrdoob
Copy link
Owner

mrdoob commented Feb 7, 2021

Thanks!

// Opacity
material = new THREE.MeshBasicMaterial();
material.opacityNode = new TextureNode( texture );
material.transparent = true;
Copy link
Collaborator

@Mugen87 Mugen87 Feb 25, 2021

Choose a reason for hiding this comment

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

BTW: It's good that you have implement transparency settings like so 👍 . This should solve #18038 since the render list is now correct in the first frame.

Material.transparent needs to be set by the user, not by the material system.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was not a hated feature in general, it facilitates in most cases ( #16996 (comment) ) . More few months we must abandon the old NodeMaterial system and adopt the new one that uses .transparent... Should we wait this change only for the new NodeMaterial system?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Replacing the old material system with the new one makes sense. But maybe it's better to invest a bit more time in developing the new one before doing this step.

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