POV-Ray : Newsgroups : povray.general : some questions : Re: some questions Server Time
30 Jul 2024 22:25:55 EDT (-0400)
  Re: some questions  
From: Zeger Knaepen
Date: 7 May 2008 14:12:48
Message: <4821f120$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message 
news:4821b485@news.povray.org...
> E.T. <nomail@nomail> wrote:
>> 1.) I have noticed that when i make a plane with a chess pattern, the 
>> further
>> the camera looks, the more rumbled the plane becomes. Is there any way to 
>> avoid
>> it ? ( even with AA on things don't change much )
>
>  You can bump up antialiasing settings (eg. +a0.0 +am2) but you will never
> completely get rid of those artifacts. It's one problem with procedural
> textures.

that's not entirely true, try this:

--- start code ---
#local Camera_Location=<0,1,0>;
#local Color1=red 1;
#local Color2=blue 1;
camera {
 location Camera_Location
 look_at z+y
}
plane {y,0
 pigment {
  pigment_pattern {
   spherical scale 25 translate Camera_Location*<1,1,1> color_map {[0 rgb 
0][.75 rgb 1]} poly_wave 1
  }
  pigment_map {
   [0 rgb (Color1+Color2)/2]
   #local I=0;
   #local MI=20;
   #while (I<MI)
    [I/MI
     pigment_pattern {boxed translate 1 scale .5 warp {repeat x} warp 
{repeat y} warp {repeat z} translate .5*y}
     pigment_map {
      [0 rgb (Color1+Color2)/2]
      [1-(I/MI) average
       pigment_map {
        [1-(I/MI) rgb (Color1+Color2)/2]
        [(I/MI) checker Color1 Color2]
       }
      ]
     }
    ]
    #local I=I+1;
   #end
   [1 pigment_pattern {boxed translate 1 scale .5 warp {repeat x} warp 
{repeat y} warp {repeat z} translate .5*y}
    pigment_map {
     [0 rgb (Color1+Color2)/2]
     [0 checker Color1 Color2]
    }
   ]
  }
 }
 finish {ambient 1 diffuse 0}
}
--- end code ---

if you render this, even without anti-aliasing, you won't get any 
"rumbling". (you'll have to adjust the scale of the spherical pattern for it 
to look good enough to be of use)

this is a form of mipmapping (often used in scanline-renderers exactly to 
solve the problem you mention) but there are some huge problems with the way 
it's done here.  First, it will not look good in reflections or refractions. 
Second, it's not accurate: the amount of blurring only depends on the 
distance from the camera, it sould also be dependant to the angle, which is 
possible in MegaPOV with the aoi-pattern.  See my site (Gallery -> 
Experiments) for two other experiments with mipmapping in POV-Ray (actually 
MegaPOV).

cu!
-- 
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x)            // ZK http://www.povplace.com


Post a reply to this message

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