POV-Ray : Newsgroups : povray.advanced-users : additive transparency for image_maps? Server Time
5 Jul 2024 14:03:38 EDT (-0400)
  additive transparency for image_maps? (Message 11 to 15 of 15)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Christian Froeschlin
Subject: Re: additive transparency for image_maps?
Date: 13 Dec 2007 16:25:52
Message: <4761a360@news.povray.org>
stbenge wrote:

> You're first suggestion makes more sense, to add one function to another 
> inside a function block. I will give that a try. Thanks :)

You're welcome. Maybe I don't understand something here ;)

By additively combining pigments, don't you mean that if
one pigment A evaluates to <r1,g1,b1> at some point and
pigment B evaluates to <r2,g2,b2> at that point that
A+B should simply evaluate to <r1+r2,g1+g2,b1+b2>?

And wouldn't average {pigment_map {[A] [B]}} evaluate to 
<(r1+r2)/2,(g1+g2)/2,(b1+b2)/2> = 0.5*<r1+r2,g1+g2,b1+b2>,
so scaling it up by a factor of two should do the trick?


Post a reply to this message

From: stbenge
Subject: Re: additive transparency for image_maps?
Date: 13 Dec 2007 17:02:38
Message: <4761abfe@news.povray.org>
Christian Froeschlin wrote:
> stbenge wrote:
> 
>> You're first suggestion makes more sense, to add one function to 
>> another inside a function block. I will give that a try. Thanks :)
> 
> You're welcome. Maybe I don't understand something here ;)

Whether you know it or not, you gave me the idea of adding separate rgb 
channels together *inside* functions, rather than averaging them to the 
existing image, or placing the result over the existing image. There's a 
difference, and the 'select' function keeps the values from ever going 
past 1.

> By additively combining pigments, don't you mean that if
> one pigment A evaluates to <r1,g1,b1> at some point and
> pigment B evaluates to <r2,g2,b2> at that point that
> A+B should simply evaluate to <r1+r2,g1+g2,b1+b2>?

That's pretty much I'm doing inside the function block, although I see a 
way to simplify my code now.

> And wouldn't average {pigment_map {[A] [B]}} evaluate to 
> <(r1+r2)/2,(g1+g2)/2,(b1+b2)/2> = 0.5*<r1+r2,g1+g2,b1+b2>,
> so scaling it up by a factor of two should do the trick?

No, not at all. You see, by averaging the colors, you are effectively 
bringing something down. You are giving dark colors the same chance at 
being seen as the light ones.

Instead of saying (r1+r2)/2, I think this is better:
r3=(r1+r2)
if(r3>1)r3=1;

The new version of my code is nearly complete now. The images it 
produces are more saturated, without being 'over the top'. I hope to 
release it soon, but I need to test it more.

Sam


Post a reply to this message

From: stbenge
Subject: Re: additive transparency for image_maps?
Date: 13 Dec 2007 17:04:05
Message: <4761ac55$1@news.povray.org>
Nathan Kopp wrote:
  > Try this:
> 
>   image_map {
>     ...
>     transmit all 0.5
>   }
> 
>   finish {
>     ambient 2.0
>     refraction 2.0
>   }
> 
> The "transmit 0.5" and "refraction 2.0" work together to give you 100% 
> transmittance.  The remaining 50% (left over from the transmit) combines 
> with "ambient 2.0" to give 100% illumination.

This should be easy to test with my current setup. I will give it a whirl.

Sam


Post a reply to this message

From: Nathan Kopp
Subject: Re: additive transparency for image_maps?
Date: 13 Dec 2007 23:33:09
Message: <47620785$1@news.povray.org>
Alain wrote:
> Nathan Kopp nous apporta ses lumieres en ce 2007/12/12 20:01:
>> stbenge wrote:
>>> Hi,
>>>
>>> Can anyone tell me if there is a way to achieve additive transparency 
>>> for images? I'd like to update my 'luminous bloom' file, since the 
>>> current version tends to bleed dark colors as well as light ones.
>>>
>>> A media box works, but it is much too slow. I wish there was an 
>>> 'addition' pigment to complement the average pigment.
>>>
>>> Sam
>>
>> Try this:
>>
>>   image_map {
>>     ...
>>     transmit all 0.5
>>   }
>>
>>   finish {
>>     ambient 2.0
>>     refraction 2.0
>>   }
>>
>> The "transmit 0.5" and "refraction 2.0" work together to give you 100% 
>> transmittance.  The remaining 50% (left over from the transmit) 
>> combines with "ambient 2.0" to give 100% illumination.
>>
>> -Nathan
> Please note that refraction in the finish block is deprecated and may no 
> longer be supported in future versions. It should be moved to the 
> interior block.


True.  But until then, this little hack works great.  :-)

Note that the version of "refraction" found in the interior block (the 
"correct" place) does not support this hack.

-Nathan


Post a reply to this message

From: Warp
Subject: Re: additive transparency for image_maps?
Date: 13 Dec 2007 23:55:42
Message: <47620cce@news.povray.org>
Nathan Kopp <pov### [at] nkoppmailshellcom> wrote:
> Note that the version of "refraction" found in the interior block (the 
> "correct" place) does not support this hack.

  What is the difference between using "refraction 2" and "filter 2"?

-- 
                                                          - Warp


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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