POV-Ray : Newsgroups : povray.binaries.scene-files : test blob media for potential pattern Server Time
21 Nov 2024 08:45:16 EST (-0500)
  test blob media for potential pattern (Message 1 to 1 of 1)  
From: omniverse
Subject: test blob media for potential pattern
Date: 13 Oct 2016 16:35:00
Message: <web.57ffef4dd36b3cadb1933f770@news.povray.org>
/* testing 'potential' pattern for blob object
 reason for patch was to attempt using reflection blur
 didn't realize potential pattern was not part of unofficial (yet?) */

// cmd: +w320 +h240 +a +ki0 +kf1 +kfi1 +kff50 +sf14 +ef14

#version 3.71;

//#version unofficial patch 3.71;
//#patch "upov-reflection-roughness" 0.9;

global_settings
{
 assumed_gamma on
 max_trace_level 9
}

#declare Blur=no; // camera focus/defocus

#declare CutOut=no; // cut away part of blob with box

#declare Sturm=on;

/*
background
{
 rgb 0
}
*/

sky_sphere
{
 pigment
 {
  function
  {
   abs(y)
  }
  color_map
  {
   [0 rgb <0.9,0.4,0.1>/2]
   [0.3 rgb <0.3,0.5,1>/2]
   [0.9 rgb <0.2,0.4,0.9>/2]
  }
  //turbulence 0.8
 }
}

light_source
{
 -99*z, 1
 media_interaction on
 media_attenuation off
 rotate <60,-30,0>
}

camera
{
 location -9*z
 look_at <0.75,0.5,0>
 angle 50
 #if (Blur=yes)
 focal_point 0
 aperture 0.6
 blur_samples 30,60
 variance 0.005
 #end
 rotate <22.5,22.5,0>
}

// floor
box
{
 <-9,-4,-9>,<9,-3,9>
 pigment
 {
  checker rgb 1 rgb 0
 }
}

// reflective ball
sphere
{
 0,3
 scale <1,1,0.25>
 rotate <0,60,0>
 translate <4,0,1>
 material
 {
  texture
  {
   pigment
   {
    rgb 0.4
   }
   finish
   {
    diffuse 0.1
    reflection
    {
     0.2,0.8
     //roughness 0.05
    }
   }
  }
 }
}

// blob with media
#if (CutOut=yes)
difference
{
 #end
blob
{
 sphere
 {
  <-1,-1,0>,1,2
 }
 sphere
 {
  <-1,1,0>,1,2
 }
 sphere
 {
  <1,1,0>,1,2
 }
 sphere
 {
  <1,-1,0>,1,2
 }
 sphere
 {
  0,1.5,1
 }
 cylinder
 {
  -x*(1+sin(clock*2*pi)),x*(1+sin(clock*2*pi)),0.75,2
 }
 cylinder
 {
  -y*(1+sin(clock*2*pi)),y*(1+sin(clock*2*pi)),0.75,2
 }
 cylinder
 {
  -z*(1+sin(clock*2*pi)),z*(1+sin(clock*2*pi)),0.75,2
 }
 sturm

#if (CutOut=yes)
}

box
{
 <-1.75,-1.75,-1.5>,<1.75,1.75,0>
}
#end

material
{
 texture
 {
  pigment
  {
   potential
   {
    blob
    {
     sphere
     {
      <-1,-1,0>,1,2
     }
     sphere
     {
      <-1,1,0>,1,2
     }
     sphere
     {
      <1,1,0>,1,2
     }
     sphere
     {
      <1,-1,0>,1,2
     }
     sphere // center
     {
      0,1.5,1
     }
 cylinder
 {
  -x*(1+sin(clock*2*pi)),x*(1+sin(clock*2*pi)),0.75,2
 }
 cylinder
 {
  -y*(1+sin(clock*2*pi)),y*(1+sin(clock*2*pi)),0.75,2
 }
 cylinder
 {
  -z*(1+sin(clock*2*pi)),z*(1+sin(clock*2*pi)),0.75,2
 }
 #if (Sturm=on) sturm #end
    } // blob
   } // potential
   threshold on
   color_map
   {
    [0 red 1 transmit 0.99] [0.5 green 1 transmit 0.99] [1 blue 1 transmit 0.99]
   }
  } // pigment
 } // texture
 interior
 {
  media
  {
   method 3
   samples 33
   jitter 0.9
   emission 0.4
   absorption 0.1
   scattering
   {
    1, 0.6
   }
  density
  {
   potential
   {
    blob
    {
     sphere
     {
      <-1,-1,0>,1,2
     }
     sphere
     {
      <-1,1,0>,1,2
     }
     sphere
     {
      <1,1,0>,1,2
     }
     sphere
     {
      <1,-1,0>,1,2
     }
     sphere
     {
      0,1.5,1
     }
 cylinder
 {
  -x*(1+sin(clock*2*pi)),x*(1+sin(clock*2*pi)),0.75,2
 }
 cylinder
 {
  -y*(1+sin(clock*2*pi)),y*(1+sin(clock*2*pi)),0.75,2
 }
 cylinder
 {
  -z*(1+sin(clock*2*pi)),z*(1+sin(clock*2*pi)),0.75,2
 }
 #if (Sturm=on) sturm #end
    } // blob
   } // potential
   threshold on
   density_map
   {
    [0 red 1] [0.5 green 1] [1 blue 1]
   }

  } // density
  } // media
 } // interior
} // material
rotate <0,clock*360,0>
hollow on
} // difference or blob


Post a reply to this message

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