POV-Ray : Newsgroups : povray.advanced-users : The pov-state file : Re: The pov-state file Server Time
31 May 2024 20:01:32 EDT (-0400)
  Re: The pov-state file  
From: Le Forgeron
Date: 5 Nov 2013 17:16:16
Message: <52796e30$1@news.povray.org>
Le 05/11/2013 22:03, redmasq nous fit lire :
> I notice with some of my renders that it'll get to 99% and there are a few
> blocks that are taking their dear sweet time (I've once waited 3 days for the
> last 200 pixels to finish when the other 99% only took a few hours). Since
> POV-Ray doesn't support "repartitioning" of the render blocks, I was thinking
> that could re-render from source those missing blocks albeit with a smaller
> block size and using the start and end columns to fill in the blanks. Now to the
> point: does there exist any documentation (beyond the source code) of the
> pov-state file. My idea was to copy the pov-state file and read the copy with a
> simple program which will export an image in probably png. Based on behavior
> seen, I surmise that the file contains a series of blocks that can be "played"
> to generate the image. If not available, that's okay, I can read the source and
> write a quickie program, but if someone has already made an effort to at least
> document, maybe an existing utility... no need to duplicate effort.
> 
> Thank you in advance.
> 
> 
It might be easier to read the image on temporary file-buffer (when
Max_Image_Buffer_Memory option is set low enough): the format is 5 float
per pixel (R,G,B,F,T), and the tail of the file holds 3 additional
values, as size_type (integer, local order):
1. the size of each pixel := S
2. the width of the picture := W
3. the height of the picture := H

The number of pixels is rounded up to fit a number of line-block (where
the size of a line-block in pixel is the size of the rendering block
along *one* dimension: a 32x32 block size is not using 1024 pixels
block, but 32 pixel line-blocks)

Pixel for x,y starts at S * (y*W +x) in the file (and ends S bytes later).
(and obviously, 0<= y < H, and 0 <= x< W)

To know the number of bytes per float, divide S by 5.
Interpretation of float encoding is: local interpretation (usually
Ieee-754, but it's the problem of the compiler)

On Unix, the file is created with holes (unwritten part are just 0 and
do not use filesystem space until the relevant sector/inode is written
with some values).
On Windows, the system does not allow such behavior and insists on
writing all the 0 before continuing and starting the rendering (or even
the parsing of the scene): better have a fast disk.

The minimal value for Max_Image_Buffer_Memory (to have a file) is 1, as
1 megabyte, so the file is used only if the resolution has more than
104856 pixels. (bigger than 324 x 324 for a square)

Otherwise, the interesting code for pov-state is in renderfrontend.cpp
(source/frontend) and povmscpp.h & .cpp (in source/base).

Past the header, there is a sequence of POVMS_Message... some of them
are rendered blocks, and they have variable geometry, so you cannot just
jump over some to go where you want: you have to read all of them in
order. It won't be a fast write of program to handle the various messages.


Post a reply to this message

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