# 3D How to use Lux as unit for directional light intensity?

## Recommended Posts

I would like to use Lux as the unit for light intensity values of the directional lights in my engine, but I'm not sure how that would actually work. Lux describes the light intensity for an area, but how would I translate that to the light intensity for a fragment? As far as I know, both Unity and Unreal use Lux as unit, and the glTF light source specification uses it as well, so it's obviously possible somehow? I can't find any references on this topic whatsoever.

I assume I have to calculate the size of a fragment in world units? If so, how would one do that?

##### Share on other sites

Lux is basically the photometric equivalent of irradiance: they're both units of flux density. For a punctual directional light computing irradiance/illuminance is really simple: you multiply the intensity of the directional light by N dot L. This means your dirlight intensity is essentially "Illuminance on a surface that's perpendicular to the directional light".

If you then want to apply physical camera exposure values to your rendered luminance values in an HDR framebuffer, you can follow through this blog series.

##### Share on other sites
8 hours ago, MJP said:

Lux is basically the photometric equivalent of irradiance: they're both units of flux density. For a punctual directional light computing irradiance/illuminance is really simple: you multiply the intensity of the directional light by N dot L. This means your dirlight intensity is essentially "Illuminance on a surface that's perpendicular to the directional light".

Thank you, although I'm not quite sure I understand.

The intensity of my directional light source is defined in Lux. Or, to be more precise, the directional light source doesn't actually have an intensity, I'm just defining the illuminance of all surfaces being lit by the light source in Lumen per square-meter. That means I already have the illuminance, but I'm not sure what to do with it.

For spot- and point-lights I define the intensity in Lumen, then convert that to Candela and multiply that with my light color. I'm not 100% sure that's correct, but the results seem to match what I'd expect it to look like.

Now for directional light sources, I could convert the Lux to Candela as well:

cn = lx /sr

(cn = candela, lx = lux, sr = steradians)

The sun is a sphere, so the solid angle should be 4πsr. That means for 100 Lux, I end up with cn = 100 /4π = 7.96 Candela. For 10,000 Lux, I get 795.77 Candela. I suppose that does sound like it may be correct, but I'm not sure.

Am I on the right track, or am I completely off?

## Create an account

Register a new account

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 16
• 9
• 15
• 9
• 11