POV-Ray : Newsgroups : povray.text.scene-files : texture bluring v 0.55 WIP Server Time
1 Nov 2024 01:24:10 EDT (-0400)
  texture bluring v 0.55 WIP (Message 1 to 1 of 1)  
From: Rafal 'Raf256' Maj
Subject: texture bluring v 0.55 WIP
Date: 20 Jul 2002 09:59:05
Message: <Xns9251A2057F211raf256com@204.213.191.226>
/*
  Textur Blur Finction + example

  1:1 ratio
  started ~10.07.2002, last ver 0.55 20.07.2002 for 3.5win
*/

// vvv OPTIONS ==================

#declare blur1_rad   = 0.02;  // radius +n. def.: 0.02
#declare blur1_sampl = 6;     // samples +n def.: 6  0=off
// pigment - MONOCHROME :
#declare fn1 = function {  pigment { 
    marble color_map {[0 color rgb 0][0.1 color rgb 0.2][0.92 color rgb 
0.5][1 color rgb 1]}   
    scale 2  turbulence 1.0
} }


#declare blur2_rad   = 0.02;  // radius +n. def.: 0.02
#declare blur2_sampl = 6;     // samples +n def.: 6  0=off
// pigment - MONOCHROME :
#declare fn2 = function { pigment { checker color rgb 0 color rgb 1 scale 
<1,1,1000> }  }

// ^^^ OPTIONS ==================




#include "functions.inc"

camera { right x up y location -z*10 }
light_source { <-30,100,-100>*10 color rgb 1 }

#declare f1 = function(_x,_y,_z) { 
  #if (!blur1_sampl)
    fn1(_x,_y,_z).gray
  #else
    #local r=blur1_sampl;  #local sc=blur1_rad;
    #local maxDist = sqrt(r*r*3); 
    
    (
    #local ax=-r; #while (ax<=+r)
      #local ay=-r; #while (ay<=+r)
        #local az=-r; #while (az<=+r)
          fn1(_x+ax*sc,_y+ay*sc,_z+az*sc).gray +
        #local az=az+1; #end  
      #local ay=ay+1; #end  
    #local ax=ax+1; #end  
    0) / pow((r*2+1),3)      
  #end
} 


#declare f2 = function(_x,_y,_z) { 
  #if (!blur2_sampl)
    fn2(_x,_y,_z).gray
  #else
    #local r=blur2_sampl;  #local sc=blur2_rad;
    #local maxDist = sqrt(r*r*3); 
    
    (
    #local ax=-r; #while (ax<=+r)
      #local ay=-r; #while (ay<=+r)
        #local az=-r; #while (az<=+r)
          fn2(_x+ax*sc,_y+ay*sc,_z+az*sc).gray +
        #local az=az+1; #end  
      #local ay=ay+1; #end  
    #local ax=ax+1; #end  
    0) / pow((r*2+1),3)      
  #end
} 


sphere { 0 1

  texture { pigment { function { f1(x,y,z) } scale 0.2 } finish { specular 
0.9 roughness 0.02 } }
  texture { pigment { function { f2(x,y,z) }  
    color_map { [0 color rgbf <1,.1,.1,.5>][1 color rgbf <1,.9,.6,.9>] }
    scale .3
  } }
    
  
  scale 4
}




-- 

> A jedyne co czytam, ze to terrorysci internetowi z echelonu planuja
> kolejny atak na centrale TPSA
- Expert vel Jacek (obecnie gol### [at] pocztaonetpl)


Post a reply to this message

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