|
|
[Talking about "16 bit image map pattern not working with isosurface"]
Christoph Hormann wrote:
>Note this is probably an extremely bad idea since it does not work with
>interpolation
>
I dare to object...
I think I have the mathematical proof that there is no problem
with interpolation even when using two separate 8 bit images instead
of one 16 bit set. You just have to use bilinear interpolation on
both of them:
Consider we have 16 bit topography data split into two 8 bit sets
with low and high byte of the values.
Look at two pixels a,b next to each other:
a = a_lo/256 + a_hi
b = b_lo/256 + b_hi
Normal linear interpolation would do just that:
val = p * a + (1-p) * b
But using two separate textures, they get interpolated separately:
val_lo = p * a_lo + (1-p) * b_lo
val_hi = p * a_hi + (1-p) * b_hi
Then, these get composed to the real value as used in the isosurface:
val = val_lo/256 + val_hi
= [ p * a_lo + (1-p) * b_lo ]/256 + p * a_hi + (1-p) * b_hi
= p * (a_lo/256 + a_hi) + (1-p) * (b_lo/256 + b_hi)
= p * a + (1-p) * b
...and that's just what we want. -- q.e.d.
Bilinear interpolation is just the same in two directions.
Incorrect? Any comments?
Cheers,
Wolfgang
Post a reply to this message
|
|