POV-Ray : Newsgroups : povray.text.scene-files : Visualising the POV3.5 'reflectivity' function Server Time
22 Dec 2024 22:32:14 EST (-0500)
  Visualising the POV3.5 'reflectivity' function (Message 1 to 8 of 8)  
From: Don Barron
Subject: Visualising the POV3.5 'reflectivity' function
Date: 28 Aug 2002 07:25:03
Message: <web.3d6cb2aa2d5cd68d9c0bac10@news.povray.org>
The Version3.5 feature of  reflectance varying with angle is extremely
useful for the work I do in modelling the internals of complex optical
systems.  But the documentation is somewhat sketchy.  For my particular
application I wish to model surfaces which are 'anti-reflection' coated for
rays nearly normal to the surface but the reflectivity increases rapidly
away from some limits.  Typically the reflectivity may be 0.25% for normal
incidence but rises to 1% at 20deg and  50%at 70deg.  So it's a challenge
to find the variables of Reflmin,Reflmax and falloff  which give the best
fit.

Herewith two simple pov scripts.  The first sets up a camera looking into a
'mirror' to see a reflection of a glowing plane behind the camera.  The
scene is animated with the falloff value.  The second script is a viewer
for the images converted to heightfields so one can get an idea of the
values of reflectivity as a function of angle.

Script 1:

/*   Shows the variation of the POV35 'reflection { Min,Max falloff}'
function

We view in a mirror a white glowing screen behind the camera. The reflection
properties of the mirror
are set by the numerical values in

                reflection { Reflmin,Reflmax,Forlofmin,Forlofmax }

In this case we animate the 'falloff' between upper and lower values to
indicate the way it behaves.

We can then make an animated 'graph' by viewing the intensity in the image
in the Vurefl.pov and making an avi
and then an mpeg.

*/

global_settings{hf_gray_16 max_trace_level 2 }
plane { z,-1e3  texture { pigment {  rgb 1 } finish { ambient 1 diffuse 0 }
} }    // a glowing plane behind the window

#declare k = clock;
#declare Reflmin   =0.0025;  #declare Reflmax   = 1.0;
#declare Forlofmin =1.0;     #declare Forlofmax = 80;
box { <-1e4,-1e4,0>,< 1e4,1e4,10>
      pigment { rgbt 1 }
      finish { ambient 0 diffuse 0 reflection { Reflmin,Reflmax falloff
Forlofmin + k*( Forlofmax-Forlofmin)} }
    }

camera { location -z*1e2 look_at 0  angle 178  }


Script 2



 /*  Reads in a sequence of images 'Title1.tga'  and makes height-fields for
animation.  */

#declare Drawgraph = 0;           // 0/1 for solid/line
#declare Title1    = "refl"
#declare Nframes   = 99.0;
#declare k2        = clock;
#declare Num       = floor((Nframes-1.0)*k2+1.0);
#declare View      = 1;

#switch ( Nframes )
 #range(2,9)
     #declare N2  = str(Num,0,0)
     #declare N3  = concat ( Title1,N2,".tga")
 #break
 #range (10,99)
   #switch( Num )
     #range( 1,9)
         #declare N2  = str(int(Num),0,0)
         #declare N3  = concat ( Title1,"0",N2,".tga")
     #break
     #range(10,100)
         #declare N2  = str(int(Num),0,0)
         #declare N3  = concat ( Title1,N2,".tga")
     #break
   #end
 #break
#end

intersection { box {<-0.5,0,-0.5>,<0.5,10,0.5> }
               height_field { tga  #switch ( Nframes)
                              #case (1)  Title1    #break
                                #else      N3      #break
                              #end
                              translate <-0.5,-0.0001,-0.5> rotate y*90
scale 1
                              pigment { rgb <1,1,0.5> } finish { ambient 0.1
diffuse 0.7 }
                            }
               #if(Drawgraph = 1) height_field { tga  #switch ( Nframes)
                                                 #case (1)  Title1    #break
                                                   #else      N3      #break
                                                 #end
                                                 translate <-0.5,-0.01,-0.5>
rotate y*90 scale 1
                                                 pigment { rgb <1,1,0.5> }
finish { ambient 0.1 diffuse 0.7 }
                                                 inverse
                                               }
               #end
               plane { z,0.0001     pigment { rgb 0} }
               plane { z,0 inverse  pigment { rgb 0} }
               pigment { rgb <1,0,0> } finish { ambient 1 diffuse 0 }
               #declare  Vsc = 1; scale <1,Vsc,1>
             }


box { <-0.01,0,0>,<0.01,1,0.01> pigment { gradient y color_map{ [0.00 rgb 1]
                                                                [0.95 rgb 1]
                                                                [0.95 rgb 0]
                                                                [1.00 rgb 0]
                                                              }
                                           scale 0.1
                                        }
                                finish { ambient 1 }
    }

background { rgb <1,1,0>}
camera { up y right x location <0,0.5,-10> look_at y*0.5 angle 7 }


Post a reply to this message

From: TinCanMan
Subject: Re: Visualising the POV3.5 'reflectivity' function
Date: 28 Aug 2002 07:53:31
Message: <3d6cb9bb$1@news.povray.org>
> systems.  But the documentation is somewhat sketchy.  For my particular
> application I wish to model surfaces which are 'anti-reflection' coated
for
> rays nearly normal to the surface but the reflectivity increases rapidly
> away from some limits.  Typically the reflectivity may be 0.25% for normal
> incidence but rises to 1% at 20deg and  50%at 70deg.  So it's a challenge
> to find the variables of Reflmin,Reflmax and falloff  which give the best
> fit.

You may want to make use of the 'slope' pattern used in conjunction with
multiple textures with varying reflectivities.  It might give you more
control.

On the other hand, if you are just having difficulty visualizing the
variables, I like to set up the equation with a graph in excel so I can play
with the variables and see the effect.

-tgq


Post a reply to this message

From: Warp
Subject: Re: Visualising the POV3.5 'reflectivity' function
Date: 28 Aug 2002 10:43:31
Message: <3d6ce193@news.povray.org>
TinCanMan <Tin### [at] hotmailcom> wrote:
> You may want to make use of the 'slope' pattern

  Not good if you want it to work when the object is viewed reflected from
another surface.
  The slope pattern fixes the "angle of incidence", while with variable
reflection the angle of incidence is the true angle of incidence, regardless
of where does the ray come from.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Don Barron
Subject: Re: Visualising the POV3.5 'reflectivity' function
Date: 30 Aug 2002 05:20:06
Message: <web.3d6f36caf7331817b1c3f3b80@news.povray.org>
TinCanMan wrote:
>> systems.  But the documentation is somewhat sketchy.  For my particular
>> application I wish to model surfaces which are 'anti-reflection' coated
>for
>> rays nearly normal to the surface but the reflectivity increases rapidly
>> away from some limits.  Typically the reflectivity may be 0.25% for normal
>> incidence but rises to 1% at 20deg and  50%at 70deg.  So it's a challenge
>> to find the variables of Reflmin,Reflmax and falloff  which give the best
>> fit.
>
>You may want to make use of the 'slope' pattern used in conjunction with
>multiple textures with varying reflectivities.  It might give you more
>control.
>
>On the other hand, if you are just having difficulty visualizing the
>variables, I like to set up the equation with a graph in excel so I can play
>with the variables and see the effect.
>
>-tgq
> Thanks for that..but I could not locate the equation in the documentation - hence my
need for the artificial setup.  I'm not too familiar with the more subtle features of
POVRAY - so I'd welcome an example of the 'slope' pattern method you suggest - what
about texturing a lens with the coating I described?


Post a reply to this message

From: TinCanMan
Subject: Re: Visualising the POV3.5 'reflectivity' function
Date: 30 Aug 2002 08:20:41
Message: <3d6f6319$1@news.povray.org>
> > Thanks for that..but I could not locate the equation in the
documentation - hence my need for the artificial setup.  I'm not too
familiar with the more subtle features of POVRAY - so I'd welcome an example
of the 'slope' pattern method you suggest - what about texturing a lens with
the coating I described?


After consideration, I'm not sure if slope will give you the effect you are
looking for.
The slope pattern is only affected by the surface normal relative to a
specified vector.  This could help give different reflectivity models to
different parts of the lens but wouldn't affect the individual
reflectivities.

Perhaps if you can describe more accurately what you are looking for, we can
arrive at the solution you need.

As for the variable reflection model, you can look at it this way:
reflection{
  min
  max
  falloff exp
}

min is the amount of reflection when the angle of incidence is 0deg
max is the amount of reflection when the angle of incidence is 90deg
falloff is how the reflection values vary between 0 and 90, i.e., linear,
square, cubic, etc.

Therefore your equation would be:

r(ang)= (ang/90*(max-min))^exp

where r(ang) = reflectivity at angle ang (in degrees)

this, of course, doesn't apply to the fresnel reflection model (actually it
could, but I just don't know)

-tgq


Post a reply to this message

From: Don Barron
Subject: Re: Visualising the POV3.5 'reflectivity' function
Date: 30 Aug 2002 10:55:03
Message: <web.3d6f865df7331817f059ed4d0@news.povray.org>
TinCanMan wrote:
>> > Thanks for that..but I could not locate the equation in the
>documentation - hence my need for the artificial setup.  I'm not too
>familiar with the more subtle features of POVRAY - so I'd welcome an example
>of the 'slope' pattern method you suggest - what about texturing a lens with
>the coating I described?
>
>
>After consideration, I'm not sure if slope will give you the effect you are
>looking for.
>The slope pattern is only affected by the surface normal relative to a
>specified vector.  This could help give different reflectivity models to
>different parts of the lens but wouldn't affect the individual
>reflectivities.
>
>Perhaps if you can describe more accurately what you are looking for, we can
>arrive at the solution you need.
>
>As for the variable reflection model, you can look at it this way:
>reflection{
>  min
>  max
>  falloff exp
>}
>
>min is the amount of reflection when the angle of incidence is 0deg
>max is the amount of reflection when the angle of incidence is 90deg
>falloff is how the reflection values vary between 0 and 90, i.e., linear,
>square, cubic, etc.
>
>Therefore your equation would be:
>
>r(ang)= (ang/90*(max-min))^exp
>
>where r(ang) = reflectivity at angle ang (in degrees)
>
>this, of course, doesn't apply to the fresnel reflection model (actually it
>could, but I just don't know)
>
>-tgq
>Thanks for that - that's the absent 'formula'.  It's obviously a very convenient
form...  I find that to get the form that fits my requirements the exponent must be
very high - typically 100.

In my model I was also concerned about the significance of values in the
diagonal of the image from a  4/3 ratio perspective camera with an angle of
178deg.

(I've only just discovered the use of these newsgroups and had been
e-mailing your colleague Chris Huff concerning my simulation of diffraction
gratings in scattering 'media'  and the built-in models for coloured light
and chromatic variation of refractive index... do you have those 'formulae'
?)

I would like to  simulate distortion in real camera lenses such as zooming
lenses with multiple elements.   I've developed a fairly convenient method
of taking the lens prescription from my preferred lens design program (
OSLO Pro) and placing it in front of the POV camera to model stray-light
etc but it's very time-consuming.  Not a lot I can do about that... but
it's quite straightforward to derive polynomials to define the lens
distortion ( ratio of the tangents of the true/apparent angles)  as a
function of zoom setting and field angle.   I imagined putting a
rotationally symmetric aspherical plate in front of the POV camera which
would deviate the sightline ray direction to simulate the distortion. Or is
it possible to do this with the texture in the camera statement?

Yours,

Don Barron


Post a reply to this message

From: TinCanMan
Subject: Re: Visualising the POV3.5 'reflectivity' function
Date: 30 Aug 2002 12:48:15
Message: <3d6fa1cf@news.povray.org>
> In my model I was also concerned about the significance of values in the
> diagonal of the image from a  4/3 ratio perspective camera with an angle
of
> 178deg.

I don't understand what you mean here.

> (I've only just discovered the use of these newsgroups and had been
> e-mailing your colleague Chris Huff concerning my simulation of
diffraction
> gratings in scattering 'media'  and the built-in models for coloured light
> and chromatic variation of refractive index... do you have those
'formulae'
> ?)

Again, I'm not sure what you are looking for here.  You would be better to
post your questions in a different group as this one isn't really
appropriate for these types of questions, it is for posting of text
scene-files as the name implies.  I'm not sure what kind of traffic it gets
from the community.  Better to try povray.advanced-users or povray.general.

> I would like to  simulate distortion in real camera lenses such as zooming
> lenses with multiple elements.   I've developed a fairly convenient method
> of taking the lens prescription from my preferred lens design program (
> OSLO Pro) and placing it in front of the POV camera to model stray-light
> etc but it's very time-consuming.  Not a lot I can do about that... but
> it's quite straightforward to derive polynomials to define the lens
> distortion ( ratio of the tangents of the true/apparent angles)  as a
> function of zoom setting and field angle.   I imagined putting a
> rotationally symmetric aspherical plate in front of the POV camera which
> would deviate the sightline ray direction to simulate the distortion. Or
is
> it possible to do this with the texture in the camera statement?
>
> Yours,
>
> Don Barron
>
>

You're getting a bit beyond me here.
I can tell you that you can use a 'normal' pattern in the camera statement
to cause distortions, but I have never really tried it myself so I don't
know how to work it.

For inromation about lens simulations, have a look at this link:
http://citeseer.nj.nec.com/127209.html

-tgq


Post a reply to this message

From: Don Barron
Subject: Re: Visualising the POV3.5 'reflectivity' function
Date: 30 Aug 2002 15:45:04
Message: <web.3d6fca05f733181721172b8b0@news.povray.org>
TinCanMan wrote:
>> In my model I was also concerned about the significance of values in the
>> diagonal of the image from a  4/3 ratio perspective camera with an angle
>of
>> 178deg.
>
>I don't understand what you mean here.
>
>> (I've only just discovered the use of these newsgroups and had been
>> e-mailing your colleague Chris Huff concerning my simulation of
>diffraction
>> gratings in scattering 'media'  and the built-in models for coloured light
>> and chromatic variation of refractive index... do you have those
>'formulae'
>> ?)
>
>Again, I'm not sure what you are looking for here.  You would be better to
>post your questions in a different group as this one isn't really
>appropriate for these types of questions, it is for posting of text
>scene-files as the name implies.  I'm not sure what kind of traffic it gets
>from the community.  Better to try povray.advanced-users or povray.general.
>
>> I would like to  simulate distortion in real camera lenses such as zooming
>> lenses with multiple elements.   I've developed a fairly convenient method
>> of taking the lens prescription from my preferred lens design program (
>> OSLO Pro) and placing it in front of the POV camera to model stray-light
>> etc but it's very time-consuming.  Not a lot I can do about that... but
>> it's quite straightforward to derive polynomials to define the lens
>> distortion ( ratio of the tangents of the true/apparent angles)  as a
>> function of zoom setting and field angle.   I imagined putting a
>> rotationally symmetric aspherical plate in front of the POV camera which
>> would deviate the sightline ray direction to simulate the distortion. Or
>is
>> it possible to do this with the texture in the camera statement?
>>
>> Yours,
>>
>> Don Barron
>>
>>
>
>You're getting a bit beyond me here.
>I can tell you that you can use a 'normal' pattern in the camera statement
>to cause distortions, but I have never really tried it myself so I don't
>know how to work it.
>
>For inromation about lens simulations, have a look at this link:
>http://citeseer.nj.nec.com/127209.html
>
>-tgq
> Thanks for those clues and links - and hints

Don Barron


Post a reply to this message

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