POV-Ray : Newsgroups : povray.general : lights and tiles : Re: lights and tiles Server Time
6 Aug 2024 06:22:25 EDT (-0400)
  Re: lights and tiles  
From: Valdemir Carrara
Date: 3 May 2002 09:14:16
Message: <3CD28D88.C1B15345@dem.inpe.br>
Slime wrote:
> 
> I'm not sure this is 100% true. Because if it were, that would mean that as
> you approached the light source, the light intensity would approach
> infinity. So if you put your eye an inch or so away from a candle, it would
> probably be like looking directly at the sun and you'd go blind. So this
> can't really be 100% true.
> 
> The equation 1/(1+d^2), after about two or three units from the origin, is
> extremely similar to 1/d^2. (graph the two functions in a program and you'll
> see why.) The only difference is that near the origin, 1/(1+d^2) has the
> value of one (not infinity). I think this is a lot closer to the real life
> model, and it still has the property that light intensity is *almost*
> proportional to the inverse of the distance squared.
> 

This is 100% true! It's a physical phenomenon and not a mere
guess.
If you come very close of a bulbe light you go blind!

I agree with the similarity of both functions. I had already
drew 
the curves. They are "almost" equal for large distances but
they 
are very different at small distances. But that means that
the light 
intensity depends on the scale you use in the scene! That's
nonsense.
The only way one have to compensate the scale influence is
to choose
a fade_distance equals to infinitesimal value (a very small
value)
and to increase the light intensity by a factor of
1/fade_distance^2:

#declare eps = 0.0001
light_source {  <12., 10., 40.>
  color rgb <1.000, 1.000, 1.000>/eps/eps
  fade_distance eps fade_power 2
}

> As for the checker pattern you were talking about, you may be interested in
> this function that I came up with recently for my "traditional raytracing
> desktop" image:
> 
> #declare smoothcheckerbasis = function (x,y,z,allfloors,xv,yv,zv) {
>  select(allfloors-floor(allfloors/2)*2,
>   0,
>   max(xv-.5,yv-.5,zv-.5, .5-xv,.5-yv,.5-zv),
>   min(xv+.5,yv+.5,zv+.5, 1.5-xv,1.5-yv,1.5-zv)
>  )
> }
> #declare smoothchecker = function (x,y,z) {
> 
> smoothcheckerbasis(x,y,z,floor(x)+floor(y)+floor(z),x-floor(x),y-floor(y),z-
> floor(z))
> }
> 
> functions only work with POV-Ray 3.5 (which is still in beta), but if you're
> using that, this should help you. It's best used as:
> 
> pigment {
>     function{smoothchecker(x,y+.5,z)}
>     // a color map similar to this will be most effective:
>     color_map {
>         [.4 rgb 0]
>         [.6 rgb 1]
>     }
> }
> 
> I use "y+.5" instead of just "y" since the function is only interesting
> halfway through a unit. It has a solid value of .5 at all integer values.
> 
> - Slime
> [ http://www.slimeland.com/ ]
> [ http://www.slimeland.com/images/ ]

Thank you. I'll check it!

Val


Post a reply to this message


Attachments:
Download 'us-ascii' (1 KB)

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