Author Topic: Color in Corona  (Read 7676 times)

2015-07-06, 05:39:37

fobus

  • Active Users
  • **
  • Posts: 388
    • View Profile
I found strange thing doing simple test of colored lighting. As color theory states color of object is part of light reflected back to us.

So If we'll light perfectly reflective surface with perfectly white color it will give us all the light back (in diffuse or specular way) and we'll see white (or mirror) object. But if surface absorbs some wavelength it will give us some color reflected. For example if we have object that absorbs red color it will reflect to us some kind of cyan color, or if object seen as red it tells us that green and blue colors absorbed. So...if we'll take perfectly green (as we see) colored object it has to absorb red and blue colors, right?

Test. Corona. Green sphere lit by red and blue lamps. We see sphere lit by them. WHY???

2015-07-06, 11:19:41
Reply #1

Mr.Schorsch

  • Active Users
  • **
  • Posts: 153
    • View Profile
    • fokuspunkt
maybe because the light spheres are visible to cam and reflection. I think, that in the core the have a pure diffuse of the light color. So maybe it is not reflecting the light, but the light Emitter?!

Corona Guys, please correct me if i am wrong.

2015-07-06, 11:35:24
Reply #2

fobus

  • Active Users
  • **
  • Posts: 388
    • View Profile
It is very interesting that V-Ray in comparison with Corona rendered pure black sphere that way.

2015-07-06, 12:02:06
Reply #3

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
this is by design. Corona internally works in Wide RGB color space, so it is able to mix pure red/blue with pure green. See: https://forum.corona-renderer.com/index.php/topic,60.msg207.html#msg207
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2015-07-06, 12:29:41
Reply #4

pokoy

  • Active Users
  • **
  • Posts: 1861
    • View Profile
this is by design

...and it's good like that.
OP, if you happen to have a studio lighting project with pure colors for objects or lights one day you'll be grateful that it works that way in Corona, everything else may end up looking very artificially. Also, you'll have a hard time to find a light or a material in real life that's composed of pure r/g/b values.

2015-07-06, 14:06:32
Reply #5

fobus

  • Active Users
  • **
  • Posts: 388
    • View Profile
this is by design. Corona internally works in Wide RGB color space, so it is able to mix pure red/blue with pure green. See: https://forum.corona-renderer.com/index.php/topic,60.msg207.html#msg207

So is it not physically correct to see pure black when red light lights green wall? I thought that perfectly green (0,255,0) wall absorbs all the red(255,0,0) and blue(0,0,255) spectrum (that's why it is green). Am I not right?

this is by design

...and it's good like that.
OP, if you happen to have a studio lighting project with pure colors for objects or lights one day you'll be grateful that it works that way in Corona, everything else may end up looking very artificially. Also, you'll have a hard time to find a light or a material in real life that's composed of pure r/g/b values.

I don't care about real life with a lot of other material and light preferences  than we have in Corona material. I'm care about physically correct color definition. I mean that if we have a color that absorbs another color it have to be this way to be physically correct.
« Last Edit: 2015-07-06, 15:09:11 by fobus »

2015-07-06, 14:41:26
Reply #6

fobus

  • Active Users
  • **
  • Posts: 388
    • View Profile
As I understood from Ondra's link it is a feature(bug?) of converting RGB colors to XYZ color space. Corona (or XYZ, or conversion process) can't convert pure red (green, blue) RGB color in to the same pure color in XYZ space. It (error of conversion) leads to render not exactly what we're sending to render.

2015-07-06, 14:50:55
Reply #7

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12754
  • Marcin
    • View Profile
<my previous messages were just a stupid mistake with output map from my side>
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2015-07-06, 17:49:35
Reply #8

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
So is it not physically correct to see pure black when red light lights green wall? I thought that perfectly green (0,255,0) wall absorbs all the red(255,0,0) and blue(0,0,255) spectrum (that's why it is green). Am I not right?

There is no simple answer.

The problem with calculating only in sRGB/wideRGB/XYZ color space is that you calculate the result for only 3 color samples, while in reality the number of "samples" (wavelengths) is infinite. This is what spectral rendering solves - when implemented correctly, it actually computes the result in all possible wavelengths (but they need to be sampled since there is infinite number of them, so the noise will be increased).
tl;dr: spectral renderers provide more accurate result but are slower than sRGB/Wide RGB/XYZ renderers

BUT

completely another problem is inputs. Today nobody has spectral inputs. You cannot just look at a surface and estimate its color as spectrum, while you can do that for sRGB. In fact, there is infinite number of DIFFERENT SPECTRAL INPUTS that create the SAME VISIBLE COLOR for human eye (and sRGB). This is called metamerism. This means 2 spectrally very different colors can be perceived as the same by human (and have same sRGB values). But they might behave differently when you shine different light on them. It also means single sRGB color can be interpreted in infinite number of ways, all correct.

Now this is in essence the part that Corona does differently: you still input colors with sRGB values. But Corona interprets the SAME VISIBLE COLOR as a DIFFERENT SPECTRAL INPUT. This means that some operations will come out differently (like in your example, green+blue is not black).

We cannot say that sRGB or Wide RGB is 100% correct or wrong. User just inputted ambiguous description that Corona chosen to interpret differently. But Corona Wide RGB interpretation of color is closer to reality than sRGB for all natural light sources and for all material colors - Corona interprets spectra as being more smooth and less spiky than sRGB, which is what usually happens in reality. This is why we use it.



Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2015-07-17, 17:13:15
Reply #9

Malor

  • Active Users
  • **
  • Posts: 19
    • View Profile
Quote
So is it not physically correct to see pure black when red light lights green wall? I thought that perfectly green (0,255,0) wall absorbs all the red(255,0,0) and blue(0,0,255) spectrum (that's why it is green)

I'm sorry, but don't you think that using words "physically correct" and "pure" in the same sentence is a bit of an oxumoron? ;)