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

BREAKING feature: preparing for Three.js r167 #1446

Merged
merged 8 commits into from
Jul 26, 2024
Merged

BREAKING feature: preparing for Three.js r167 #1446

merged 8 commits into from
Jul 26, 2024

Conversation

0b5vr
Copy link
Contributor

@0b5vr 0b5vr commented Jul 23, 2024

This PR adapts usage of WebGPU stuff to the r167 way.

import WebGPU / NodeMaterial stuff from three/webgpu.
See: mrdoob/three.js#28650

Three.js r167 is not released yet!
I tested the behavior by using yarn link on three and @types/three.

importmaps for Three.js in webgpu examples are temporarily replaced to node_modules, please change them back before merging.

This PR also bumps Three.js to r167.
Several changes are made even outside the WebGPU scope in order to follow r167 changes.

MToonNodeMaterial now requires r167 or higher.
The main WebGL module should still work in r137-r166.

import WebGPU / NodeMaterial stuff from `three/webgpu`
See: mrdoob/three.js#28650

Three.js r167 is not released yet!
I tested the behavior by using `yarn link` on `three` and `@types/three`

importmaps for Three.js in webgpu examples are temporarily replaced to node_modules, please change them back before merging

Some codes inside MToonNodeMaterial emit type errors because of recent @types/three changes
I'm asking Methuselar96 why the change is made
See: three-types/three-ts-types#1023 (comment)
@0b5vr 0b5vr added this to the v3 milestone Jul 23, 2024
@0b5vr 0b5vr self-assigned this Jul 23, 2024
@0b5vr
Copy link
Contributor Author

0b5vr commented Jul 23, 2024

The failing test says Cannot find module 'three/webgpu' or its corresponding type declarations..
It's an expected result, should be fixed once we import r167

@lin72h
Copy link

lin72h commented Jul 25, 2024

r167 just released! looking forward to 3.0 release

@0b5vr 0b5vr marked this pull request as ready for review July 26, 2024 06:26
),
);
}

indirectDiffuse({ irradiance, reflectedLight }: Nodes.LightingModelIndirectInput) {
indirect(context: THREE.LightingModelIndirectInput) {
Copy link
Contributor

@yue4u yue4u Jul 26, 2024

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Three.js devs don't assume users to extend NodeMaterial 😅

Copy link
Contributor

@yue4u yue4u left a comment

Choose a reason for hiding this comment

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

So we will rename exports in another PR?

@0b5vr
Copy link
Contributor Author

0b5vr commented Jul 26, 2024

So we will rename exports in another PR?

No, we're going to go @pixiv/three-vrm/nodes as is instead of renaming it to @pixiv/three-vrm/webgpu.
Naming it @pixiv/three-vrm/webgpu makes users misunderstand that the export includes the entire library with NodeMaterial stuff, considering how Three.js exports three/webgpu.

@0b5vr 0b5vr merged commit 76c1a68 into dev-v3 Jul 26, 2024
6 checks passed
@0b5vr 0b5vr deleted the webgpu-r167 branch July 26, 2024 09:01
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