POV-Ray : Newsgroups : povray.general : question about light_source Server Time
1 Nov 2024 01:21:31 EDT (-0400)
  question about light_source (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: CAS
Subject: question about light_source
Date: 17 Mar 2014 21:45:01
Message: <web.5327a436cbaab8476a92a3a00@news.povray.org>
I have known the value of solar irradiance in 817nm band is 1.08279
W/(m2*nm).How can I define it?  "light_source {<sun_x,sun_y,sun_z> color rgb
1.08279 } "I set statement as above in pov,but I doublt it is wrong,because
1.08279 is a solar irradiance,color rgb is color ,but I donnot know how
to convert them or how to define solar irradiance.beg a hot to help me !thank
you!


Post a reply to this message

From: scott
Subject: Re: question about light_source
Date: 18 Mar 2014 04:46:08
Message: <532807d0@news.povray.org>
> I have known the value of solar irradiance in 817nm band is 1.08279
> W/(m2*nm).How can I define it?

817nm is on the verge of not being visible at all to humans, you can 
look up the XYZ colour value of it from here:

http://www.cvrl.org/database/data/cienewxyz/lin2012xyz10e_5_7sf.htm

XYZ=(3.815429E-06,1.523114E-06,0.000000E+00)

Compare the size of those numbers to the ones around 500 nm, they are tiny.

If you want a realistic image output in sRGB then you can easily convert 
the XYZ values to RGB.

Wikipedia has the matrix equation here:

http://en.wikipedia.org/wiki/SRGB#The_forward_transformation_.28CIE_xyY_or_CIE_XYZ_to_sRGB.29

That will give you linear RGB which POV will accept with the "rgb" 
keyword, there is no need to do the second step for gamma correction 
(although you could if you wanted and then pass the values to POV with 
the "srgb" keyword, the results should be identical).

> "light_source {<sun_x,sun_y,sun_z> color rgb
> 1.08279 } "I set statement as above in pov,but I doublt it is wrong,because
> 1.08279 is a solar irradiance,color rgb is color ,but I donnot know how
> to convert them or how to define solar irradiance.beg a hot to help me !thank
> you!

The "scale" of lighting in the scene is up to you, a bit like the 
exposure of a camera. I suspect with a 817nm light source you'll need to 
multiply up the brightness by a large amount to get anything visible though.


Post a reply to this message

From: CAS
Subject: Re: question about light_source
Date: 18 Mar 2014 23:15:00
Message: <web.53290a8c7ece86556a92a3a00@news.povray.org>
scott <sco### [at] scottcom> wrote:
> > I have known the value of solar irradiance in 817nm band is 1.08279
> > W/(m2*nm).How can I define it?
>
> 817nm is on the verge of not being visible at all to humans, you can
> look up the XYZ colour value of it from here:
>
> http://www.cvrl.org/database/data/cienewxyz/lin2012xyz10e_5_7sf.htm
>
> XYZ=(3.815429E-06,1.523114E-06,0.000000E+00)
>
> Compare the size of those numbers to the ones around 500 nm, they are tiny.
>
> If you want a realistic image output in sRGB then you can easily convert
> the XYZ values to RGB.
>
> Wikipedia has the matrix equation here:
>
>
http://en.wikipedia.org/wiki/SRGB#The_forward_transformation_.28CIE_xyY_or_CIE_XYZ_to_sRGB.29
>
> That will give you linear RGB which POV will accept with the "rgb"
> keyword, there is no need to do the second step for gamma correction
> (although you could if you wanted and then pass the values to POV with
> the "srgb" keyword, the results should be identical).
>
> > "light_source {<sun_x,sun_y,sun_z> color rgb
> > 1.08279 } "I set statement as above in pov,but I doublt it is wrong,because
> > 1.08279 is a solar irradiance,color rgb is color ,but I donnot know how
> > to convert them or how to define solar irradiance.beg a hot to help me !thank
> > you!
>
> The "scale" of lighting in the scene is up to you, a bit like the
> exposure of a camera. I suspect with a 817nm light source you'll need to
> multiply up the brightness by a large amount to get anything visible though.


> I have used "XYZ=(3.815429E-06,1.523114E-06,0.000000E+00)" ,then converted xyz > to
linear RGB in your help.I set  "l
ight_source {<sun_x,sun_y,sun_z> color
> rgb <1.00229e-005,3.46021e-006,-5.65828e-007> ,and set output file type to be
>"*.HDR".The first column is the value 
of each pixel in the hdr image which is >simulated by pov ;The second column is
the value of each pixel in my >r
eflection image which is real image.My goal is the hdr image which I simulated >equal
to my reflection image.But I find
 my real image is 10 times as hdr >image.The trend of this two image is same,only
having a 10 times between >them.So I 
think there must be have some relation in it.
        0.021973        0.220900
        0.037354        0.375800
        0.037354        0.375800
        0.034424        0.346500
        0.027710        0.277700
        0.035400        0.355800
        0.039551        0.396900
        0.043945        0.441800
        0.044189        0.442800
        0.038086        0.382300
        0.043457        0.435400
        0.045410        0.456100
        0.047607        0.477200
        0.047607        0.477200
        0.041260        0.414600
        0.031006        0.311000
>I have checeked my code.I doublt maybe something wrong with below:
>"sphere
        {
         <x1-center_x,y1-center_y,z1-center_z>,
         1.55
        pigment {color rgb spectral}
        }
"
>This is my code to define the objects in scene.I use sphere," pigment {color >rgb
spectral}" I doublt this statement i
s wrong,"spectral" is my reflection >value such as below which I saved them in txt,and
I tell pov to read. These >value
s are reflection ,and they are float values.However color rgb is  color >,maybe this
is wrong,I doublt,but I donot know
 ,beg a help! Greate gratitudes!
            0.220900
            0.375800
            0.375800
            0.346500
            0.277700
            0.355800
            0.396900
            0.441800
            0.442800
            0.382300
            0.435400
            0.456100
            0.477200
            0.477200
            0.414600
            0.311000
            0.189700


Post a reply to this message

From: scott
Subject: Re: question about light_source
Date: 19 Mar 2014 05:09:58
Message: <53295ee6$1@news.povray.org>
>> I have used "XYZ=(3.815429E-06,1.523114E-06,0.000000E+00)" ,then converted xyz > to
linear RGB in your help.I set  "l
> ight_source {<sun_x,sun_y,sun_z> color
>> rgb <1.00229e-005,3.46021e-006,-5.65828e-007>

The fact that the blue component is negative indicates that this colour 
is outside of the sRGB colour space (just). I think POV will cope with 
this whilst raytracing, but I don't know how it will interpret negative 
colour values when writing to HDR.

> ,and set output file type to be >"*.HDR".The first column is the value
> of each pixel in the hdr image which is >simulated by pov ;The second column
is the value of each pixel in my >r
> eflection image which is real image.My goal is the hdr image which I simulated
>equal to my reflection image.But I find
>   my real image is 10 times as hdr >image.The trend of this two image is same,only
having a 10 times between >them.So I
> think there must be have some relation in it.

Where did your "real image" come from? Is it a photograph?

I also struggle to see how you are getting output pixels with a value 
around 0.04 when your light source is at a level of .00001. Can you post 
your whole scene (or a simplified version of it) to better understand 
what you are doing?


Post a reply to this message

From: CAS
Subject: Re: question about light_source
Date: 19 Mar 2014 08:05:01
Message: <web.532987827ece86556a92a3a00@news.povray.org>
scott <sco### [at] scottcom> wrote:
> >> I have used "XYZ=(3.815429E-06,1.523114E-06,0.000000E+00)" ,then converted xyz >
to linear RGB in your help.I set 
 "l
> > ight_source {<sun_x,sun_y,sun_z> color
> >> rgb <1.00229e-005,3.46021e-006,-5.65828e-007>
>
> The fact that the blue component is negative indicates that this colour
> is outside of the sRGB colour space (just). I think POV will cope with
> this whilst raytracing, but I don't know how it will interpret negative
> colour values when writing to HDR.
>
> > ,and set output file type to be >"*.HDR".The first column is the value
> > of each pixel in the hdr image which is >simulated by pov ;The second
column is the value of each pixel in m
y >r
> > eflection image which is real image.My goal is the hdr image which I simulated
>equal to my reflection image.But I 
find
> >   my real image is 10 times as hdr >image.The trend of this two image is same,only
having a 10 times between >them.
So I
> > think there must be have some relation in it.
>
> Where did your "real image" come from? Is it a photograph?
>
> I also struggle to see how you are getting output pixels with a value
> around 0.04 when your light source is at a level of .00001. Can you post
> your whole scene (or a simplified version of it) to better understand
> what you are doing?

#declare camera_za=0;
#declare camera_aa=0;
#declare camera_h=4267.2;
#declare camera_dist=4267.2+435;
#declare camera_y = camera_dist*cos(radians(camera_za));
#declare camera_LL = camera_dist*sin(radians(camera_za));
#declare camera_x = camera_LL*sin(radians(camera_aa));
#declare camera_z = camera_LL*cos(radians(camera_aa));

camera
{
angle  7.54371
location <camera_x,camera_y,camera_z >
look_at <0,0,0>
rotate <0,-31,0>
right x
up y
}

#declare sun_za = 31.65;
#declare sun_aa = 187.89;
#declare sun_dist = 152589828000;
#declare sun_y = sun_dist*cos(radians(sun_za));
#declare sun_LL = sun_dist*sin(radians(sun_za));
#declare sun_x = sun_LL*sin(radians(sun_aa));
#declare sun_z = sun_LL*cos(radians(sun_aa));

light_source {<sun_x,sun_y,sun_z>
            color rgb <1.00229e-005,3.46021e-006,-5.65828e-007> }

#declare geom_file_name = "pov-xyz.txt";
#declare spec_file_name = "pov-ref.txt";
#declare n = 0;
#fopen   Input_geom_file geom_file_name read
#fopen   Input_spec_file spec_file_name read
#while(defined(Input_geom_file))
    #read(Input_geom_file,x1,y1,z1)
    #read(Input_spec_file,spectral)
         sphere
        {
         <x1-center_x,y1-center_y,z1-center_z>,
         1.55
        pigment {color rgb spectral}
        }
    #declare n = n + 1;
#end
#debug concat(str(n,15,2),"\n")

It is my code.Real image is a photograph.the value of each pixel in real image
are like these:
0.220900
0.375800
0.375800
0.346500
0.277700
0.355800
0.396900
0.441800
0.442800
0.382300
I doublt this statement "pigment {color rgb spectral}"is wrong.spectral is
responsible to  "pov-ref.txt" which save the value of each pixel of real image.
the parameters I set are all real value calculated by real image ,my experiment
is to simulation the process of getting real image,so all the parameters are
decided by real image.the process of getting real image is the same of pov.


Post a reply to this message

From: scott
Subject: Re: question about light_source
Date: 19 Mar 2014 12:29:15
Message: <5329c5db$1@news.povray.org>
> It is my code.Real image is a photograph.the value of each pixel in real image
> are like these:
> 0.220900
> 0.375800
> 0.375800
> 0.346500
> 0.277700
> 0.355800
> 0.396900
> 0.441800
> 0.442800
> 0.382300
> I doublt this statement "pigment {color rgb spectral}"is wrong.spectral is
> responsible to  "pov-ref.txt" which save the value of each pixel of real image.

In general, writing "pigment{color rgb X}" does not mean the output 
image will have a pixel value of X. The value X tells POV how diffusely 
reflective the surface is, POV then uses the brightness of any lights, 
the relative position of the objects and surface normals to calculate 
what the pixel colour should be.

If your goal is to match the brightness of POV's output with your photo, 
then I suggest you simply add a multiplier to your light source and 
tweak it until they match:

#local FACTOR = 10.0;
light_source {<sun_x,sun_y,sun_z>
             color rgb <1.00229e-005,3.46021e-006,-5.65828e-007>*FACTOR }


Post a reply to this message

From: Warp
Subject: Re: question about light_source
Date: 19 Mar 2014 12:57:25
Message: <5329cc75@news.povray.org>
CAS <sup### [at] cstnetcn> wrote:
> I have known the value of solar irradiance in 817nm band is 1.08279
> W/(m2*nm).How can I define it?  "light_source {<sun_x,sun_y,sun_z> color rgb
> 1.08279 } "I set statement as above in pov,but I doublt it is wrong,because
> 1.08279 is a solar irradiance,color rgb is color ,but I donnot know how
> to convert them or how to define solar irradiance.beg a hot to help me !thank
> you!

Note that for the most part POV-Ray uses a quite simplistic Phong
lighting model with RGB values. It does not model light at different
wavelengths, nor is it able to process colors in any more complicated
ways than manipulating RGB values, nor are most of its lighting
calculations any more complex than the simple Phong lighting model.

(Note that "Phong lighting model", or "Phong reflection model", should
not be confused with "phong highlights". The lighting model is an
illumination model that simply adds three components to the color of
a surface: ambient (a constant), diffuse (a lighting component that's
independent of the viewing angle) and specular (a lighting component
that's dependent on the viewing angle).)

Far from me to disparage POV-Ray, but to be completely honest, the
Phong lighting model is quite poor and simplistic. (It's *major*
advantage is that it's very fast and can produce, when properly used,
acceptable results.)

If you want to convert a unit of irradiance into RGB, you'll have to
figure out the conversion formula. This is probably not a trivial task,
nor is it probably very productive because of the limitations of the
lighting model described above.

(There are many problems in getting an "accurate" conversion from some
standard irradiance unit to RGB. One of them is that the relation between
irradiance and the apparent brightness of what ends up on your monitor
screen is subject to rather complex gamma curve functions, which are not
only dependent on the gamma used by POV-Ray and the image file, but also
the gamma correction performed by your display hardware and the screen.)

-- 
                                                          - Warp


Post a reply to this message

From: CAS
Subject: Re: question about light_source
Date: 19 Mar 2014 20:55:01
Message: <web.532a3b6a7ece86556a92a3a00@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> CAS <sup### [at] cstnetcn> wrote:
> > I have known the value of solar irradiance in 817nm band is 1.08279
> > W/(m2*nm).How can I define it?  "light_source {<sun_x,sun_y,sun_z> color rgb
> > 1.08279 } "I set statement as above in pov,but I doublt it is wrong,because
> > 1.08279 is a solar irradiance,color rgb is color ,but I donnot know how
> > to convert them or how to define solar irradiance.beg a hot to help me !thank
> > you!
>
> Note that for the most part POV-Ray uses a quite simplistic Phong
> lighting model with RGB values. It does not model light at different
> wavelengths, nor is it able to process colors in any more complicated
> ways than manipulating RGB values, nor are most of its lighting
> calculations any more complex than the simple Phong lighting model.
>
> (Note that "Phong lighting model", or "Phong reflection model", should
> not be confused with "phong highlights". The lighting model is an
> illumination model that simply adds three components to the color of
> a surface: ambient (a constant), diffuse (a lighting component that's
> independent of the viewing angle) and specular (a lighting component
> that's dependent on the viewing angle).)
>
> Far from me to disparage POV-Ray, but to be completely honest, the
> Phong lighting model is quite poor and simplistic. (It's *major*
> advantage is that it's very fast and can produce, when properly used,
> acceptable results.)
>
> If you want to convert a unit of irradiance into RGB, you'll have to
> figure out the conversion formula. This is probably not a trivial task,
> nor is it probably very productive because of the limitations of the
> lighting model described above.
>
> (There are many problems in getting an "accurate" conversion from some
> standard irradiance unit to RGB. One of them is that the relation between
> irradiance and the apparent brightness of what ends up on your monitor
> screen is subject to rather complex gamma curve functions, which are not
> only dependent on the gamma used by POV-Ray and the image file, but also
> the gamma correction performed by your display hardware and the screen.)
>
> --
>                                                           - Warp
I have tryed to modify my code "light_source {<sun_x,sun_y,sun_z>
            color rgb <1.00229e-005,3.46021e-006,-5.65828e-007>*10}"or *100,I
find the result is the same as the "light_source {<sun_x,sun_y,sun_z>
            color rgb <1.00229e-005,3.46021e-006,-5.65828e-007>".
what I know is the value of reflection of each sphere .this reflection is amount
to specular (a lighting component that's dependent on the viewing
angle)."pigment {color rgb spectral}"maybe this sentence is wrong,this sentence
I defined in order to describe the spectral of each sphere.Maybe I should use
"finish {spectral X}".
I know pov is a render ,if I define light_source ,camera,objects,it will get a
image,I am not quite clear how pov to calculate  color of each pixel,only use
photon model?


Post a reply to this message

From: CAS
Subject: Re: question about light_source
Date: 19 Mar 2014 21:20:01
Message: <web.532a41e27ece86556a92a3a00@news.povray.org>
scott <sco### [at] scottcom> wrote:
> > It is my code.Real image is a photograph.the value of each pixel in real image
> > are like these:
> > 0.220900
> > 0.375800
> > 0.375800
> > 0.346500
> > 0.277700
> > 0.355800
> > 0.396900
> > 0.441800
> > 0.442800
> > 0.382300
> > I doublt this statement "pigment {color rgb spectral}"is wrong.spectral is
> > responsible to  "pov-ref.txt" which save the value of each pixel of real image.
>
> In general, writing "pigment{color rgb X}" does not mean the output
> image will have a pixel value of X. The value X tells POV how diffusely
> reflective the surface is, POV then uses the brightness of any lights,
> the relative position of the objects and surface normals to calculate
> what the pixel colour should be.
>
> If your goal is to match the brightness of POV's output with your photo,
> then I suggest you simply add a multiplier to your light source and
> tweak it until they match:
>
> #local FACTOR = 10.0;
> light_source {<sun_x,sun_y,sun_z>
>              color rgb <1.00229e-005,3.46021e-006,-5.65828e-007>*FACTOR }

I have modified my code:
" #local FACTOR = 10.0;
> light_source {<sun_x,sun_y,sun_z>
>              color rgb <1.00229e-005,3.46021e-006,-5.65828e-007>*FACTOR }"
I find the result is the same as "light_source {<sun_x,sun_y,sun_z>
>              color rgb <1.00229e-005,3.46021e-006,-5.65828e-007>",nor I mutiply 10
or 100,the result is not change.I 
am so confuse!


Post a reply to this message

From: CAS
Subject: Re: question about light_source
Date: 20 Mar 2014 04:00:01
Message: <web.532a9fab7ece86556a92a3a00@news.povray.org>
"CAS" <sup### [at] cstnetcn> wrote:
> scott <sco### [at] scottcom> wrote:
> > > It is my code.Real image is a photograph.the value of each pixel in real image
> > > are like these:
> > > 0.220900
> > > 0.375800
> > > 0.375800
> > > 0.346500
> > > 0.277700
> > > 0.355800
> > > 0.396900
> > > 0.441800
> > > 0.442800
> > > 0.382300
> > > I doublt this statement "pigment {color rgb spectral}"is wrong.spectral is
> > > responsible to  "pov-ref.txt" which save the value of each pixel of real image.
> >
> > In general, writing "pigment{color rgb X}" does not mean the output
> > image will have a pixel value of X. The value X tells POV how diffusely
> > reflective the surface is, POV then uses the brightness of any lights,
> > the relative position of the objects and surface normals to calculate
> > what the pixel colour should be.
> >
> > If your goal is to match the brightness of POV's output with your photo,
> > then I suggest you simply add a multiplier to your light source and
> > tweak it until they match:
> >
> > #local FACTOR = 10.0;
> > light_source {<sun_x,sun_y,sun_z>
> >              color rgb <1.00229e-005,3.46021e-006,-5.65828e-007>*FACTOR }
>
> I have modified my code:
> " #local FACTOR = 10.0;
> > light_source {<sun_x,sun_y,sun_z>
> >              color rgb <1.00229e-005,3.46021e-006,-5.65828e-007>*FACTOR }"
> I find the result is the same as "light_source {<sun_x,sun_y,sun_z>
> >              color rgb <1.00229e-005,3.46021e-006,-5.65828e-007>",nor I mutiply 10
or 100,the result is not change.
I
> am so confuse!



"#version 3.7;
//camera information:
camera
{
angle  7.54371
location <camera_x,camera_y,camera_z >
look_at <0,0,0>
rotate <0,-31,0>
right x
up y
}
//light information:
light_source {<sun_x,sun_y,sun_z>
            color rgb <1.00229e-005,3.46021e-006,-5.65828e-007>
             }
//scene information:
#declare geom_file_name = "pov-xyz.txt";
#declare spec_file_name = "pov-ref.txt";
#declare n=o;
#fopen   Input_geom_file geom_file_name read
#fopen   Input_spec_file spec_file_name read
#while(defined(Input_geom_file Input_spec_file))
    #read(Input_geom_file,x1,y1,z1)
    #read(Input_spec_file,ref)
        sphere
        {
        <x1-center_x,y1-center_y,z1-center_z>, //sphere location
         1.55     //sphere radius
        finish {specular ref}  //sphere specular
        }
    #declare n = n + 1;
#end
"
Above is all my code in pov,my aim is to use illumination model (phong light
model) to calculate the light intensity of each point.I want to know if I want
to use phong model to calculate ,whether need I to define phong to tell pov to
calculate.my code is all above,how can I to define phong model to calculate,I
need to use specular to calculate light intensity of each pixel. And  "finish
{specular ref}" Is my write  right? Beg a help!


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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