POV-Ray : Newsgroups : povray.advanced-users : additive transparency for image_maps? Server Time
1 Nov 2024 05:20:45 EDT (-0400)
  additive transparency for image_maps? (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: stbenge
Subject: additive transparency for image_maps?
Date: 10 Dec 2007 20:44:27
Message: <475deb7b$1@news.povray.org>
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


Post a reply to this message

From: Trevor G Quayle
Subject: Re: additive transparency for image_maps?
Date: 10 Dec 2007 21:20:00
Message: <web.475df3488ad0e0382ae8612c0@news.povray.org>
stbenge <stb### [at] hotmailcom> 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

Perhaps converting the image_map to a function can help.  This is a techinique
I've used quite a bit for manipulating iamge_maps that you may be able to
modify to get what you want.  See my recent posting under "bumps, squared" in
newusers:
http://news.povray.org/povray.newusers/message/%3Cweb.475c9ab7fb428a642ae8612c0%40news.povray.org%3E/#%3Cweb.475c9ab7fb
428a642ae8612c0%40news.povray.org%3E
You can always weight the colour and/or functions to be greater than 1.

-tgq


Post a reply to this message

From: stbenge
Subject: Re: additive transparency for image_maps?
Date: 11 Dec 2007 00:03:08
Message: <475e1a0c@news.povray.org>
Trevor G Quayle wrote:
  > Perhaps converting the image_map to a function can help.  This is a 
techinique
> I've used quite a bit for manipulating iamge_maps that you may be able to
> modify to get what you want.  See my recent posting under "bumps, squared" in
> newusers:
>
http://news.povray.org/povray.newusers/message/%3Cweb.475c9ab7fb428a642ae8612c0%40news.povray.org%3E/#%3Cweb.475c9ab7fb
> 428a642ae8612c0%40news.povray.org%3E
> You can always weight the colour and/or functions to be greater than 1.

The current version of the file already uses an image_map made into a 
function. I've tried manipulating it every way I could think of, all to 
no avail. Dark auras still appear. Maybe I'll reach some sort of 
conclusion if I think about this more.

Sam


Post a reply to this message

From: Trevor G Quayle
Subject: Re: additive transparency for image_maps?
Date: 11 Dec 2007 01:30:01
Message: <web.475e2dac8ad0e0382ae8612c0@news.povray.org>
stbenge <stb### [at] hotmailcom> wrote:
> Trevor G Quayle wrote:
>   > Perhaps converting the image_map to a function can help.  This is a
> techinique
> > I've used quite a bit for manipulating iamge_maps that you may be able to
> > modify to get what you want.  See my recent posting under "bumps, squared" in
> > newusers:
> >
http://news.povray.org/povray.newusers/message/%3Cweb.475c9ab7fb428a642ae8612c0%40news.povray.org%3E/#%3Cweb.475c9a
b7fb
> > 428a642ae8612c0%40news.povray.org%3E
> > You can always weight the colour and/or functions to be greater than 1.
>
> The current version of the file already uses an image_map made into a
> function. I've tried manipulating it every way I could think of, all to
> no avail. Dark auras still appear. Maybe I'll reach some sort of
> conclusion if I think about this more.
>
> Sam

Perhaps if you posted what you have it could be of help.

By dark auras, do you mean banding where it abruptly gets darker?  Perhaps try
to make sure the function values remain between 0 and 1, just scale the pigment
values.

-tgq


Post a reply to this message

From: Christian Froeschlin
Subject: Re: additive transparency for image_maps?
Date: 11 Dec 2007 05:46:57
Message: <475e6aa1@news.povray.org>
> I wish there was an 'addition' pigment

Hmm ... you could define two pigment functions and then
an additive function. But I'm not sure if you can get a
pigment back from a vector function or if this is only
possible with scalars (using the function pattern). I
think in the worst case it should be possible using
three separate function patterns for RGB and rebuilding
the pigment using color_maps and average.

Also, you might be able to fake something by averaging your
pigments and increasing the intensity of the final texture
by tweaking the finish (increasing diffuse and ambient)
Don't know how your luminous bloom works, though ;)

Actually, wouldn't it be useful for POV to have a
pigment modifier which simply scales the intensity
of an arbitrary pigment?


Post a reply to this message

From: Christian Froeschlin
Subject: Re: additive transparency for image_maps?
Date: 11 Dec 2007 16:17:36
Message: <475efe70$1@news.povray.org>
> I think in the worst case it should be possible using three separate
> function patterns for RGB and rebuilding the pigment using color_maps
> and average.

ok, just tried it and it seems to work. The macro pigment_scale
below multiplies the color values for arbitrary (non-transparent)
pigments. Transmit/Filter would need some further effort, but
I'm inclined to think it would be possible as well.

In order to additively mix two pigments, it should be enough to
average them and then scale the result up by a factor of two.

#macro from_black(COLOR)
color_map
{
   [0 color rgb 0]
   [1 color COLOR]
}
#end

#macro pigment_scale(PIGMENT, SCALE)
#local F = function { pigment {PIGMENT} }
#local R = pigment {function {F(x,y,z).red}   from_black(3*SCALE*Red)  }
#local G = pigment {function {F(x,y,z).green} from_black(3*SCALE*Green)}
#local B = pigment {function {F(x,y,z).blue}  from_black(3*SCALE*Blue) }
pigment {average pigment_map {[R] [G] [B]} }
#end


Post a reply to this message

From: stbenge
Subject: Re: additive transparency for image_maps?
Date: 11 Dec 2007 20:23:27
Message: <475f380f@news.povray.org>
Christian Froeschlin wrote:
>> I think in the worst case it should be possible using three separate
>> function patterns for RGB and rebuilding the pigment using color_maps
>> and average.
> 
> ok, just tried it and it seems to work. The macro pigment_scale
> below multiplies the color values for arbitrary (non-transparent)
> pigments. Transmit/Filter would need some further effort, but
> I'm inclined to think it would be possible as well.
> 
> In order to additively mix two pigments, it should be enough to
> average them and then scale the result up by a factor of two.

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

Sam


Post a reply to this message

From: stbenge
Subject: Re: additive transparency for image_maps?
Date: 11 Dec 2007 20:30:54
Message: <475f39ce$1@news.povray.org>
Trevor G Quayle wrote:
> Perhaps if you posted what you have it could be of help.

You can download the current luminous bloom file from this thread:
http://news.povray.org/povray.binaries.scene-files/thread/%3C4606bd36%40news.povray.org%3E/

> By dark auras, do you mean banding where it abruptly gets darker?  Perhaps try
> to make sure the function values remain between 0 and 1, just scale the pigment
> values.

It's not that easy. Imagine you are making the bloom effect in PhotoShop 
or Gimp, but instead of making the second (bloom) layer use additive 
layering, you are simply decreasing it's opacity and nothing else. The 
light areas of the image which are next to dark ones acquire a dark halo 
which bleeds out from the shadowed area. Does this make sense? Perhaps I 
should post an example image.

When I figure out how to do what I want, I will be able to release 
version five :)

Sam


Post a reply to this message

From: Nathan Kopp
Subject: Re: additive transparency for image_maps?
Date: 12 Dec 2007 20:02:28
Message: <476084a4$1@news.povray.org>
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


Post a reply to this message

From: Alain
Subject: Re: additive transparency for image_maps?
Date: 13 Dec 2007 10:41:50
Message: <476152be$1@news.povray.org>
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.


-- 
Alain
-------------------------------------------------
WARNING: The consumption of alcohol may make you think you can logically 
converse with members of the opposite sex without spitting.


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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