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

Node: Fix .getNodeType() if .construct() return some Node #26631

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Aug 23, 2023

Related issue: Fixes #26630

Description

.getNodeType() must be the same of Node returned from .construct() if any, so that the type references are correct.

@sunag sunag added this to the r156 milestone Aug 23, 2023
@sunag sunag merged commit 3bb6de2 into mrdoob:dev Aug 23, 2023
@linbingquan
Copy link
Contributor

@sunag I would like to ask a simple question, how do you locate or analyze this problem, I can not find any helpful information in the error message of the debugging panel, I tried to debug, but it did not work well. Maybe I'm not familiar with the WebGPURenderer module code.

I wonder if it is convenient for you to share your experience.

@sunag
Copy link
Collaborator Author

sunag commented Aug 23, 2023

The error presented was from a WGSL generated a vec4f( vec3f(), vec3f() ), so I figured it was a compilation problem, TSL automatically converts the type differences, and I started to investigate if there was a specific Node with problem that AxesHelper was being used, then I noticed the Vertex Color, but the code was correct, it would certainly be a Node System issue.

colorNode = vec4( colorNode.xyz.mul( attribute( 'color' ) ), colorNode.a );

This was a global fix for Node System, it will certainly appear at some point or another.

When construct() returns a Node, some Nodes were using .getNodeType() to get the type of a child Node, and the data was not getting updated with the return of .construct(). I arrived at this conclusion debugging the line above, in the construct() and generate() processes.

I'm hopeful that after stabilizing the Node System we will create documentation explaining these processes better, mainly so that users can create their own Nodes or import from other 3d software.

@sunag sunag deleted the dev-fix branch August 23, 2023 16:48
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.

WebGPURenderer: Render AxesHelper error.
2 participants