POV-Ray : Newsgroups : povray.advanced-users : HDR images as functions: is this right? : Re: HDR images as functions: is this right? Server Time
30 Jun 2024 02:12:15 EDT (-0400)
  Re: HDR images as functions: is this right?  
From: Christian Froeschlin
Date: 29 Jan 2011 13:08:16
Message: <4d445790$1@news.povray.org>
stbenge wrote:

> I'm really hoping to develop some "one size fits all" default values, 
> and let people worry about adjusting things only when it's absolutely 
> necessary.

Basically, what you're trying to do is to encode a large but finite
value range in the interval [0,1], which is mathematically perfectly
ok but breaks down in real life due to finite precision.

If you are only concerned about preventing wraparound and preserving
detail in the dark areas you can use a non-linear encoding (e.g based
on a logarithm function). Then the reconstruction requires you to
approximate an exponential mapping using many color map entries.
The drawback is still loss of detail in bright areas.

Alternatively, you can use the method of dividing by 256
but allowing multiple slices. For example f_r_0_256 could
be a function that has the values of f_r/256 except that
it is 0 where f_r > 256. f_r_256_512 is a function that
has value "f_r/256 - 1" where f_r > 256 or f_r <= 512
but is 0 everything else, and so on.

These can be turned into pigments that are black outside
their definition range and reconstruct a slice of brightness
within ( actually, to separate unused Black from the first
payload color value in the map it might be better to not
use the full interval (0,1] for encoding values, but
rather only an interval [1/256,1] ). Averaging these
with appropriate scaling should yield the pigment.

The best solution would probably be to provide built-in
support for building pigments from functions without going
via cludgy pattern, color_map and averaging in povray.


Post a reply to this message

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