I am trying to port a very old application (2015) from three.js v64 to v161.
Basically, it has 3 light sources, a particle system, some objects and skyboxes.
Without using “renderer.useLegacyLights = true;”
the lights are gone, no matter what values I use. Only the ambient light seems to have any effect.
What I have understood is that, since version 155, inputs given as SRGB colors/textures are transformed to LinearSRGB, then processed, and finally converted back to SRGB, when outputting. Anyway, no clue how to disable the legacy option and have lights working again…
Second, the shadows are wrong, as if the shadowCamera had been ignored.
Read the following two guides to understand the changes to color spaces and lighting in latest three.js versions:
BTW: Upgrading from r64 to 161 is a huge step. You might want to consider to break down your migration into steps of ten releases. Meaning r64 to r74 to r84 and so on. This will make it much easier to detect breaking changes and apply the respective migration tasks.
The point lights and spot lights in your scene are positioned about 0.25km from the scene origin. Intensities of 2–4 candela are about as bright as a couple of candles, which is why you aren’t seeing light at that distance. You’d need much brighter lights, on the order of thousands of candela. Or disabling decay is fine, if you don’t need the lights to decay over distance.
I understood the problem. If the tree was just 1.3 m height, then the lighting would be kind of adequate. But since it is 130m height, from the point of view of the light, it is as if a scale factor of 100 had been applied to the scene. Taking into account a quadratic attenuation factor with the distance, the intensities should have been 10.000 times brighter. Therefore, since I used some very low intensities, I had to set decay to zero, so the light does not vanish.
Anyway, it seems to me that it would be more appropriate having the possibility to set the coefficients of attenuation (a,b,c) directly: 1/(ax**2+bx+c). I think that how it is done in “unit” and “unreal”.