POV-Ray : Newsgroups : povray.text.scene-files : test blob media for potential pattern Server Time
15 Oct 2024 03:21:39 EDT (-0400)
  test blob media for potential pattern (Message 1 to 2 of 2)  
From: omniverse
Subject: test blob media for potential pattern
Date: 13 Oct 2016 16:40:01
Message: <web.57fff0f3d36b3cadb1933f770@news.povray.org>
/* testing 'potential' pattern for blob object
   reason for patch was for 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

From: omniverse
Subject: Re: test blob media for potential pattern
Date: 14 Oct 2016 02:30:01
Message: <web.58007af9302fb87eb1933f770@news.povray.org>
sorry, there's another thing I noticed looking at the scene file I have and had
put here.
sturm keyword was left by itself in the first blob statement. Sturm was intended
to also have the #if directive line same as those for the pigment and density
statements.
Please be aware sturm needs to be left out for a cleaner render, otherwise you
will see bad artifacts.

On another note, I am trying a pre-declared instance of the blob statement and
using it as:

object
{
 Blob
}

to replace each full statement. You can easily do the same by cutting and
pasting the first blob {...} portion and #declare Blob= blob {...}

This will work like before, no problem here with:

potential {object{Blob}}


Post a reply to this message

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