POV-Ray : Newsgroups : povray.newusers : stbenge Fastprox fast SSS : stbenge Fastprox fast SSS Server Time
6 Oct 2024 01:44:46 EDT (-0400)
  stbenge Fastprox fast SSS  
From: Mr
Date: 15 Aug 2009 17:15:01
Message: <web.4a8724829cb450a21c8336ca0@news.povray.org>
I am trying to use Fast SSS 2 from Stbenge macro but can't manage to get an
ordinary finish with it. any specularity seems to cover up the effect. Here is
what I tried By directly modifying example files from around here (I modified
Object 2):

/*















*/

//#include"shapes.inc"
//#include"shapes2.inc"
//#include"functions.inc"
//#include"math.inc"
#include"transforms.inc"
//#include"my_materials.inc"
#declare R=seed(005);

#declare global_illumination = on;
global_settings{
 #if(global_illumination=1)
  radiosity{
   //count 200 error_bound .1
   //count 9 error_bound .05
   //count 15 error_bound .002
   //count 30 error_bound .002
   count 90 error_bound .005
   //count 150 error_bound .002
   //count 130 error_bound .15
   //count 90 error_bound .2
   //count 256 error_bound .0125
   //count 309 error_bound .101
   //count 150 error_bound .05
   //count 900 error_bound .05
   //count 1600 error_bound .1
   //count 1600 error_bound .01
   //error_bound .05 count 1600/8
   //pretrace_start .08 pretrace_end .01

   //minimum_reuse .01


   nearest_count 1

   recursion_limit 1
   normal on
   brightness 1
   gray_threshold 0

   adc_bailout 0.1
  }
 #end


 //assumed_gamma 2.2
 //assumed_gamma 1
 //photons{spacing .005 jitter 1}//jitter 0 radius 1}
 photons{count 10000 jitter 0}
 max_trace_level 30

 noise_generator 3
}

#default{ finish{ambient 0 }}//normal{bumps .5 scale .0001}}

//#default{ finish{ambient 1 diffuse 0 } }//normal{bumps .5 scale .001}}

#declare cpos=<0,-9,-30>;

camera{
 //fisheye
 //right x*4/3 up y*1
 //orthographic
 //right x up y
 //right x*0.7 up y*0.7
 location<0,10,-20>*1.2
 look_at 0
 angle 10

 //aperture 5 focal_point -z*4 blur_samples 100 variance 0
 //sky<-.3,1,0>
}

//#version unofficial megapov  1.21;
/*
#declare illusion_angle = 40;
#declare illusion_image = "sky_maker3.tga"
#declare illusion_location = <0,-9,-30>;
#declare illusion_look_at = y/1.5;
#declare illusion_right=x;
#declare illusion_up=y;

#include "illusion.inc" #declare txtr=2;

#declare illusion_texture=
texture{
 pigment{illusion}
 finish{ambient 1 diffuse 0}
}
sphere{0,1000
 texture{illusion_texture}
 no_shadow
}

*/
//#include"edge_pigment.inc" #declare txtr=1;


#declare res = 5;
#declare lpos = <.5,1,-.5>*10;
#declare lcol = 1.25;
#declare earthy = <.75,.65,.5>;
#declare wooden = <.75,.5,.25>;
#declare air = <.05 .25 .5>;
#declare plant= <.4 .75 .4>;


//fog{rgb(air*4+lcol)/8 distance 1000 fog_type 2 fog_alt 150 fog_offset 0}

// 1209 1166
// 604  583

#declare area_illuminate = on;
light_source{lpos*100000,lcol }//area_light x*15000,z*15000,res,res jitter
adaptive 1 }
//light_source{lpos*100000,lcol }//area_light x*250000,z*250000,res,res jitter
adaptive 1 area_illumination area_illuminate}
//light_source{<-1,.5,.5>*100000,(air+lcol/2)  }//area_light
x*245000,z*245000,res,res jitter adaptive 2 area_illumination area_illuminate}

//light_source{lpos*100000,lcol area_light x*150000,y*150000,res,res jitter
adaptive 2 area_illumination area_illuminate}
//light_source{<0,1,0>*100000,.5 }//area_light x*250000,z*250000,res,res jitter
adaptive 2 area_illumination area_illuminate}
//light_source{<1,1,0>*100000,lcol/3 area_light x*150000,z*150000,res,res jitter
adaptive 2 area_illumination area_illuminate}
//light_source{<0,0,0>,<1,.8,.5> fade_power 2 fade_distance 15 area_light
x*1,y*1,res,res jitter adaptive 2 area_illumination area_illuminate}


//fog{rgb (air+lcol) distance 700 fog_type 2 fog_alt 10 fog_offset 0}


sky_sphere{
 pigment{
  spherical scale 2 translate y
  //warp{turbulence .05 lambda 2.75}
  Point_At_Trans(lpos)
  poly_wave 1
  //cubic_wave
  pigment_map{
   //[0 rgb earthy -.3]
   [0 rgb 0]
   [.5 rgb air]
   /*[.75
    granite scale 3.5 //turbulence .03 lambda 4
    color_map{
     [0 rgb air]
     [1 rgb 1]
    }
   ]
   */
   //[.7 rgb(air+lcol)/2]

   [1 rgb lcol]
  }
 }
}

#declare obj1=
merge{
 cylinder{-x,x,.3}
 cylinder{-y,y,.2}
 cylinder{-y,y*.8,.2 translate -z*.3}
 cylinder{-y,y*.8,.2 translate z*.3}
 cylinder{-z,z,.3}
 box{-.5,.5}
 torus{1,.125}
 rotate y*35 rotate-x*12
 translate x*-1.2
}

#declare obj2 =  object{obj1 translate x*2.4}

#include"fast_prox.inc"

#declare p1=
 pigment{
   fastSSS2(obj1,lpos,min_extent(obj1)-0.5,max_extent(obj1)+0.5,<5,5,5>,2,20)
   cubic_wave
 }

 #declare p2=
 pigment{
   fastSSS2(obj2,lpos,min_extent(obj2)-0.5,max_extent(obj2)+0.5,<5,5,5>,2,20)
   cubic_wave
 }

//****** subsurface scattering (SSS) grey textured object (on the left of the
picture) - texture shows where light passes through object (white = lots of
light passes through, black = no light passes through)
object{obj1
 pigment{p1 }
 finish{ambient 1 diffuse 0}
 //pigment{rgb 1}
}

//****** SSS plastic textured object (on the right of the picture) - the lighter
areas are more transmittant looking
object{obj2
 pigment{p2 colour_map{
                [0 rgb <0.63, 0.25, 0.15>*0.1 ]
                [1 rgb <0.63, 0.25, 0.15> ]
        }
 }
 finish {
        diffuse 0.1
        ambient 0.7
        phong 0.35
        phong_size 1
        brilliance 4
        specular 0.1
        roughness 0.01
 }
 //pigment {colour rgb <0.5,0.6,0.4>}

 //pigment{rgb 1}
}

/*
#declare fp=function{pigment{p}}

isosurface{
 function{
  fp(x,y,z).grey-.5
 }
 accuracy .01
 max_gradient 8
 contained_by{box{-1.25,1.25}}
 pigment{rgb 1}
 rotate y*35
}
*/
//sphere{0,(Max.x-Min.x)/2 pigment{rgbt .5}}

/*
union{
#declare V=0;
#while(V<=1)
 sphere{<Min.x+V*(Max.x-Min.x),0,0>,.1}
 sphere{<0,Min.y+V*(Max.y-Min.y),0>,.1}
 sphere{<0,0,Min.z+V*(Max.z-Min.z)>,.1}
 #declare V=V+incre;
#end
pigment{rgb .5}
}
*/
//box{Min,Max pigment{rgbt .5}}



//#include"edge_pigment.inc" //edge_pigment(obj, rad,jitter,quality)
//#include"stbHexPatterns.inc"
//#declare g=(1+sqrt(5))/2; // the golden ratio
//#include"luminous bloom/circular.inc"
//#include"edge_pigment.inc"
//#include"chamfered_shapes1.inc"


/*
#declare V=0;
#while(V<1)
 #declare V=V+1/10;
#end
*/

Any idea on how to integrate that macro in a custom material?


Post a reply to this message

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