POV-Ray : Newsgroups : povray.general : Is media only sampled on an object's surface? : Re: Is media only sampled on an object's surface? Server Time
4 Nov 2024 13:02:11 EST (-0500)
  Re: Is media only sampled on an object's surface?  
From: Alain
Date: 9 Dec 2008 17:07:19
Message: <493eec17$1@news.povray.org>
Andy nous illumina en ce 2008-12-07 02:03 -->
> Hi all,
> 
> In some renderings of a cube with interior media I just did it seems like the
> media is only being sampled on the surface, even though the help file says
> media get sampled in intervals throughout an object.  I tried changing the
> number of intervals to 10 in case the default is erroneously 1, and while it
> took longer to render I got the same result.
> 
> I'm using POV-Ray version 3.7 beta 28.
> 
> Here's my scene, it's basically a box that emits with a spherical wave pattern I
> defined myself:
> 
> ------------------------------------------------------
> 

  #include "colors.inc"
  #include "math.inc"

  #declare Wave = function(ox, oy, oz, px, py, pz, amp, wl, sp, time) { amp *
  cos(2 * pi / wl * sqrt(pow(px - ox, 2) + pow(py - oy, 2) + pow(pz - oz, 2)) -
  time * sp / wl * 2 * pi) };

  #declare TIME = clock;
#declare Sphere = 0;

#if(Sphere)
sphere {  10, 10
#else
box{<0.0001,-10,-10>,<20,10,10>
#end
   hollow

   material {
     texture {
       pigment { rgb 0.15 transmit 1 }
     }
/*
     interior_texture {
       pigment { rgb 0.15 transmit 1 }
     }
*/
     interior {
       media {
         samples 10
         emission 0.15
         density {
           function { Wave(10, 10, -10, x, y, z, 0.25, 5, 5, TIME) + 0.25 }
         }
       }
     }
   }//rotate 360*x*clock

}

#if(Sphere)
sphere {  -10, 10
#else
box{<-0.0001,-10,-10>,<-20,10,10>
#end
	texture{function{ Wave(10, 10, -10, x, y, z, 0.25, 5, 5, TIME) + 0.25 }
	texture_map{[0 pigment{ rgbt 1}finish{ambient 0.75}][0.9 pigment{ rgb 
1}finish{ambient 0.85}]}}
	
	}

  camera {
    location <0,0,-30>
   look_at 0
    angle 70
  }

> --------------------------------------------------------------------
> 
> In my renderings the spherical ripples radiating from the top right-hand corner
> only appear to be emitting on the surface of the box.  Also, the back face
> doesn't look dark enough in the less dense areas (I bet it would look solid
> grey if there weren't ripples in front.  This seems really fishy to me.  I'd
> appreciate any explanations/solutions!
> 
> 
To see the difference between sampling on the surface and sampling through the 
media, render this altered scene.
On the right, your media filled cube, on the left, another cube using your 
function as a texture pattern.
The objects have been shifted, but not the patterns, so that the patterns will 
continue from one object to the other.

By setting the variable "Sphere" to 1, you can switch to a pair of spheres.

There is a huge difference

-- 
Alain
-------------------------------------------------
Where the press is free and every man able to read, all is safe.
Thomas Jefferson


Post a reply to this message

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