POV-Ray : Newsgroups : povray.newusers : Dark Regions and Reflections Removal : Dark Regions and Reflections Removal Server Time
25 Apr 2024 16:35:47 EDT (-0400)
  Dark Regions and Reflections Removal  
From: bubble person
Date: 9 Dec 2021 07:30:00
Message: <web.61b1f62243650b178f16f7e87c94cc22@news.povray.org>
Hello Forum,

I have been beating my head against an issue in the rendering of scene.   I have
bubbles entrained in a gel, encased in a glass tube.  This is then surrounded by
water, and another clear cylinder containing the water.  I have an area light
backlighting this setup and a camera looking directly through the setup into my
backlight.

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.

I have tried repositioning my light, resizing my light, playing with the epsilon
between the water and glass definition, increasing the max_trace_level, and with
the material characteristics of the glass.  In all cases, there seems to be a
new dark region that obscures the outer edges of my gel region.  I think this

of the glass closest to the camera, as the dark region obscures bubbles within
the gel region.


included my code below as I can only attach a single file.

Can anyone help me troubleshoot this issue?

Thank you all for your support and insights!

Sincerely,

Bubble_person


====================
Script Below
====================

//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   = 100;

#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 160*x, 200*y 20, 20
    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.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!
                        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.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!
                        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.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!
                        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


 

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