POV-Ray : Newsgroups : povray.newusers : Transparent Objects Become Black : Re: Transparent Objects Become Black Server Time
20 Apr 2024 12:25:07 EDT (-0400)
  Re: Transparent Objects Become Black  
From: Alain Martel
Date: 1 Dec 2021 11:34:06
Message: <61a7a3fe$1@news.povray.org>
Le 2021-12-01 à 08:58, bubble_person a écrit :

> light_source {
>      <0, 0,100>
>      color White
>      area_light <160, 0, 0>, <, 200, 0>, 100, 100
>      adaptive 1
>      jitter
>    }
> 
> When I do this, however, the background is all black, as I believe this only
> produces rays from the defined area_light, but doesn't really simulate the
> appearance of looking into a bright backlight.  To mimic realistic backlighting,
> I can then use the command looks_like{ light_box } where I predefine a white
> rectangle called "light_box."  My code then looks like this:
> 
> #declare light_box = box{ <-80,-100,0>, <80,100,2>
>          pigment{color White}
>         } //end light box
> 
> light_source {
>      <0, 0,100>
>      color White
>      area_light <-10, -10, 0>, <10, 10, 0>, 100, 100// Not correct !
>      adaptive 1
>      jitter
>      looks_like { light_box }
>    }
> 
> Doing this, I have defined an area_light parallel to the XY, stretched it over
> my box dimensions, and translated that box/area_light +100 units in the
> Z-direction.
> 
> Is this correct?
Not quite...
> 
> Sincerely,
> 
> bubble_person
> 

First point : It is important to remember that light sources are never 
directly visible by the camera. They are ONLY places from where light 
emanate to illuminate the scene, they are not actual objects.

In your example, one side of the area_light is parallel to a line going 
from the origin to a point at <-10, -10, 0>, and the other side is 
parallel to a line going from the origin to <10, 10, 0>.
Those two lines are co-linear. This will cause soft shadows in only one 
direction. That direction is a diagonal.

There is an obvious, for me, confusion about what is defined where.

When defining a box, you use the two opposite corners. You effectively say :
Here is a box with faces parallel to the orthogonal planes, and it's 
opposite corners are at those locations.

When defining an area_light, you define the DIRECTION and length of each 
sides, NOT the location of the corners of the parallelogram covering the 
area_light. Here, you are effectively saying :
Here is a parallelogram centred at the light's location with one side 
oriented this way and this long, and the other side oriented that way 
and that long.

Normally, you want those to be orthogonal. In your case, they need to 
align to the X and Y axis. That mean that only one coordinate have to be 
non-zero and the other two have to be zero. The sign is not important, 
only the absolute value of the length.

area_light 160*x, 200*y, 100, 100
area_light -160*x, 200*y, 100, 100
area_light 160*x, -200*y, 100, 100
and
area_light -160*x, -200*y, 100, 100
all define exactly the same area_light.

As you want the light to be parallel to the X-Y plane, it should be 
defined as :
#declare light_box = box{ <-80,-100,0>, <80,100,2>
         pigment{color White}
   finish{emission 1}
        } //end light box

light_source {
     <0, 0,100>
     color White
     area_light 160*x, 200*y, 65, 65
     adaptive 0 // May be enough
     jitter
     looks_like { light_box }
   }

The smaller size is more than adequate. Because it use the adaptive 
mechanism, the performance is nearly identical.
Just using adaptive 0 will enable the adaptive sampling. The value is 
not an on/off switch, but determine the minimum number of elements to 
start with.

adaptive 0 start with just the four corners, a 2x2 array. (2^0 +1)
adaptive 1 start with a 3x3 array. (2^1 +1)
adaptive 2 start with a 5x5 array. (2^2 +1)
adaptive 3 start with a 9x9 array. (2^3 +1)
.
.
.

That progression is also why your 100 by 100 array get increased to 129 
by 129, or 2^7 + 1.


Post a reply to this message

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