POV-Ray : Newsgroups : povray.newusers : having trouble with a filtered transparency... Server Time
5 Nov 2024 05:25:39 EST (-0500)
  having trouble with a filtered transparency... (Message 1 to 5 of 5)  
From: Tony
Subject: having trouble with a filtered transparency...
Date: 27 Jun 2002 23:46:43
Message: <3d1bdc23@news.povray.org>
Help!

In my current POVray work, I'm incorporating a lightning bolt - to do this
I'm using a GIF image textured onto a very thin box primitive, and using
'transmit' to filter out the various shades..the trouble is, the colours
that need to be completely transparent, just...well...aren't.

What happens is that I get my bright lightning bolt, fair enough...but the
part that needs to be completely transparent just looks a little darker.

I've tried pretty much everything to eliminate this problem, as you can see
from the snippet below:

#declare lightning1 = box {<0,0,0>, <2,-5,0.0001> texture {pigment
{image_map {gif "lightning1.gif" transmit 0, 0.1 transmit 1, 0.5 transmit
2,0.6 transmit 3,0.7 transmit 4,0.8 transmit 5,0.9 transmit 6,0.95 transmit
7,1.0 transmit 8,1.0 transmit 9,1.0 transmit 10, 1.0 transmit 11, 1.0
transmit 12, 1.0 transmit 13, 1.0  transmit 14, 1.0  transmit 15, 1.0
interpolate 4} scale 2.25 scale y*1.25}} interior {fade_power 0
fade_distance 0} finish {ambient 1.0  diffuse 0} hollow no_shadow}

Any help will be very much appreciated - this is making me lose a lot of
hair!!!!!!!

BTW - is there any way to compact/refine this particular piece of script?
Looks kind of ugly to me.

Tony S


Post a reply to this message

From: Mike Williams
Subject: Re: having trouble with a filtered transparency...
Date: 28 Jun 2002 00:30:46
Message: <VssO2CAsZ+G9Ew90@econym.demon.co.uk>
Wasn't it Tony who wrote:
>Help!
>
>In my current POVray work, I'm incorporating a lightning bolt - to do this
>I'm using a GIF image textured onto a very thin box primitive, and using
>'transmit' to filter out the various shades..the trouble is, the colours
>that need to be completely transparent, just...well...aren't.
>
>What happens is that I get my bright lightning bolt, fair enough...but the
>part that needs to be completely transparent just looks a little darker.
>
>I've tried pretty much everything to eliminate this problem, as you can see
>from the snippet below:
>
>#declare lightning1 = box {<0,0,0>, <2,-5,0.0001> texture {pigment
>{image_map {gif "lightning1.gif" transmit 0, 0.1 transmit 1, 0.5 transmit
>2,0.6 transmit 3,0.7 transmit 4,0.8 transmit 5,0.9 transmit 6,0.95 transmit
>7,1.0 transmit 8,1.0 transmit 9,1.0 transmit 10, 1.0 transmit 11, 1.0
>transmit 12, 1.0 transmit 13, 1.0  transmit 14, 1.0  transmit 15, 1.0
>interpolate 4} scale 2.25 scale y*1.25}} interior {fade_power 0
>fade_distance 0} finish {ambient 1.0  diffuse 0} hollow no_shadow}
>
>Any help will be very much appreciated - this is making me lose a lot of
>hair!!!!!!!
>
>BTW - is there any way to compact/refine this particular piece of script?
>Looks kind of ugly to me.

It would be an awful lot easier to turn your gif into a png and give it
an alpha channel. Your code would then reduce to:

#declare lightning1 = box {<0,0,0>, <2,-5,0.0001>
  texture {
    pigment {
      image_map {png "lightning1.png" interpolate 4}
      scale 2.25 scale y*1.25}
    }
    finish {ambient 1.0  diffuse 0}
  }
  no_shadow
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Tony
Subject: Re: having trouble with a filtered transparency...
Date: 29 Jun 2002 16:57:02
Message: <3d1e1f1e$1@news.povray.org>
Thanks for the help - will this also solve the transparency problem?

Tony S


Mike Williams wrote in message ...
>Wasn't it Tony who wrote:
>>Help!
>>
>>In my current POVray work, I'm incorporating a lightning bolt - to do this
>>I'm using a GIF image textured onto a very thin box primitive, and using
>>'transmit' to filter out the various shades..the trouble is, the colours
>>that need to be completely transparent, just...well...aren't.
>>
>>What happens is that I get my bright lightning bolt, fair enough...but the
>>part that needs to be completely transparent just looks a little darker.
>>
>>I've tried pretty much everything to eliminate this problem, as you can
see
>>from the snippet below:
>>
>>#declare lightning1 = box {<0,0,0>, <2,-5,0.0001> texture {pigment
>>{image_map {gif "lightning1.gif" transmit 0, 0.1 transmit 1, 0.5 transmit
>>2,0.6 transmit 3,0.7 transmit 4,0.8 transmit 5,0.9 transmit 6,0.95
transmit
>>7,1.0 transmit 8,1.0 transmit 9,1.0 transmit 10, 1.0 transmit 11, 1.0
>>transmit 12, 1.0 transmit 13, 1.0  transmit 14, 1.0  transmit 15, 1.0
>>interpolate 4} scale 2.25 scale y*1.25}} interior {fade_power 0
>>fade_distance 0} finish {ambient 1.0  diffuse 0} hollow no_shadow}
>>
>>Any help will be very much appreciated - this is making me lose a lot of
>>hair!!!!!!!
>>
>>BTW - is there any way to compact/refine this particular piece of script?
>>Looks kind of ugly to me.
>
>It would be an awful lot easier to turn your gif into a png and give it
>an alpha channel. Your code would then reduce to:
>
>#declare lightning1 = box {<0,0,0>, <2,-5,0.0001>
>  texture {
>    pigment {
>      image_map {png "lightning1.png" interpolate 4}
>      scale 2.25 scale y*1.25}
>    }
>    finish {ambient 1.0  diffuse 0}
>  }
>  no_shadow
>}
>
>--
>Mike Williams
>Gentleman of Leisure


Post a reply to this message

From: Mike Williams
Subject: Re: having trouble with a filtered transparency...
Date: 29 Jun 2002 23:53:03
Message: <OqQo3BAZCoH9Ew3t@econym.demon.co.uk>
Wasn't it Tony who wrote:

>Thanks for the help - will this also solve the transparency problem?

I've never had any problems with transparency using png alpha channels.
There's always a slight possibility that you're doing something else
weird in your scene that I've never done that's causing the effect you
observe.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Tony
Subject: Re: having trouble with a filtered transparency...
Date: 30 Jun 2002 17:59:41
Message: <3d1f7f4d@news.povray.org>
Ah well - I've re-arranged the scene to show lots of detail in the
background, and this seems to have helped - the problem is still there, but
subtler now, and one would have to look pretty closely to notice any
difference.

I'll keep the PNG file format in mind though...thanks again for your help.

Cheers

Tony

Mike Williams wrote in message ...
>Wasn't it Tony who wrote:
>
>>Thanks for the help - will this also solve the transparency problem?
>
>I've never had any problems with transparency using png alpha channels.
>There's always a slight possibility that you're doing something else
>weird in your scene that I've never done that's causing the effect you
>observe.
>
>--
>Mike Williams
>Gentleman of Leisure


Post a reply to this message

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