My question is: what happens when I do RectAreaLightUniformsLib.init(); and when I don’t ? I have 2 rectarealights pointed at a imported 3d model with MeshPhysicalMaterial. And it looks the same with or without RectAreaLightUniformsLib.init()? So I guess I’m doing something wrong. I imported it and it gives me no errors. On a side note: I have controls for material roughness and reflection which don’t work with these two lights, I thought it was because of the RectAreaLightUniformsLib, but nothing changed. The controls work fine with other lights! Thanks in advanced
RectAreaLightUniformsLib.init() is required when using
RectAreaLight since the call configures two uniforms for the respective lighting calculation. Both uniforms contain BRDF approximation texture data.
Thanks! But do you maybe have a clue to why my material isn’t working properly? It’s just a simple json import of a gltf model. But it doesn’t have the same reflection that is in the example for rect lights. with or without the .init function
There are a few pre-requisites for area lights as well as using the right material type.
Check this example and it’s code for help:
This example does not use rect are lights.
@Ilija_Marinovic I suggest you share a live example or GitHub repository that shows what you are doing in your code.
Sorry, been a long night of code bashing.
Three.js doesn’t like greyscale textures, which are often used for roughness/specular/metalness maps. In case you have any in your gltf, make sure they are converted to rgb.
Aware this might not be the issue, but it’s tripped me up a few times.
The import doesn’t give me any errors while I test it locally . But now I realized that the RectAreaLightUniformsLib gives out an fatal error when I upload it to our live server. I’ll try to work it out on my own and get back if I luck out