POV-Ray : Newsgroups : povray.advanced-users : image_map transparency vs. difference : Re: image_map transparency vs. difference Server Time
28 Jul 2024 22:22:13 EDT (-0400)
  Re: image_map transparency vs. difference  
From: Christopher James Huff
Date: 13 Oct 2003 17:33:10
Message: <cjameshuff-28DB2A.17305113102003@netplex.aussie.org>
In article <3f8ad0f5$1@news.povray.org>,
 "Scott Gammans" <dee### [at] yahoocom> wrote:

>  Intuitively it would seem that using image map
> transparency "stores" the differencing calculations statically so they're
> only calculated once (when you create the image map in the first place, for
> which I used POV-Ray, btw), and at runtime all of the differencing
> calculations are unneeded; POV-Ray just wraps the image map around my
> airplane fuselage cylinder and then creates a "hole" wherever a light ray
> strikes a transparent pixel in the alpha channel of the image map... is that
> a fair approximation of what's happening?

It doesn't create a hole, the surface is still there, it is just 
transparent. This technique is a sometimes-useful hack, but does not 
have any actual effect on the geometry of the object.


> (2) Here's something I really don't understand: Obviously the trade-off of
> using image maps vs. differencing is that you must use fairly large image
> files to get acceptable results; otherwise, if the camera gets too close to
> the model you start to see jagged edges around the window "holes". But when
> I created a 4000x4000 version of my image map, the rendering time was almost
> *exactly* the same as when I was using a 1000x1000 PNG file. The amount of
> memory used jumped considerably, of course, but the average rendering time
> between the 1000x1000 and 4000x4000 image maps was essentially unchanged. Is
> that about right?

The work to find the pixels involved and interpolate between them is 
constant, and independent of the resolution of the image. Pretty much 
just clamp the coordinates to [0, 1], multiply by the width and height 
and round down to get one corner pixel, and simply add integers from 
there. It will be slightly slower due to more memory being accessed, but 
probably not by enough to reliably measure. Unless you run out of RAM 
and start swapping...

-- 
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.