POV-Ray : Newsgroups : povray.general : texture blurring : texture blurring Server Time
5 Aug 2024 22:17:06 EDT (-0400)
  texture blurring  
From: Rafal 'Raf256' Maj
Date: 20 Jul 2002 07:42:27
Message: <Xns92518ADBA1A4Draf256com@204.213.191.226>
There was question how to blur texture. One suggestion was to make many 
textures and translate <> them.
My idea is to use function, but it has limitation - it's good only for 
monochrome textures (i think)

Function can be :

#declare f2 = function(_x,_y,_z) { 
  #local r=6;  #local sc=0.02;
  #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)
}  

where number of samples is (r^3)*2 + 1, and bluring radius is 'sc'.
In this version it is not so good - I want to make universal macro for 
bluring, and most important - add gause (or at leaste multiply each sample 
by sqrt(ax*ax + ay*ay + az*az)

My problem is - how to make real bluring for r,g,b values ?
Is it possible to use function pigment, but that function will return 
color, instead of value passed to color_map ?

Maybe it would be a good idea to implement bluring in POV's code ? Because 
my version is so slooow :/ 

btw. How is pov 3.5 handling macros ? How meany times my formula is parsed 
? Once, once per sample or r^2*2+1 times per sample ?

Full source and images are posted to .b.i and .b.s-f

-- 

> 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.