POV-Ray : Newsgroups : povray.general : Help with macro(s) for simulating weather patterns : Re: Help with macro(s) for simulating weather patterns Server Time
29 Jul 2024 14:14:41 EDT (-0400)
  Re: Help with macro(s) for simulating weather patterns  
From: Alain
Date: 24 Apr 2012 15:35:42
Message: <4f97008e$1@news.povray.org>

> "D103"<nomail@nomail>  wrote:
>> Ok, thanks very much. :) I think I'll use the scale pigment, floating point
>> precision errors are not what I need.
>>
>> Regards,
>> D103
>
> Just realised that that would require two declarations of the image. What size
> image would cause fp errors? Current images used are at the most 4096x2048.
>
> Regards
> D103
>
>
>

Thinking about it further, you don't even need to apply the image to an 
object.

#declare ColImg=  pigment{ image_map {jpeg "my_image.jpg"}}
#declare Res = max_extent(ColImg);

You can now scale the pigment directly:
#declare ColImg = pigment{ ColImg scale<Res.x, Rex,y,1>}
This scales the pigment and reattribute it to the same identifier.

Then, you use eval_pigment directly on the pigment identifier.

It depends...
4096 and 2048 are exact powers of 2, and should not cause any error, or 
negilgible ones.
4000 x 3000 WILL cause fp errors.
800 x 600 will also cause fp errors as those values are not powers of 2.


Post a reply to this message

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