M4-025 - Digital Force Gauge, 0.25 lbs / 100 g / 1 N Capacity - 0.25lbs
I will definitely go back and triple check the color spaces of the blender and threejs files, but surprisingly as noted in this github issue:
The constant 683 is chosen based on a wavelength of 555nm (green) since that’s where human vision is most sensitive. You should probably use this throughout the calculation, but in any case the difference will be pretty small compared to 570nm.
Opticalintensity
I’m working with a gltf model that was made in Blender by another designer, and threejs is loading in the intensity as the Watt values that are used in Blender which is blowing out the image. I’m trying to get the scene as close to the original designer’s intent as possible, and being able to make the accurate calculation would probably help.
What is the formula used for multiplying color by intensity? Specifically, what format are the color values converted to in that equation (an example would be extremely helpful).
Luminousintensity
And just to add, I’m coming from more of a design background than a programming background so my math abilities/knowledge probably aren’t where they would need to be in order to make some of the more advanced calculations (matrices mostly). —Thank you!
lightintensity中文
Blender currently uses watts as its standard light measurement whereas gltf (and threejs) uses the candela as its measure. One of the posters in the github issue generously posted some of the conversion formulas, but the numbers I was getting weren’t lining up with the visuals. I then went back to the documentation and noticed that the luminous intensity (candela) figure I needed was not just the intensity value of the light, but the intensity multiplied by the color. So in order to calculate the values I need, I think I need the rest of the formula. Does that sound right? Let me know if I’m off somewhere.
This might be a terribly dumb question, but I’ve been searching for a while and unable to find an answer. On the Light documentation page it states that:
Light intensityunit
Looking like the calculation for spot lights requires some integration, but at a guess you might get decent results by replacing the 4pi in the above equation by the spotlight angle. So if the spotlight has an angle of 90 degrees (pi radian), the equation becomes:
How islight intensitymeasured
First I would check that you have correct color management settings. I’m not too familiar with recreating blender scenes in three.js, but as long as those settings are correct I would expect lighting intensity to be similar.
Honestly? It looked absolutely perfect when I applied that multiplier. Am I sure that 570 was the right number to use? Not totally, but it seemed to work.
Radiantintensity
Hello! I just wanted to follow up with my findings on this issue in case it could help out anybody else in the future. Before I posted initially, I just tried to eyeball the correct intensity values for the lights that were imported from the Blender GLTF.
luminous intensity中文
Or in other words, for a spotlight with an angle of 90 degrees, 1 watt = 217 candela. Note this is a guess, I would test a simple export with one spotlight from blender to see if it gives a decent result. If not, you’ll have to study the linked PDF from that issue to figure out the correct formula.
My problem was: what the heck was “color”? After some more looking around and testing, I guessed that “color” might be the actual light wavelength of the source light. My light was white (6500K) and to get that wavelength, I averaged the top and bottom numbers on this converter and I came up with:
I’m also not sure what you need to do for directional lights. I guess first figure out what units Blender uses for them and then try to find a conversion formula.
So, as I mentioned above and as @looeee helped me out with, I found some conversion formulas in a github post that discussed this issue. But unfortunately the formula that @looeee provided seemed to still be missing something when I tried to implement it. So I tinkered around a bit and finally found something that seemed to make it work. Here’s how it went:
I found that a value of about 10% of the original “Watts” value from Blender was pretty close. But I wanted it to be as close to the original as possible since this 3d implementation was going to be only one of the uses across multiple platforms.
Blender uses watts as units for power of point light sources. On the other hand, KHR_punctual_lights use lm/sr as light intensity units. I...
Light intensityformula
is the intensity value needed to correct for the numbers coming out of Blender (for white light specifically). It’s so close to my estimation of 10% that it makes me wonder if it was even worth all the time I spent figuring it out.
Ah, until they fix that bug I guess you’ll have to perform the conversion yourself. If you put Φe = 1 (watts) in the point light conversion calculations you get a ratio:
Base values: KV = 683 – This is a constant related to the modern definition of the candela Watts – Unit of light measurement used in blender Lumens – This seems to be an unnecessary intermediary conversion, but it keeps the formulas simpler Candela – Unit of light measurement used by GLTF Color – According to Threejs documentation part of the formula for candela calculation Intensity – Unit of light measurement used by Threejs, second part of the threejs candela calculation