POV-Ray : Newsgroups : povray.unofficial.patches : Help-Instructions to Using Photon Map- Saving and Loading : Re: Help-Instructions to Using Photon Map- Saving and Loading Server Time
8 Jul 2024 16:01:47 EDT (-0400)
  Re: Help-Instructions to Using Photon Map- Saving and Loading  
From: Mike Hough
Date: 11 Oct 2001 13:06:15
Message: <3bc5d187@news.povray.org>
> First, I'd like to know whether the photon-map is reusable, even when I
> changed the size of the rendered image, or the viewing conditions such as
> camera (with fixed lighting and models).

Changing the size of the image is no problem as the photon map is resolution
indenpendent.  Any lacking in the quality of the photons will become more
apparent in a larger image but it's the same quality as it would be in a
smaller one.  Changing the camera angle might cause problems though I'm not
sure.  Any other changes are not a problem but keep in mind that the
caustics will look the same even if you change object or light locations.
In other words the photons are fixed in space.  Moving an object hit by
photons might cause the surface to be outside the range of the photon map.
This seems to be the way it works based on my experience.  Radiosity files
can be saved and loaded just like photons maps btw.

> I'd also like to learn where I could get instructions to saving and
loading
> photon maps.

Very easy.  In the photon block in global settings, add a line:
save_file "filename.ph"

To reload the map change that to
load_file "filename.ph"

The file gets saved to the same location as the scene file.  You might be
able to put a path in there but I'm not 100% sure.  I recently used this
trick in an animation (trout.mpg in p.b.a) so that I could create a series
of photon maps with simple geometry and reloaded them for a more complex
scene, thus saving time.  Concat() can be used for this purpose, such as:
#declare CURRENT_FRAME = clock;
save_file concat("myfile",str(CURRENT_FRAME,0,0), ".ph" )

This requires clock to be an integer value.  I find thinking of the clock as
representing frames is easier than using floating point values.


Post a reply to this message

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