lights sum, linear vs srgb

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 06 June 2013   #1
lights sum, linear vs srgb

Why don't two 50% lights sum up as 100% in linear mode, but do in srgb, simply making two overlaping spots to test shows each light at 50% in both cases, but the sum is different... I have read hellolux article but there is no obvious answer there, or atleast not for me, can anyone explain?

Thanks in advance =)

edit: to elaborate...

Twitter | Ratata

Last edited by sandidolsak : 06 June 2013 at 11:23 AM. Reason: image
Old 06 June 2013   #2
I've dug up this graph showing the sRGB values vs sRGB intensities, from here. The red line is the one.

50% on the x is close to 35% on the y. So it looks like there's a LWF conversion going on in calculating the combined brightnesses of two lights.

Not going to pretend to understand if this is 'correct' in physical terms - or if that's even a valid question. What is '50% brightness' for a light? Is a 50W bulb half as bright as a 100W bulb? If you overlap two 50W spot lights, do you get brightness equivalent to a 100W bulb in the space where they overlap? But the maths seems to point to the answer being here somewhere:

ProSite | Behance | Twitter
- - - - - -
Freelancer using Cinema4D? Sign up to the freelance directory:

Last edited by ChrisCousins : 06 June 2013 at 01:04 PM.
Old 06 June 2013   #3
Thanks Chris, yeah the math, I wonder too if this is correct, and if it is, an explanation in help files wouldn't hurt (I hope I didn't miss it) at least to know what to expect.
Twitter | Ratata
Old 06 June 2013   #4

Where the lights intersect would be some distance from the origin, and so I would think falloff would be a factor, so the sum of the brightness where they intersect would be less than the sum of the brightness at the source. Just a guess. . .
Old 06 June 2013   #5
nop, falloff is not the culprit, does the same with infinite light...
Twitter | Ratata
Old 06 June 2013   #6
It's a LWF thing. What happens is that when working in sRGB space the rendered pixel is gamma corrected.

This is what the renderer is doing:

sRGB gamma = ca. 2.2
light1 and light2 = 50%

degamma everything to bring it into linear space for rendering
50% ^ 2.2 = 21.783%
light1 and light2 = 21.763% after degamma

sum the lights
light1 + light2 = 43.527%

gamma correct the result
43.527% ^ 1/2.2 = 68.517%

When using linear color space there is no need for gamma correction. The problem with sRGB is that 50% are not 50% To get both lights added up to 100% you need to set the lights to 72.974% (50% ^ 1/2.2).

Old 06 June 2013   #7
Ok, thanks for this, now about

"When using linear color space there is no need for gamma correction."

does that mean setting "Input Color Profile" to linear?

cause if I do that 50% intensity gives 72% grey...

and how are we suppose to compare this to real light behaviour?

Twitter | Ratata
Old 06 June 2013   #8
Originally Posted by sandidolsak: "When using linear color space there is no need for gamma correction."

does that mean setting "Input Color Profile" to linear?

No, it must be a complete linear pipeline, e.g. linear input and 32bit output, which has linear color profile too.

It looks like the picture viewer always shows gamma corrected values, even for linear images. If you import the 32bit rendering into Photoshop you get the correct values.

Quote: and how are we suppose to compare this to real light behaviour?

It's simply adding values, same as real lights. It's just the gamma correction that makes it confusing. It would be easier if everything would work in linear color space, e.g. displays, textures etc.

There seems to a flaw in the degamma step for light sources though. It looks like it is always treating like linear input. I'll bring this to the attention of our developers.

Old 06 June 2013   #9
Oh my, this clears it out then, picture viewer color picker got me

thanks for all the info, I am glad it is clear what to expect now.
Twitter | Ratata
Old 06 June 2013   #10
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 12:09 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.