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

testing WebGPURenderer and TSL (do not merge) #5655

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vincentfretin
Copy link
Contributor

Description:

For those that want to play with WebGPURenderer and TSL

Changes proposed:

  • Rename a-node isNode to isAframeNode, this was the cause of infinite loop with build function on WebGPURenderer when building a shader
  • Import from three/webgpu instead of three
  • Set dummy renderer.xr.setPoseTarget for now

@@ -15,7 +15,7 @@ export var knownTags = {
};

function isNode (node) {
return node.tagName.toLowerCase() in knownTags || node.isNode;
return node.tagName.toLowerCase() in knownTags || node.isAframeNode;
Copy link
Member

Choose a reason for hiding this comment

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

We should def understand what's going on here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The infinite loop was here https://github.com/mrdoob/three.js/blob/a5734130516db50c1de2cdfe27f477a33ecd1c87/src/nodes/core/Node.js#L640-L648
I don't know much about the new node system to say what that code is doing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I said in #5363 (comment) my guess is that in aframe we set a reference to the entity with el on a three object.

Doing a search I get the following places:

$ ag "\.el = " src/
src/core/system.js
31:  this.el = sceneEl;

src/core/component.js
66:  this.el = el;

src/core/a-entity.js
36:    this.object3D.el = this;
111:    this.object3D.el = null;
140:    obj.el = this;
143:        child.el = self;

src/components/material.js
112:    shaderInstance.el = this.el;

src/components/light.js
205:      this.light.el = el;

src/components/text.js
437:  shaderObject.el = el;

My guess is that the one set on shaderInstance.el is the culprit and end up in the shader/material being build, but not sure how, I'm not familiar with the new webgpu code path.

@dmarcos
Copy link
Member

dmarcos commented Feb 4, 2025

Cool. I would postpone this to 1.8.0. I will be cool to have a WebGPU path.

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.

2 participants