|
|
In article <3d4989dc@news.povray.org>, Warp <war### [at] tagpovrayorg>
wrote:
> It's not out of question. It's just difficult to make it so that it will
> work without problems in any system where POV-Ray has been ported. The
> biggest problem is endianess, and a minor problem is different floating
> point formats (which is actually a major problem in the case that the
> format is different; but I consider it minor here because virtually all
> practical computers use the same floating point format).
You could just standardize on one floating point format for the POV data
files, and write platform indpendant code that reads it byte by byte and
converts it to a float or takes a float and writes it in the correct
format, but the format might have different precision from what is
native on some platforms. I don't think this would cause any serious
problems...it's a pain, but not an insurmountable obstacle.
> After this is done, it should be easy to just make a raw dump of the
> bytecode to a file. This file will then be the binary format. Reading
> this file will then be extremely easy: Just read the entire file to memory
> and start interpreting. This saves the parsing stage, which can be really
> slow.
Actually, the compilation stage isn't necessarily that slow...you could
get a huge speedup over the present parser by just compiling to
bytecodes and running on the VM every time. Combine this with a compact
mesh format (maybe a custom binary format compressed with gzip
compression), and you have taken care of most of the reasons for a
binary scene format.
Another possibility: instead of saving the compiled bytecode program or
the internal data structures of the raytracer, save the commands the
program makes to the tracer. These commands could be used to rebuild the
scene without compiling/loading and interpreting the scene file, but
would be easier to serialize to a file than the complex internal data
structures: they would already be pretty serial in nature. I don't see
much reason to go through the effort though...whatever you do, you end
up with a non-human-readable file that is smaller than the text file
(but not significantly smaller than a compressed version of the text
file would be) and another input file format to worry about with
transferring between unofficial versions and updating the official
version.
--
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/
Post a reply to this message
|
|