|
|
In article <3c750536@news.povray.org>, Warp <war### [at] tagpovrayorg>
wrote:
> For pigments there's one trick that can be used: trilinearly-filtered
> mipmapping. However, this has two problems:
> 1. I don't know how mipmaping could be implemented in *procedural* textures
> (without taking exorbitant amounts of memory and without losing details).
> 2. It works only for the texture of one object. If the checkers were
> actual objects (eg. boxes or whatever), this trick won't work.
Not mipmapping, but similar ideas:
Basically, you have to compute the color of an area of texture, not just
one point.
1: Use distance-based blurring on the texture. Beyond a certain
distance, start blurring, and blur more with more distance. Breaks if
you zoom in too much or have an object that magnifies the scene behind
it, and is slow.
2: Use distance-based patterns. The ordinary checker pattern closer up,
but with distance the values get closer to 0.5, and it becomes a blend
instead of a block pattern. Same problems as above, but faster. Also, it
will break for more complex color maps, and requires extra work on the
patterns.
3: Take the first object the pixel hits, and supersample it based on
distance, distant objects getting more samples. You could leave out the
other scene objects for speed...if they weren't the first intersection,
it is unlikely they will have much contribution to the pixel. Probably
the easiest to implement, though not necessarily fast.
4: Use the ray footprint. Figure out the area the pixel covers when
projected out to the intersection point, and use one of the above two
techniques to compute the color. One possible way to do this would be to
fire a pair of slightly different rays (or maybe 3 rays?) and calculate
the angle between them. The only disadvantage this would have would be
speed.
All of these would be better if they were done on a per-object basis,
for speed.
--
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/
Post a reply to this message
|
|