Re: Preetham Sun, spectral rendering back

Board: Home Board index Raytracing General Development

(L) [2012/01/02] [ost by amaan] [Re: Preetham Sun, spectral rendering] Wayback!

OK just found the Optix SDK code (Haven't looked at optix at all before this)

...\OptiX SDK 2.1.1\SDK\sutil\SunSky.

Thanks,
Amaan
(L) [2012/01/05] [ost by amaan] [Re: Preetham Sun, spectral rendering] Wayback!

Hi all,

At the risk of further embarrassing myself, here are a few more questions if you have time. I've seen the the Optix code and it's been helpful in tracking down the units issue. In the spectrum-to-XYZ conversion code, a multiplicative factor pops up again
Code: [LINK # Select all]for (int i = 0; i < 38; ++i)
{
        XYZ.X += attenuated_sunlight[i] * cie_table[i][1] * 10.0f;
        XYZ.Y += attenuated_sunlight[i] * cie_table[i][2] * 10.0f;
        XYZ.Z += attenuated_sunlight[i] * cie_table[i][3] * 10.0f;
}

Where does this factor of 10 come from? Is this because of the 10nm wavelength data interval that we need to take in to account when integrating?

Also, I am converting to RGB from XYZ using sRGB primaries matrix, and have a linear multiplier to scale down the super-bright values returned. The generated output is then transformed from linear colour space to gamma-encoded (1/2.2 as an approximation to sRGB) for viewing. Are you guys using this method as well?

Also, when the sun is at zenith, I get an undesirable pink shade around the horizon. I have seen this in some implementations, and not in others. (Mine does not yet have Aerial Perspective implemented. I am not sure if that has any impact on the look of the horizon). Have you guys noticed this too?

Thanks again,
Amaan
(L) [2012/01/06] [ost by graphicsMan] [Re: Preetham Sun, spectral rendering] Wayback!

The preetham model has issues when the sun is near the horizon.
(L) [2012/01/07] [ost by tstanev] [Re: Preetham Sun, spectral rendering] Wayback!

>> amaan wrote:

Where does this factor of 10 come from? Is this because of the 10nm wavelength data interval that we need to take in to account when integrating?

Also, when the sun is at zenith, I get an undesirable pink shade around the horizon. I have seen this in some implementations, and not in others. (Mine does not yet have Aerial Perspective implemented. I am not sure if that has any impact on the look of the horizon). Have you guys noticed this too?

The 10 there is due to the integration over increments of 10 nm.

You may try playing with the "turbidity" value to make the horizon less pink. Also there is some dependence on the lat-lon location, though I have not experimented much with that myself.
(L) [2012/01/07] [ost by amaan] [Re: Preetham Sun, spectral rendering] Wayback!

Thanks graphicsMan and tstanev. Good to confirm the integration bit.

Any more info on this lat-long dependence?
(L) [2013/02/20] [ost by spectral] [Re: Preetham Sun, spectral rendering] Wayback!

And does someone know what mean the sun_scale factor (1 / 3200000) in the OptiX implementation ?

back