POV-Ray : Newsgroups : povray.newusers : Area_light and Rendering Dark Regions after Animation Server Time
23 Nov 2024 07:12:22 EST (-0500)
  Area_light and Rendering Dark Regions after Animation (Message 1 to 5 of 5)  
From: bubble person
Subject: Area_light and Rendering Dark Regions after Animation
Date: 3 Dec 2021 07:40:00
Message: <web.61aa0fea2851ea9a16bfacdf7c94cc22@news.povray.org>
Hello Forum,

I recently posted about about trying to simulate bubbles in a tube and received
a lot of great feedback on my scripting approach!  I've made changes to my
previous setup to clean it up, but have two outstanding questions/issues.  The
first is on the area_light function, and the second is an issue that I am having
when rendering my new script.


1) Area_light:

In my last discussion, I received some great feedback on the area_light
function, but I am still having some issues with it in concept.  In my script, I
want to create a diffuse backlight for my scene.  I am trying to recreate the
effect of having a bright light shining through transparent objects directly
into my camera.  to do this, I am beginning by defining an area_light with the
following characteristics:

     - parallel to the X-Y-plane
     - centred on the Z-axis
     - with dimensions 160x200 (x,y)
     - I then want the center translated to position <0,0,100>
     - 100 x 100 lights array
     - white light

     Firstly, can somebody confirm that I have defined this correctly, below?

     light_source {
         <0, 0,100>
         color White
         area_light <-80, -100, 0>, <80, 100, 0>, 100, 100
         adaptive 1
         jitter
       }

Next, if I understand this correctly, I would not actually see my light source
shining like I would in real life, and instead need to create an object onto
which I put the area source if I want that realistic studio light panel look.
To do this, I have used the looks_like function, defining a white rectangular
box that will act as my light panel.  Can somebody confirm that this has been
implemented correctly?


     #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 <-80, -100, 0>, <80, 100, 0>, 100, 100
         adaptive 1
         jitter
         looks_like { light_box }
       }

     Is what I'm trying to do make sense to create this diffuse, bright,
backlighting effect?
     If my area_light dimensions do not match the dimensions my defined
looks_like{} object, will the area light stretch to accommodate the defined
object?



2). Rendering Issue and the appearance of dark regions after animation
rendering:

My next question pertains to a rendering issue I have run into.  I reformatted
my previous script with the generous input of forum users.  Here I have defined
each region of my setup in a more efficient manner that I was perviously.  In my
attached file, I am simulating air bubbles trapped in a gel housed within a
glass tube.  Outside of this tube is a cylinder of water and then a cylinder of
plexiglass.

When I first rendered my setup, everything was looking good, and so I decided to
run it as an animation, rotating the bubbles around Y axis.  However, when I ran
the animation, the boundary between the glass and water appeared to be speckled,
which immediately made me think of an overlapping surface issue.  I addressed it
by adding an "epsilon" to the radius of my water cylinder's inner surface and
ran it again.  While the speckled surface issue was resolved, a large portion of
my cylinder is being rendered as a dark region, and this region will not go away
no matter what I do, and I cannot recreate the original bright region.  I also
tried turning off the fade and this did not help.

Can anyone help me troubleshoot this issue?

Thank you all for your support and insights!

Sincerely,

Bubble_person


* I have attached my code here, below, because I cannot figure out how to add a
photo and my script.  Sorry for the long post!

//Files with predefined colors and textures
#include "colors.inc"
#include "glass.inc"
#include "stones.inc"

 global_settings { max_trace_level 50}

#declare epsilon         = .0001;

#declare light_loc_x   = 0;
#declare light_loc_y   = 0;
#declare light_loc_z   = 90;

#declare tube_base    =  -55;
#declare tube_height  = 92;
#declare tube_rinner  = 13;
#declare tube_router  = 16;
#declare tube_lip_width = 2;

#declare tube_rotation_x = 0;
#declare tube_rotation_y =  2*clock;
#declare tube_rotation_z = 0;

#declare water_router     = 25.4;
#declare plexi_router      = 31.75;

#declare gel_height         = 0.9*tube_height;

#declare bubble_r            = 0.8;
#declare bubble_ior         = 1.0;

//Place the camera
camera {
  location  <000,000,-500>    //Camera location
  look_at   <0,0,1>     //Where camera is pointing
  angle 15       //Angle of the view--increase to see more, decrease to see less
}

//Ambient light to "brighten up" darker pictures
global_settings { ambient_light White }

//Set a background color
background { color Black }


// Set up light source from box

#declare light_box = box{ <-80,-100,0>, <80,100,2>
        pigment{color White}
       } //end light box


light_source {
    <light_loc_x, light_loc_y,light_loc_z>
    color White
    area_light <-80, -100, 0>, <80, 100, 0>, 100, 100
    adaptive 1
    jitter
    looks_like { light_box }
  }

//=====================================================================================
// Creating bubbles that go into gel
//=====================================================================================


// Create Bubbles

#declare MatBubble =
material {
  texture {
    pigment {color rgbt<.99,.99,.99,0.98>}
    normal { bumps 0 scale 0.025 }
    finish { phong .001 }
  } // end of texture
  interior{
    ior           bubble_ior
    dispersion         1.01 // this simulates dispersion caused refraction
    dispersion_samples  7
    fade_power         1001     //(0=off)  (realistic: 1~2, >=1000 ->realistic
exponential attenuation function will be used!)
  } // end of interior
} // end of material


// Add Bubble Definitions Here:
#declare Bubble_5 =sphere{ <3.94,-7.554,-4.927>, (bubble_r)
       material{MatBubble}
   }  //end sphere (bubble)
#declare Bubble_4 =sphere{ <-1.53,35.605,-2.926>, (bubble_r)
       material{MatBubble}
   }  //end sphere (bubble)
#declare Bubble_3 =sphere{ <-1.271,40.873,2.981>, (bubble_r)
       material{MatBubble}
   }  //end sphere (bubble)
#declare Bubble_2 =sphere{ <2.972,-36.206,-1.126>, (bubble_r)
       material{MatBubble}
   }  //end sphere (bubble)
#declare Bubble_1 =sphere{ <8.863,-12.984,3.351>, (bubble_r)
       material{MatBubble}
   }  //end sphere (bubble)



union {

// Add Union here
  object {Bubble_5}
  object {Bubble_4}
  object {Bubble_3}
  object {Bubble_2}
  object {Bubble_1}

  rotate <tube_rotation_x,tube_rotation_y,tube_rotation_z>
}


//=====================================================================================
//Creating Glass Tube
//=====================================================================================


//create hollow cylinder

#declare GlassTube =
merge{
 difference{
  //Create single cylinder
  cylinder { <0,(tube_base-epsilon),0>, <0,tube_height,0>,   tube_router
     } // end cylinder

  cylinder { <0,(tube_base-2*epsilon),0>, <0,tube_height+epsilon,0>,
tube_rinner
     } // end cylinder
   }  // End difference (hollow cylinder)

  //create hollow half-sphere
  difference{
   difference{
    //Create single cylinder
    sphere { <0,0,0>,   tube_router } // end sphere
    sphere { <0,0,0>,   tube_rinner} // end sphere
     } // End difference (Hollow Sphere)
   box{ <-2* tube_router ,0,-2* tube_router >,
      < 2*tube_router , 2*tube_router ,2* tube_router >
     } // End Box

    translate<0,tube_base,0>
     }   // End Difference (Half-Sphere)

 // create Lip torus at top of tube
 torus {  (tube_router+ tube_rinner)/2, tube_lip_width
  translate <0,tube_height,0>
 } // End Torus (Tube Lip)


      material{
            texture {  pigment{ color rgbt<.99,.99,.99,0.99>}
                       normal { bumps 0 scale 0.025 }
                       finish { phong .99 }
                     } // end of texture
            interior{  ior        1.56
               dispersion                1.0 // this simulates dispersion caused
refraction
               dispersion_samples   7
               fade_power           1001     //(0=off)  (realistic: 1~2, >=1000
->realistic exponential attenuation function will be used!
                       caustics 0.0
                    } // end of interior
            } // end of material

 rotate<tube_rotation_x,tube_rotation_y,tube_rotation_z>

  } // End Merge (Full tube)

GlassTube

//=====================================================================================
// Creating Gel  to fill Glass Tube with voids for the bubbles
//=====================================================================================
// Creating gel to fill glass

#declare GelCyl =
 merge{
  sphere { <0,tube_base,0>,   tube_rinner-epsilon} // end sphere
  cylinder{<0,tube_base,0>, <0,gel_height,0>,   tube_rinner-epsilon}// end
cylinder
       material{
             texture {  pigment{ color rgbt<.99,.99,.99,0.98>}
                        normal { bumps 0 scale 0.025 }
                        finish { phong .001 }
                      } // end of texture
             interior{  ior        1.405
                dispersion                1.0 // this simulates dispersion
caused refraction
                dispersion_samples   7
                fade_power           1001     //(0=off)  (realistic: 1~2, >=1000
->realistic exponential attenuation function will be used!
                        caustics 0.0
                     } // end of interior
             } // end of material


  } // end merge (gel matrix)

GelCyl

//=====================================================================================
// Creating Water Cylinder around tube
//=====================================================================================

#declare WaterCyl =
difference{
 cylinder{
  <0,tube_base-tube_router,0>,<0,tube_height*.8,0>, water_router} //End outer
cylinder
 merge{
  cylinder{<0,tube_base,0>, <0,tube_height+epsilon,0>, tube_router-epsilon} //
end cylinder for glass tube

  sphere{<0,tube_base,0>, tube_router-epsilon} // end sphere (tube bottom)
  } //end merge (glass tube inside of water


    material{
             texture {  pigment{ color rgbt<.99,.99,.99,0.98>}
                        normal { bumps 0 scale 0.025 }
                        finish { phong .001 }
                      } // end of texture
             interior{  ior        1.33
                dispersion                1.0 // this simulates dispersion
caused refraction
                dispersion_samples   7
                fade_power           1001     //(0=off)  (realistic: 1~2, >=1000
->realistic exponential attenuation function will be used!
                        caustics 0.0
                     } // end of interior
             } // end of material
} // End difference of outer water tube

WaterCyl


//=====================================================================================
//Creating Plexiglass Cylinder holding water
//=====================================================================================
#declare PlexCyl =
difference{
 cylinder{<0,tube_base-tube_router,0>,<0,tube_height*.9,0>, plexi_router} //End
outer cylinder
 cylinder{<0,tube_base-tube_router-epsilon,0>,<0,tube_height*.9+epsilon,0>,
water_router+epsilon} //End outer cylinder

    material{
             texture {  pigment{ color rgbt<.99,.99,.99,0.98>}
                        normal { bumps 0 scale 0.025 }
                        finish { phong .001 }
                      } // end of texture
             interior{  ior        1.495
                dispersion                1.0 // this simulates dispersion
caused refraction
                dispersion_samples   7
                fade_power           1001     //(0=off)  (realistic: 1~2, >=1000
->realistic exponential attenuation function will be used!
                        caustics 0.0
                     } // end of interior
             } // end of material

} // End difference of outer water tube


PlexCyl


Post a reply to this message


Attachments:
Download 'screenshot 2021-12-03 at 13.33.01.png' (338 KB)

Preview of image 'screenshot 2021-12-03 at 13.33.01.png'
screenshot 2021-12-03 at 13.33.01.png


 

From: bubble person
Subject: Re: Area_light and Rendering Dark Regions after Animation
Date: 3 Dec 2021 07:55:00
Message: <web.61aa13671a80054d16bfacdf7c94cc22@news.povray.org>
"bubble_person" <nomail@nomail> wrote:
> Hello Forum,
>
> I recently posted about about trying to simulate bubbles in a tube and received
> a lot of great feedback on my scripting approach!  I've made changes to my
> previous setup to clean it up, but have two outstanding questions/issues.  The
> first is on the area_light function, and the second is an issue that I am having
> when rendering my new script.
>...

Hello Forum,

I missed the reply from Alain in my previous post which gave a stellar
description of the area_light definition, and he has made it super clear to me.
Thanks Alain!

I am of course interested in how people would approach making a diffuse
backlight, and if my approach of using the looks_like{} function seems
appropriate.  Thanks again, everyone, for your support and help!

Sincerely,

Bubble_person


Post a reply to this message

From: bubble person
Subject: Re: Area_light and Rendering Dark Regions after Animation
Date: 3 Dec 2021 08:05:00
Message: <web.61aa15a21a80054d16bfacdf7c94cc22@news.povray.org>
"bubble_person" <nomail@nomail> wrote:
> Hello Forum,
>
> I recently posted about about trying to simulate bubbles in a tube and received
> a lot of great feedback on my scripting approach!  I've made changes to my
> previous setup to clean it up, but have two outstanding questions/issues.  The
> first is on the area_light function, and the second is an issue that I am having
> when rendering my new script.
> ...


Hello Forum,

It must be a Friday because the script I included has the definition:

tube_router-epsilon

instead of

tube_router+epsilon

I changed my script out of frustration to try to recreate my previous effects.
The issue I am experiencing happens when I have correctly defined the water's
inner surface as:

tube_router+epsilon


Sorry for the confusion on my part.

Sincerely,

Bubble_person


Post a reply to this message

From: Thomas de Groot
Subject: Re: Area_light and Rendering Dark Regions after Animation
Date: 3 Dec 2021 08:33:25
Message: <61aa1ca5$1@news.povray.org>
Op 3-12-2021 om 14:03 schreef bubble_person:
> 
> It must be a Friday because... 
> 

LOL, typically something that happens to all of us repeatedly. Welcome 
to the club! :-)

-- 
Thomas


Post a reply to this message

From: Alain Martel
Subject: Re: Area_light and Rendering Dark Regions after Animation
Date: 3 Dec 2021 11:32:46
Message: <61aa46ae$1@news.povray.org>
Le 2021-12-03 à 07:39, bubble_person a écrit :
> Hello Forum,
> 
> I recently posted about about trying to simulate bubbles in a tube and received
> a lot of great feedback on my scripting approach!  I've made changes to my
> previous setup to clean it up, but have two outstanding questions/issues.  The
> first is on the area_light function, and the second is an issue that I am having
> when rendering my new script.
> 
> 
> 1) Area_light:
> 
> In my last discussion, I received some great feedback on the area_light
> function, but I am still having some issues with it in concept.  In my script, I
> want to create a diffuse backlight for my scene.  I am trying to recreate the
> effect of having a bright light shining through transparent objects directly
> into my camera.  to do this, I am beginning by defining an area_light with the
> following characteristics:
> 

For that effect, you'd be better using the back lighting feature. It's a 
finish element. It use the definition for the diffuse component, but 
using TWO values. The first is the front diffuse value, and the second 
control the amount of light diffusely transmitted.
It works like this :
finish{ diffuse 0.1, 0.7 }

For what you want, the best way would be to have a polygon some distance 
in front of the light.

Another way using a box is to use the interior texture to give the 
inside of the box a totally transparent pigment.
box{Corner1, Corner2 texture{ Whatever_Texture_You_Want}
		interior_texture{ pigment { rgbt 1 }}
}

If you are using radiosity, then, the interior_texture is not needed, 
but you need to increase the recursion_limit by +1 over the value that 
you would otherwise use.

> PlexCyl
>


Post a reply to this message

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