POV-Ray : Newsgroups : povray.binaries.images : mipmapping and trilinear interpolation : mipmapping and trilinear interpolation Server Time
7 Aug 2024 21:22:54 EDT (-0400)
  mipmapping and trilinear interpolation  
From: Zeger Knaepen
Date: 1 Dec 2005 20:05:50
Message: <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


Attachments:
Download 'mipmap_without.jpg' (104 KB) Download 'mipmap_with.jpg' (72 KB)

Preview of image 'mipmap_without.jpg'
mipmap_without.jpg

Preview of image 'mipmap_with.jpg'
mipmap_with.jpg


 

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