Reputation: 2043
I want to add RectAreaLight to a three.js scene where I placed object with MeshPhongMaterial however there is no light reflection on the objects. I found a working example here: Link
You can see the source code when you open the developer tools.
So I tried to port it to React and the scene renders all objects but there is light reflection. In line 46 the OES_texture_half_float error was thrown. I commented this lines out. Maybe it has something to do with this.
Here is the not working codesandbox: Link
Upvotes: 1
Views: 835
Reputation: 31076
There are a couple of issues in your code:
RectAreaLightUniformsLib
and call its init()
method.RectAreaLight
only supports PBR materials (meaning MeshStandardMaterial
and MeshPhysicalMaterial
).castShadow
and receiveShadow
won't have any effect.Fixed codesandbox: https://codesandbox.io/s/restless-cherry-4jh72
Upvotes: 1