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: All UBOs and varys is generate by nodes #21170

Merged
merged 12 commits into from
Feb 2, 2021

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Jan 29, 2021

  • All UBOs and varys is generate by nodes
  • new nodes: GLPositionNode, ModelNode, CameraNode, Matrix3Node, Matrix4Node, VaryNode, PositionNode
  • displace (without normals) example

Related: #20421 (comment)

@sunag sunag marked this pull request as draft January 29, 2021 06:30
@mrdoob mrdoob added this to the r126 milestone Jan 29, 2021
@Mugen87
Copy link
Collaborator

Mugen87 commented Jan 30, 2021

Sidenote: The PR currently breaks webgpu_compute.

@sunag
Copy link
Collaborator Author

sunag commented Jan 31, 2021

Sidenote: The PR currently breaks webgpu_compute.

Fixed! 5922e92

@sunag sunag marked this pull request as ready for review January 31, 2021 07:27
@sunag sunag changed the title NodeMaterial: WVPNode and updates WebGPU: All UBOs and varys is generate by nodes Jan 31, 2021
@sunag
Copy link
Collaborator Author

sunag commented Jan 31, 2021

Next steps I have here ... You guys have something in mind what I should prioritize?

  1. TempNode generate temporary variable if needed ( implementation of analyze and pre-build )
  2. Add GGX lighting model
  3. FunctionNode -> shader language for NodeMaterial
  4. MathNode, CubeNode and others...

@Mugen87
Copy link
Collaborator

Mugen87 commented Jan 31, 2021

An initial version of FunctionNode would be interesting so users can enhance a node material with custom code.

However, I would not start with introducing a custom shading language for node material. Let's assume for now FunctionNode holds GLSL and later (at some point) WSL.

I would suggest to demonstrateFunctionNode with a new example. The existing sandbox example is already big enough.

@sunag
Copy link
Collaborator Author

sunag commented Feb 2, 2021

@mrdoob Do you have a preference here? #21170 (comment)

I just finished NormalNode fully node based

image

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 2, 2021

Merging this so you can move on. We can rename GLPositionNode with a later PR if necessary.

@Mugen87 Mugen87 merged commit d4c3ea2 into mrdoob:dev Feb 2, 2021

class CameraNode extends Node {

static POSITION = 'position';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sidenote: The default JavaScript parser of ESLint (Espree) does currently not support class fields syntax. Hence, the linter reports a parsing error:

Unexpected token =

The only way to fix this right now is to use a different parser like @babel/eslint-parser. However, this will require an additional dev dependency and an enhancement of the eslintConfig section in package.json.

@mrdoob Unless we don't start using class fields in the core, I recommend to do nothing for now. This issue should hopefully be resolved when class fields are not experimental anymore.

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