POV-Ray : Newsgroups : povray.programming : A few ideas : Re: A few ideas Server Time
29 Jul 2024 06:17:02 EDT (-0400)
  Re: A few ideas  
From: Ronald L  Parker
Date: 1 Jun 1998 22:32:15
Message: <35736186.273775680@news.povray.org>
On Sun, 31 May 1998 05:55:18 -0500, Mike Hough <POV### [at] aolcom>
wrote:

>2)A distance mask.  This is pretty easily done by making a union of the
>scene and applying a gradient, but would be much more useful if it could
>be rendered to the alpha channel of a tga or png image.  Two types would
>be useful.  The first would invlove going from Black at the camera and
>White going into the image, becoming completely white at a distance
>specified in the scene file.  

I made this patch for POV 2.2, though I did the reverse (white close,
black far.)  It's quite useful as the depth map for a stereogram, or
as a heightfield in POV itself.  It's quite easy to do, and only takes
a few lines of code in determine_apparent_colour and a few more to set
up the options (min/max distance, grayscale vs. red/green, etc.)  I've
made several offers since I created the patch to make the code
available, but nobody ever wanted it.  I've now lost that patch, but
it could be easily recreated.

>The resulting image could have a color
>added to it with the mask in place to create a very quick fog.  

I hate to burst your bubble, but this is what POV does already, except
that it also takes fog into account on reflected and refracted rays,
which this method would not.  Consider: your scene consists of a
single perfectly transparent glass disk, close to the camera, and a
large sphere surrounding the scene.  Should you be able to see the
glass disk?  You will - it will cut a hole out of the "fog" and you'll
see the sphere much more clearly through it than you should.  

If you don't have any reflected or refracted rays - the only kind of
scene where the "shortcut" method would work - POV will be faster than
the two-step process.  Since it would be calculating the distance for
either scenario, the only gain would be in the shortcut method not
mixing the colors within POV - which your postprocessing step would
then have to do, with less precision and more work on your part.


Post a reply to this message

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