Problem with lights in WebGPU

I’m trying to use three.js with WebGPU instead of WebGL, but I’m having a problem with lights.

If I create light sources by calling THREE.AmbientLight() and THREE.DirectionalLight(), it works fine:

https://www.dei.isep.ipp.pt/~jpp/webGPU/cube1/cube.html

But if I decide to create them by calling my own classes - AmbientLight() (which extends THREE.AmbientLight()) and DirectionalLight() (which extends THREE.DirectionalLight()):

https://www.dei.isep.ipp.pt/~jpp/webGPU/cube2/cube.html

the scene doesn’t get lit and I get the following warning:

three.core.js:1770 THREE.LightsNode.setupNodeLights: Light node not found for AmbientLight

I’m using the most recent three.js revision (r181).

Could you please help? Thanks in advance.

You should find the solution for this issue here:

2 Likes

It works now. Thanks! :slight_smile: