POV-Ray : Newsgroups : povray.binaries.images : Seraglio (WIP) : Re: Seraglio (WIP) Server Time
5 Jul 2024 14:49:44 EDT (-0400)
  Re: Seraglio (WIP)  
From: And
Date: 3 Sep 2015 05:35:06
Message: <web.55e81349f1eaec47f1376bd90@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 02.09.2015 um 20:59 schrieb Cousin Ricky:
> > On 2015-09-02 09:49 AM (-4), clipka wrote:
> >> I would recommend using a non-zero fade_distance, set to be equal to the
> >> corresponding object's radius. That more closely mimicks the
> >> characteristics of a non-point light source.
> >
> > Is this true even for area_illumination with circular orient?
>
> Hum - that's a good question I've never thought about. But by extension
> of what I said, if you model a single non-point light source as an array
> of smaller light sources, then those smaller light sources'
> fade_distance should be set equal to their radius, so for a highly
> subdivided area_illumination light source the fade_distance should
> indeed probably be close to zero.


That's true. If you would like to simulation an area/surface light, every
element light source of it should obey the inverse square law. So it should set
the fade_distance 0 when the area light resolution is enough.

I've researched this and I would like to share it. In fact, I even know the
formula between the light source color and the emission surface color. If you
have any lambertian emission surface that emit light and you do not want to use
the radiosity, you can put the corresponding light sources to simulate it(just
like the area light). The formula between them is:
(emission_surface_color) = (light_source_color) * pi * resolution /
(surface_area)

Notice that it must set spotlight and correct radius, falloff, and tightness in
the lightsource.

You can implement it like this:


//---------------the code start---------------------

#declare disc_radius = 1;
#declare disc_color = rgb<1,1,1>;
#declare resolution = 100;
#declare emission_area = pi*disc_radius*disc_radius;


#declare looks_like_obj =
disc{
<0,0,0>, z, disc_radius,
    texture{
        pigment{color disc_color}
        finish{ambient 0 diffuse 0 emission 1}
    }
    interior_texture{
        pigment{color rgb<0,0,0>}
        finish{ambient 0 diffuse 0 emission 0}
    }
no_shadow
no_radiosity
}




#declare light_seed = seed(13);
#declare light_source_obj =
union{
    #for(i, 0, resolution-1)
        #declare this_r = sqrt(1/2+i)/sqrt(resolution);
        #declare this_theta = rand(light_seed)*2*pi;
        #declare this_point = <this_r*cos(this_theta), this_r*sin(this_theta),
0>* disc_radius;
        light_source{
        <0,0,0>
        color disc_color*emission_area/resolution/pi
        spotlight
        radius 90
        falloff 90
        tightness 1
        point_at z
        fade_power 2
        fade_distance 0
        }
    #end
}




union{
    object{light_source_obj}
    object{looks_like_obj}
}


Post a reply to this message

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