|
|
Well really what you'd want is anisotropic filtering. Take the 4 texture
coordinates of 4 pixel centers and compute the true average of the texture
within that quadrilateral region (though even a quadrilateral is an
approximation). Obviously with pov's internal patterns a true average won't
always be possible but you could adaptively sample the texture within that
area far faster than you can adaptively anti-alias the image to get a
similar quality result.
Mip maps save you from needing so many samples, but they also effectively
bleed in colours from outside the sample area.
--
Tek
http://evilsuperbrain.com
"Zeger Knaepen" <zeg### [at] povplacecom> wrote in message
news:438f9dee@news.povray.org...
I was searching for a possibility to do mipmapping in POV-Ray.
This one uses 11 different images (scaled
800*800,400*400,200*200,100*100,50*50,25*25,12*12,6*6,3*3,2*2 and 1*1
pixels) and interpolates between them in function of the distance from the
camera and the angle of the surface (using an average between a spherical
pattern and the aoi-pattern.
The scale of the spherical pattern is very resolution-dependant (a smaller
output-image requires a smaller spherical-pattern), and as it is now it
doesn't look good in reflections or refractions though.
Is there a reason that POV-Ray doesn't support it natively ? I believe the
reflection/refraction problem could be solved if I had access to the length
of the ray from the camera to the object (being the sum of the lengthts of
all recursive rays for that pixel... I seem to be having some trouble
expressing myself in English lately :-/ ), and also the scale of the
spherical pattern could be calculated automatically in function of the
output-resolution. Both things (I think) could easily be coded into POV-Ray
(if you know how to program in C, which, unfortunately, I don't).
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
|
|