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: Supports to IBL + PBR #24038

Merged
merged 16 commits into from
May 10, 2022
Merged

WebGPU: Supports to IBL + PBR #24038

merged 16 commits into from
May 10, 2022

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented May 9, 2022

Description

This is the first implementation of IBL over PBR in WebGPU.

This implementation open some issues related with ShaderNode that I will fix in the next days and weeks.

The implementation is not finished yet, but I think that is a good opportunity to merger as we will be working until r141 release.

Live
https://raw.githack.com/sunag/three.js/dev-webgpu-pbr/examples/webgpu_loader_gltf.html

image

This contribution is funded by Google via Igalia

@sunag sunag added this to the r141 milestone May 9, 2022
@LeviPesin
Copy link
Contributor

I think we can now remove these two lines from the WebGPUNodeBuilder?

Also, can you please add new nodes and functions to the ShaderNode?

@sunag
Copy link
Collaborator Author

sunag commented May 10, 2022

Also, can you please add new nodes and functions to the ShaderNode?

I don't think it's the best add all nodes in ShaderNode, because that loses in tree-shaking capabilities, for example: Phong lighting when we added this I think that is better to be outside the ShaderNode. So I hope to do it more strategically going forward.

@LeviPesin
Copy link
Contributor

LeviPesin commented May 10, 2022

I think it is best to export from the ShaderNode the same nodes as exported from Nodes.js, and if some nodes are "internal" (i.e. not for external user user), we can remove them from both...

And about functions I think they all should be exported...

@sunag
Copy link
Collaborator Author

sunag commented May 10, 2022

I think it is best to export from the ShaderNode the same nodes as exported from Nodes.js, and if some nodes are "internal" (i.e. not for external user user), we can remove them from both...

In fact, this just make sense if Nodes.js no have additional imports that ShaderNode... but seeing the way of things, I think that is better to let users include the nodes and the lighting model for the specific project or include all if desired, others base nodes like MathNode, OperatorNode, TextureNode... must be persistent. But we have time to decide this together with the community.

@sunag
Copy link
Collaborator Author

sunag commented May 10, 2022

Merging to sync new updates...

@sunag sunag merged commit acda818 into mrdoob:dev May 10, 2022
@sunag sunag deleted the dev-webgpu-pbr branch May 10, 2022 20:37
@sunag sunag mentioned this pull request May 14, 2022
2 tasks
abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
* add Node.getReference() used to for share a similar node

* Remove SPECULAR for now and add EMISSIVE

* improve Object3DNode.update() implementation

* Nodes: move ./light/ to ./lighting/

* Move to LightingContextNode

* fix viewMatrix and update names

* update names

* Support to RGBMLoader

* Rename TextureBias to TextureLevel

* NodeMaterial: Improve support to IBL + PBR

* add webgpu_loader_gltf example

* update examples

* cleanup

* Delete webgpu_lights_hemisphere.html

* cleanup

* cleanup imports
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.

None yet

2 participants