POV-Ray : Newsgroups : povray.general : scattering media oddities : Re: scattering media oddities Server Time
30 Jul 2024 00:27:34 EDT (-0400)
  Re: scattering media oddities  
From: Alain
Date: 19 Mar 2010 21:59:52
Message: <4ba42c18$1@news.povray.org>


I did some testing using isosurface and came with that:

#declare Scl = 130;
// act as scale 1/130 for a pattern or an object
#include "functions.inc"
// a very usefull collections of various functions.
isosurface{
	function{ f_granite(x*Scl,y*Sclm,z*Scl) }
	threshold 0.3
// Alter this value to change the "filling" of the shape
	contained_by{box{<-5, 0.01, -5><10, 13, 7>}}
	max_gradient 2
// The reported max_gradient is much larger, but any holes
// are not perceptible at the scale used
	all_intersections // needed as we use tranparency
	material {
		texture { pigment { color rgbf <1,1,1,0.3> } }
		interior {fade_color rgb<1,0.5,0.3>
			fade_distance 0.01 fade_power 1001
			ior 1.4
			//media {  scattering { 1,     White *0.08  samples 3}
// if you use nedia, you should use a low count as you can go through
// a LOT of surfaces.
       }
			}
		}
	finish{specular 0.2 roughness 0.01}
	
	}

With the transparency used and adc_bailout, max_trace_level was only 
4/255, but, if you use more transparency, you'll encounter more surfaces.
It shows transparency near the corners. The cylinder progressively 
disapear in the mass.

You can try with other functions.


I also used normal perturbations and set an ior for the containing box 
giving interesting results. I also used colour fading. With that trick, 
the cylinder dissolves into the box:

#declare i = 0;
#declare fogStep = fogDepth/fogDivisions;
#while(i < fogDivisions)
    box {
       <-5, 0.01, -5 + i*fogStep>, <10, 13, -5 + (i+1)*fogStep - 0.01>
       hollow
material {
    texture { pigment { color rgbf <1,1,1,1> }  finish{specular 0.3 
roughness 0.01}
	}
    interior {
    	fade_color rgb<0.95, 0.90, 0.85> fade_distance 0.5 fade_power 1001
	media {  scattering { 1,     White *0.08  }      }
	ior 1.44
    }
}

    normal{granite 0.5 scale 0.01}
    }
#declare i = i + 1;
#end




Alain


Post a reply to this message

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