POV-Ray : Newsgroups : povray.general : attenuation in object interior : Re: attenuation in object interior Server Time
1 Aug 2024 16:29:45 EDT (-0400)
  Re: attenuation in object interior  
From: Reynald
Date: 8 Aug 2005 05:45:01
Message: <web.42f7284229ee637bf5f6f3660@news.povray.org>
OUPS!... crotte de biche!
I'm so confused, I mixed up two different cases...
For the case explained in the first post (a light source, a fading interior
and a screen) the situation is exactely opposite as described, i.e. light
is attenuated only when placed OUTSIDE of the transparent fading container
(no refraction, neither reflection, no radiosity in this case). See below a
piece of code to check it.

The second case I planed to talk about is when using a mirror (just switch
to "material {gold}" in the "Mirror" section). The strange
thing  (to me!) is now the source has to be placed INSIDE the container for
reflection to occure! ... and as seen above in that case attenuation is not
effective...

I would like to have both... reflection and attenuation?




/////////////////////////////////////////////////////////////////////////
//
//                          REYNALD PASSERINI
//                              28.07.05

//
////////////////////////////////////////////////////////////////////////


#include "colors.inc"


global_settings {
  max_trace_level 100
  photons {
    count 200000
    //autostop 0
    jitter .4
    media 100, 2
    }
  }


///////////////////////////////////////////////////////////////////////////

#declare source = sphere {
  <0,0,0> 0.1
  pigment { color Yellow }
  finish {ambient .8 diffuse .6}
  }


#declare visible =  material {
  texture {
    pigment { color NeonBlue }
    finish {ambient 0.3}
    }

  }


#declare gold = material{
  texture {
    pigment { color Gold }
    finish {
      ambient 0.1
      diffuse 0.001
      reflection 0.9
    //  specular 1
      roughness .001
      conserve_energy
      }
    }
  }

////////////////////////////////////////////////////////////////////

/*
media {
  scattering {
    1 ,  rgb 10*<0.1, 0.1, 0.1>                   // isotropic scattering
    extinction 0.001
    }
  }
*/


////////////////////////////////////////////////////////////////////
//                                                                //
//                          CAMERA - SOURCE                       //
//                                                                //





/*

  location  <px-10,0,0>
  look_at <px,0,0>
  angle 60
  }
*/



  location  <10,5,-20>
  look_at <0,0,0>
  angle 40
  }



light_source { <0,-10, 0>                    // Source
  color 1*<1,1,1>
  cylinder
  //spotlight
  looks_like {source}
  radius 0.5
  falloff 0.5              // Ouverture (a) de la fibre CIR
  tightness 0
  point_at <0,1,0>
  //fade_distance 50
  //fade_power 2
  media_attenuation on
  photons {
    refraction on
    reflection on
    }
  }



light_source { <-500,500,-500> Gray50
  media_interaction off
  media_attenuation off
  photons { reflection off refraction off }
  }



disc { <px,0,0>, <1,0,0>, 5                // Ecran
  rotate <0,0,0>
  pigment {checker White Aquamarine}
  }


plane {
  y, -100
  pigment {checker White Wheat scale 100 }     // plan de base
  }


//                                                                //
//                                                                //
////////////////////////////////////////////////////////////////////




// Mirror //////////////////////////////////////////////////////////

box {<-1,-10,-10> <0,10,10>
 material {visible}                         // blue screen
   //material {gold}                        // mirror
  rotate <0,0,-45>
  photons {
       target
       reflection on
       refraction on
       collect off
       }
  }





// interior fading and media ////////////////////////////////////////////

#declare transparent_avec_media =  material{
    texture {pigment { White filter 1 }}
    interior{
      fade_distance 5
      fade_power 2
      media {
        scattering {
          1 ,  rgb 5*<0.1, 0.1, 0.1>                   // isotropic
scattering
          extinction 0.01
          }
        }
      }
    }


box {
  <-10,-12,-10> <100,10,10>                  // including the light source
  //<-10,-9,-10> <100,10,10>                  // light outside of this box
  material {transparent_avec_media}
  hollow
  }


Post a reply to this message

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