POV-Ray : Newsgroups : povray.general : Leveller 2 and using hf pigments in iso-functions : Re: Leveller 2 and using hf pigments in iso-functions Server Time
3 Aug 2024 16:21:33 EDT (-0400)
  Re: Leveller 2 and using hf pigments in iso-functions  
From: Christopher James Huff
Date: 16 Jan 2004 17:54:24
Message: <cjameshuff-4C96EF.17544516012004@netplex.aussie.org>
In article <36r### [at] tritonimagicode>,
 Christoph Hormann <chr### [at] gmxde> wrote:

> > Wrong. The interpolation will work correctly, and with isosurfaces you 
> > very definitely want it.
> You obviously have never tried it - interpolation in color images does 
> treat the color channels independantly -> it will mess up such an image.

It does interpolate the channels independently, but it doesn't matter. 
The interpolated color is a weighted average of the image pixel colors. 
Here: (considering only two pixels for simplicity)

Interpolated colors:
w1*red1 + w2*red2
w1*green1 + w2*green2

Channels are combined with: red + green/256
(actually scaled down slightly, but that doesn't matter...it's done 
after everything else. And it actually uses 255 when it should use 
256...)

So the final grayscale value is:
w1*red1 + w2*red2 + (w1*green1 + w2*green2)/256

Combining channels before interpolating would give:
w1*(red1 + green1/256) + w2*(red2 + green2/256)
==
w1*red1 + w1*green1/256 + w2*red2 + w2*green2/256
==
w1*red1 + w2*red2 + w1*green1/256 + w2*green2/256
==
w1*red1 + w2*red2 + (w1*green1 + w2*green2)/256

Which should look familiar.
Now turning the interpolation off results in a discontinuous 
function...the infinite gradients will cause trouble for the isosurface 
solver. And while it would be possible to do the interpolation in an 
isosurface function, it isn't very feasible.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

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