|
|
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
|
|
|
|
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
|
|
|
|
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
|
|