POV-Ray : Newsgroups : povray.newusers : DF3 / interpolation question : DF3 / interpolation question Server Time
18 Jul 2024 07:33:16 EDT (-0400)
  DF3 / interpolation question  
From: JeffBTX
Date: 29 May 2009 22:00:01
Message: <web.4a2091fa9ea5e81c2c1590090@news.povray.org>
I am using POVRay version 3.6.1.msvc8.win64, OS is WinVista Home Premium 64 bit.

I am getting back into POVRay after a LONG hiatus. Its been maybe ... 4 or 5
years at least since I last touched POVRay.

Yesterday I started experimenting with .DF3 files. I've had SOME experience with
them under POVRay 3.5 (but I think I fully understand them). I've used Pod's
tga2df3 utility, and also experimented with using a program that I wrote to
*create* blank DF3s (just the header, plus filled with zeros). I've
experimented and figured out how to calculate the offset into a DF3 given x,y,z
coords. My results arwe what I expect, IE I'm not doing anything wrong, voxels
are where they are supposed to be.

I've noticed something odd. I THINK I know what is happening, but could use
input from a "Guru".

Assume you have a "blank" DF3 (just the header, plus filled with zeros). Assume
an 8 bit DF3, of say, dimensions 10x10x10 or 100x100x100 (because that is what
I've been experimenting with so far). Now... "activate" a *corner* of the DF3
by filling it (with, say, a density value of 255). The offset (for a 10x10x10)
(assuming zero-base coords of 0-9) would be x + (y*10) + (z*10*10) + 6. Or
substitute 100 for 10, for a 100x100x100 DF3. Okay... if you fill x,y,z = 0
with 255, you have filled the lower left forward corner of the cube.

If you use interpolate 0 with the DF3, the result is exactly as expected,
nothing strange... just a blocky "pixellated" voxel.

If you use interpolate 1 with the DF3, there are "artifacts" at other corners
and occasionally in other unexpected places (even in the center (?) of the cube
sometimes? huh?).

If you use interpolate 2 with the DF3, the artifacting becomes stranger and
extremely "wacky".

Okay, I guess the interpolation is ... "averaging" (kind of like antialiasing)
the region around that corner, and is unexpectedly "wrapping around" to the
other corners? And why are artifacts showing uop in odd places, like the middle
of the cube?

Okay ... so I say to myself, no problem, just make sure that you stay at least
one voxel away from all corners, edges and faces to avoid this "wrap-around" /
"bleeding" effect.

No good - if you are one voxel away from the corner, using interpolate 2, there
is still some "bleeding". Probably there is a "magic number" (number of voxels)
as a "safety zone"... before I try to find it by experimenting, I thought I
would ask for input, and maybe an explanation of what is happening.

-Thanks
-jeff


Post a reply to this message

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