Karma real-world illuminance

   3601   3   1
User Avatar
Member
207 posts
Joined: Nov. 2015
Offline
Hi;

I have a scene that - for the sake of conversation - is an architectural visualization scene. So, daylight streaming in windows + some interior lights. I would like to render my scene using real-world lighting units (i.e. lux), or at least as close as possible to this.

Let's say here is my scene using the Houdini Skylight rig + geo imported into Solaris and rendered in Karma, with an intensity of 1:



Let's say I want my light intensity to be expressed in real-world lux units. This is a sunny day, so my measured lux is 51,000. So I set my sky lights (which is a directional light and a light dome) Intensity values to 51,000. This produces this image:



This image looks odd to me; the brightest pixel value is around 6 (I would expect, if we're dealing with real-world lux - values much higher), the blacks are surprisingly visible, and the saturation is nonexistent.

If I take the first image above and multiply it by 51,000, I see an image that makes more sense to me (basically completely white on a display,, with much higher pixel values):




I'm very confused by this. Would anyone be able to explain why Karma generates the second image? It feels as though energy is not being properly conserved, or that it's rendering in some sort of lower precision or something.

I have ensured that all images I'm rendering (beauty and all AOVs) are 32-bit float.
Edited by dhemberg - March 28, 2022 02:26:45

Attachments:
Screen Shot 2022-03-27 at 11.15.01 PM.png (3.2 MB)
Screen Shot 2022-03-27 at 11.15.09 PM.png (1.1 MB)
Screen Shot 2022-03-27 at 11.14.48 PM.png (44.8 KB)

User Avatar
Member
8177 posts
Joined: Sept. 2011
Offline
dhemberg
Let's say I want my light intensity to be expressed in real-world lux units. This is a sunny day, so my measured lux is 51,000. So I set my sky lights (which is a directional light and a light dome) Intensity values to 51,000.

The default distant light already has an intensity of 50,000. Multiplying it by a further 50,000 will produce an extremely over-bright image. So the value already represents a measured irradiance, just with the units divided out. Remember that a real camera would have exposure value and sensitivity as part of the equation. The CG camera essentially divides the flux by the exposure value so any real world units are factored out. You could define an EV for the camera and multiple the scaling factor back in to the lights, but for what purpose?

dhemberg
I'm very confused by this. Would anyone be able to explain why Karma generates the second image? It feels as though energy is not being properly conserved, or that it's rendering in some sort of lower precision or something.

Values are clamped at 10 by default. Expecting to use crazy high values isn't going to work without changing the clamp value. The variance threshold is also probably way too low for a scene that over lit.

Most renderers are optimized to effectively render a properly exposed image. Rendering an image that's 10 or 20 stops overexposed is going to run into a number of problems.
User Avatar
Member
207 posts
Joined: Nov. 2015
Offline
jsmack
The default distant light already has an intensity of 50,000.

Can I trouble you to elaborate on this? I presume what you're calling the "default distant light" is the Distant Light in LOPS; I don't see a value of 50k set on this light though.

jsmack
Remember that a real camera would have exposure value and sensitivity as part of the equation.

Yes, exactly. At the moment I'm using a lens shader with some expressions to convert EV to an intensity multiplier on the Karma lens shader, to simulate a photographic exposure.

jsmack
You could define an EV for the camera and multiple the scaling factor back in to the lights, but for what purpose?

If you're asking seriously and not rhetorically to try to make me feel foolish about asking the questions I'm asking:

Imagine a game-like environment, where you have the ability to spawn randomly within an environment. Some rooms in this environment are darker than others, the weather outside may be changing, etc. This is sort of what I'm building; an environment in which I can spawn a camera aimed at a part of the environment.

If I were handling this like a shot TD, I could rely on having a single camera, and I could balance my lights for the intent of my shot. But in my current case, I don't want to have to rebalance my lights based on spawn position. Rather - because I have experience as a film photographer - I would like to treat the scene as I would with a real camera, where I rely on autoexposure to choose an appropriate shutter/fstop/ISO for my composition.

In my scenario, sometimes I want it to be late afternoon, sometimes morning, sometimes night (with interior lights becoming more dominant). Sometimes the day will be partly cloudy, other times clear and sunny.

To me, the most sensible way to approach this is to have my lights represent some sort of real-world basis...lux seems like as good as any of a standard to impose. I'm aware Houdini is not by default set up like this...I'm trying to figure out how to do the work to make it so (if I can).

So, part of the problem is getting a camera to do "autoexposure". I've got that part working reasonably well. I just need my lights to be physically plausible. Interior lights currently use IES profiles with lux values specified within them. The sky is something I'm still trying to work out how to handle in this kind of a setup.

My assumption is that an intensity value of "1" is meant to signify EV 0. But a distant light value of 1 and a point light value of 1 don't make much sense to me if one is meant to represent the sun and the other is meant to represent a small bulb. So, I'm thinking my intensity values should be scaled to match the lux they are intended to represent.

This, yes, produces a totally blown-out image if the camera has no photographic controls. If I can build a digital 'light meter' of sorts, however, I should be able to bring the values back into a reasonable range, and with self-consistency throughout the scenario.



jsmack
Values are clamped at 10 by default. Expecting to use crazy high values isn't going to work without changing the clamp value.

Thank you, yes, raising this parameter does produce the image I expect.

jsmack
The variance threshold is also probably way too low for a scene that over lit.

Oh nice call, I wouldn't have immediately considered this, but you're right. Thank you.

jsmack
Most renderers are optimized to effectively render a properly exposed image. Rendering an image that's 10 or 20 stops overexposed is going to run into a number of problems.

Indeed! I'm interested in solving them for my scenario here! But I do wish to impress that I'm not making these choices arbitrarily, and I do know a fair bit about how photography works.
Edited by dhemberg - March 28, 2022 23:34:15
User Avatar
Member
8177 posts
Joined: Sept. 2011
Offline
dhemberg
The default distant light already has an intensity of 50,000.

Can I trouble you to elaborate on this? I presume what you're calling the "default distant light" is the Distant Light in LOPS; I don't see a value of 50k set on this light though.

The usd schema defines the default intensity value as 50000 and angle of 0.53 degrees with normalize power off. This value a pixel value approximately equivalent to reflectivity.

With normalize on, karma produces a pixel value of reflectivity/π when using an intensity of 1.

dhemberg
Yes, exactly. At the moment I'm using a lens shader with some expressions to convert EV to an intensity multiplier on the Karma lens shader, to simulate a photographic exposure.

As long as you're handling that side of the equation, then modeling real world lux can make sense. Karma and solaris aren't setup to handle it out of the box though so you might run into some challenges. The clamping and variance values are based on pixel values, so as long as the lens shader brings the image values into range, even with very bright lights, the clamping shouldn't be an issue anymore.

dhemberg
If you're asking seriously and not rhetorically to try to make me feel foolish about asking the questions I'm asking:

Sorry to give you a hard time, I am rather curious about why one would make things more complicated, but your setup seems to warrant it and isn't something I'd considered before. There are other renderers that are more suitable to architecture renderings don't make so many assumptions about tying all lights around unitless values.
  • Quick Links