POV-Ray : Newsgroups : povray.advanced-users : Using lightmaps generated with POV back into POV textures : Re: Using lightmaps generated with POV back into POV textures Server Time
28 Sep 2024 06:11:44 EDT (-0400)
  Re: Using lightmaps generated with POV back into POV textures  
From: Ive
Date: 27 Jan 2011 12:53:24
Message: <4d41b114@news.povray.org>
Am 27.01.2011 15:52, schrieb Jaime Vives Piqueres:

>> Actually it looks to me like the saved lightmap file is not linear. Or
>> maybe it gets gamma corrected when loading it back?
>
> I think it is linear, as I'm using assumed_gamma 1 and the output is
> PNG, but I'm never sure about anything if gamma is involved. ;)
>


>> Have you used OpenEXR files for the lightmap or something else?
>
> Unfortunately I cannot use OpenEXR, as POV-Ray doesn't supports alpha
> output on these... and I need it for the trick which "grows" the UV maps
> to avoid the visible seams (of course, HDR output will be the best
> solution).
>
Have you actually tried OpenEXR? This file format *does* support alpha
and IIRC there was once a bug (with alpha getting inverted or some such) 
but it should work fine now - haven't tried it myself since quite some time.


>> And that min() bothers me as it defeats the idea of HDR lighting.
>
> Well, as I'm not using HDR, I guess it shouldn't matter.

Sure, but this is quite a limitation when used for exactly this purpose.


>> What kind of artefacts do you get?
>
> Dot-artifacts, exactly them same ones that FlyerX was describing on this
> thread:
>
>
http://news.povray.org/povray.general/thread/%3C4ca53804$1@news.povray.org%3E/?ttop=355419&toff=50
>

I see. Looks like a POV-Bug. Have you considered filing a bug report 
before it is too late ;) - which reminds me that I wanted also report 
one more definite bug but for the moment I cannot remember what it was.


> In the mean time, I got slighty better results using the multiplication
> and then applying to the result the formula for the Gimp "overlay" mode.
> Also, I'm not sure if baking lightmaps with white pigments on the
> objects was the best choice... perhaps a medium grey would get better
> results? (trying it now...)

Hmm, should help as radiosity (unless you use insane settings) tends to 
flatten the lighting and this effect does become much more prominent 
when using plain white as pigment.
And I think I'm beginning to see the cause of the problem: there is too 
much light distributed as all objects whithin the scene are equally 
bright. So - purely judged from your posted example images - I would try 
to apply a power function on the lightmap (kind of inverse gamma) 
*before* doing the multiplication, like:
function { ft_pigment(x,y,z).red * pow(fp_lightmap(x,y,z).red, 
MyLightmapExponent) }


-Ive


Post a reply to this message

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