POV-Ray : Newsgroups : povray.general : TerraPOV tutorial articles in p.b.t : Re: TerraPOV tutorial articles in p.b.t Server Time
30 Jul 2024 08:23:22 EDT (-0400)
  Re: TerraPOV tutorial articles in p.b.t  
From: Bruno Cabasson
Date: 11 May 2009 06:10:00
Message: <web.4a07f88946a6ddb04aa45fdf0@news.povray.org>
Ive <"ive### [at] lilysoftorg"> wrote:
> Bruno Cabasson wrote:
> > Thanks for reading me, Ive!  :)
> >
> It's my pleasure.
>
>
> > I needed a start point for the scattering color of TerraPOV's
> > atmosphere. If you have a clear idea for rgb-wavelength
> > correspondance, and if you can provide 3 values for TerraPOV's
> > default, I will be very happy and thankful  :p .
> >
>
> Well, forget my last post, guess I was still sleepy. In fact selecting
> three wavelength values will *always* be arbitrary as you can calculate
> the RGB value for a given wavelength or spectrum, but not the other way
> around.
> But this is not needed because - we can simply calculate the RGB value
> from the spectral data itself. It can be done within the SDL with this
> few lines of code:
>
> //******************************************************
>
> #include "CIE.inc"
>
> // Create spectral data for Raleigh scattering following
> // the power of 4 rule. Range from 380 to 830 nm.
>
> #declare TP_RALEIGH_SPECTRUM = spline
> {
>    linear_spline
>
>    #local WL = 380;
>
>    #while (WL < 830)
>      WL, pow(380/WL, 4)
>      #local WL = WL + 5;
>    #end
> }
>
> // Calculate the RGB value by using the CIE color match

> // color space (sRGB/ITU primaries, whitepont D65 but
> // without gamma correction)
>
> #declare TP_RAYLEIGH_SCATTERING_COLOR =
> EmissiveSpectrum(TP_RALEIGH_SPECTRUM);
>
> //*****************************************************
>
>
> This gives for TP_RAYLEIGH_SCATTERING_COLOR the value of
>
> rgb <0.2978, 04382, 1.0000>
>
>
> This is a little less greenish than your result. But I must admit that
> your *arbitrary* value did come quite close and where well chosen ;)
>
> Anyway, feel free to use this color science approach or just keep your
> arbitrary values because I guess for the final result with a more
> complex atmosphere model the visible difference will be minor.
>
> Still waiting for the next part of your tutorial ;)
>
> -Ive

Thank you very much for those enlightments! I first chose my values by looking
at a sRGB xy chart, and trying visually to see what are the 'closest'
wavelengths to the 3 primaries by drawing an imaginary line from D65 white
point to the monochromatic path and passing by the 3 sRGB primaries. I do not
really know if this trick is physically correct (I guess it is not ...). But at
first I did not wonder much about it, because I knew I was not so far from
correct values, and the user can control those at will. BUT: I read somewhere
on the web that atmosphere's behaviour may depend on the elevations, meaning
that the 'correct default' parameters could be different for each case...

I think I'll put CMF values from CIE.inc into a spreadsheet, draw a precise
chart and have better graphical intersections. We will see how far it will be
from your values. However,

But, anyway, I think your values are better and more physically correct, and
I'll take them for TerraPOV.

newt article coming soon (quite busy with family life this week-end).

Thank you again.

Bruno.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.