POV-Ray : Newsgroups : povray.unofficial.patches : UVPov alpha 6 (based on POV 3.1g) : Re: UVPov alpha 6 (radiosity bug?) Server Time
3 Sep 2024 02:17:54 EDT (-0400)
  Re: UVPov alpha 6 (radiosity bug?)  
From: Mike
Date: 29 Oct 1999 07:35:08
Message: <38198425.EF0AE226@aol.com>
That was my patch.  There was (maybe still is) an intermittent and rare bug that
if you stopped the render at just the right time would cause the cache file to
be saved between renders.  So what I did was make about 5 hard coded options in
radiosit.c part of the scene language in global settings.

I think some of this may have been fixed, but here's part of the docs I put
together for the patch:

Control of the radiosity cache file is handled with five new keywords.  By
default they are (now) all set to 0.  You can set them all to one for POV to use
the cache file, which let's you bypass the mosaic preview and also speeds up the
final pass.  Leave them off if you are animating and you have an objects
changing, or if you find that changes to the scene file aren't showing up in the
render.

Here's where they belong (not the best keywords I know):

global_settings {
radiosity {
file_savewhilerendering 1
file_readoncontinue 1
file_alwaysreadatstart 1
file_keeponabort 1
file_keepalways 1
}
}

The fix for the broken radiosity problem was to reset Radiosity_Trace_Level to 1
in Deinitialize_radiosity_code() in radio.c.

I don't have the source files for what I did anymore, but I'm pretty sure what I
did was add to parse.c code that would read these parts and save the values into
these members variables:

opts.Radiosity_File_ReadOnContinue = 1;
opts.Radiosity_File_SaveWhileRendering = 1;
opts.Radiosity_File_AlwaysReadAtStart = 0;
opts.Radiosity_File_KeepOnAbort = 1;
opts.Radiosity_File_KeepAlways = 0;

You can find these in povray.c.  You could just set them all to 0 and that fixes
the bug.  If I were to do this again I would probably just change things so that
the user would specify whether or not to save the file and whether or not to
read it like you have with photon mapping.  Having the cache file is a handy
thing if you are just rendering the same scene over and over since it speeds
thing up a bit.  If you have it save the file from one scene and then have it
use that file on another scene, you get the radiosity for the previous
one...kind of wierd.

Right now the rad_cache_filename is equal to opts.Scene_Name and
RADIOSITY_CACHE_EXTENSION is defined as .rca in radiosit.h.  Perhaps adding an
opts.Radiosity_Cache_File_Name for the user to specify the file and have
rad_cache_filename point to that would be helpful.

Just trying to share all I remember about this in case you want to try doing it.

-Mike

> This reminds me....  A while back somebody said they had changed the
> radiosity code to do a better job of saving/loading the radiosity cache
> file.  Now, these changes never made it into POV 3.1g, so I don't have them.
> If this bug is in UVPov, it is probably also in 3.1g.  Does anybody have
> that radiosity code?  If not, I may be able to make those changes myself,
> but for now I'm sure if you delete that cache file after canceling a trace,
> the problem will go away.


Post a reply to this message

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