POV-Ray : Newsgroups : povray.unofficial.patches : Transmit -> File alpha bug im MP0.7 Server Time
8 Jul 2024 17:05:56 EDT (-0400)
  Transmit -> File alpha bug im MP0.7 (Message 1 to 7 of 7)  
From: PoD
Subject: Transmit -> File alpha bug im MP0.7
Date: 8 Jun 2001 22:40:27
Message: <3B218C97.A806BB57@internode.on.net>
The alpha channel for pixels corresponding to an object with transmit !=
0 is set to fully opaque regardless of the actual transmit value.

I've tracked this down to compute_lighted_texture() in lighting.c
but I'm having trouble following why a lot of the changes were made.

line 4711 says
ResCol[TRANSM] = (0.30*AttCol[0] + 0.59*AttCol[1] + 0.11*AttCol[2]) *
FilCol[TRANSM];
but FilCol[TRANSM] is never changed from 0.0 as far as I can see.

There's a comment at line 4617
/* note FilCol[3] stays at 1.0, [4] stays at 0.0 */
Why is that?

Thanks for your time. And thanks for MegaPOV.


Post a reply to this message

From: PoD
Subject: Re: Transmit -> File alpha bug im MP0.7
Date: 8 Jun 2001 22:53:46
Message: <3B218FB6.DB43D627@internode.on.net>
Oops, just found the message from Mael Wed, 14 Mar 2001
Might have to wade back in and try to solve this :^0


Post a reply to this message

From: Nathan Kopp
Subject: Re: Transmit -> File alpha bug im MP0.7
Date: 9 Jun 2001 22:25:05
Message: <3b22da81$1@news.povray.org>
"PoD" <pod### [at] internodeonnet> wrote...
> The alpha channel for pixels corresponding to an object with transmit !=
> 0 is set to fully opaque regardless of the actual transmit value.
>
> I've tracked this down to compute_lighted_texture() in lighting.c
> but I'm having trouble following why a lot of the changes were made.
>
> line 4711 says
> ResCol[TRANSM] = (0.30*AttCol[0] + 0.59*AttCol[1] + 0.11*AttCol[2]) *
> FilCol[TRANSM];
> but FilCol[TRANSM] is never changed from 0.0 as far as I can see.
>
> There's a comment at line 4617
> /* note FilCol[3] stays at 1.0, [4] stays at 0.0 */
> Why is that?

For the purposes of FilCol, anything that can be represented with the
Transmit channel can be represented using the filter channel with an
appropriate color.

Examples:
<0,0,0,0,1> can be represented as <1,1,1,1,0>
<0,0,0,0,.5> can be represened either as <.5,.5,.5,1,0>
<.5,0,0,.5,.5> can be represented as <1,.5,.5,1,0>
etc.

Actually, in future versions (far in the future) of POV, I think that we use
6-channel (actually 2*3 channel) colors: <r,g,b,rf,gf,bf>.  In lighting.cpp,
ResCol represents <r,g,b> and FilCol represents <rf,gf,bf>.  This allows
much more control of what gets transmitted and what gets diffused.  Of
course, this would cause backwards-compatibility problems...

-Nathan


Post a reply to this message

From: Nathan Kopp
Subject: Re: Transmit -> File alpha bug im MP0.7
Date: 10 Jun 2001 13:02:00
Message: <3b23a808$1@news.povray.org>
"Nathan Kopp" <nat### [at] koppcom> wrote ...
> Actually, in future versions (far in the future) of POV, I think that we
use
> 6-channel (actually 2*3 channel) colors: <r,g,b,rf,gf,bf>.

I meant to say "I think that we SHOULD use 6-channel..."

-Nathan


Post a reply to this message

From: Ken
Subject: Re: Transmit -> File alpha bug im MP0.7
Date: 10 Jun 2001 14:11:06
Message: <3B23B7BF.2F9F9556@pacbell.net>
Nathan Kopp wrote:
> 
> "Nathan Kopp" <nat### [at] koppcom> wrote ...
> > Actually, in future versions (far in the future) of POV, I think that we
> use
> > 6-channel (actually 2*3 channel) colors: <r,g,b,rf,gf,bf>.
> 
> I meant to say "I think that we SHOULD use 6-channel..."

Either way it's a great idea.

-- 
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: PoD
Subject: Re: Transmit -> File alpha bug im MP0.7
Date: 10 Jun 2001 21:05:20
Message: <3B24194C.9A46192C@internode.on.net>
Nathan Kopp wrote:
> 
> "PoD" <pod### [at] internodeonnet> wrote...
> > The alpha channel for pixels corresponding to an object with transmit !=
> > 0 is set to fully opaque regardless of the actual transmit value.
> >
> > I've tracked this down to compute_lighted_texture() in lighting.c
> > but I'm having trouble following why a lot of the changes were made.
> >
> > line 4711 says
> > ResCol[TRANSM] = (0.30*AttCol[0] + 0.59*AttCol[1] + 0.11*AttCol[2]) *
> > FilCol[TRANSM];
> > but FilCol[TRANSM] is never changed from 0.0 as far as I can see.
> >
> > There's a comment at line 4617
> > /* note FilCol[3] stays at 1.0, [4] stays at 0.0 */
> > Why is that?
> 
> For the purposes of FilCol, anything that can be represented with the
> Transmit channel can be represented using the filter channel with an
> appropriate color.
> 
> Examples:
> <0,0,0,0,1> can be represented as <1,1,1,1,0>
> <0,0,0,0,.5> can be represened either as <.5,.5,.5,1,0>
> <.5,0,0,.5,.5> can be represented as <1,.5,.5,1,0>
> etc.
> 

OK. The problem is that the output alpha channel contains exactly what
is put into the tranmit part of FilCol at the start of
compute_lighted_texture.
To test this I made FilCol = [1.0,1.0,1.0,1.0,0.5] and then the output
alpha for any ray is 128.

-- 
PoD.


Post a reply to this message

From: Nathan Kopp
Subject: Re: Transmit -> File alpha bug im MP0.7
Date: 10 Jun 2001 23:40:48
Message: <3b243dc0$1@news.povray.org>
"PoD" <pod### [at] internodeonnet> wrote...
>
> OK. The problem is that the output alpha channel contains exactly what
> is put into the tranmit part of FilCol at the start of
> compute_lighted_texture.
> To test this I made FilCol = [1.0,1.0,1.0,1.0,0.5] and then the output
> alpha for any ray is 128.

True.  There are some other problems with the alpha channel in MegaPov (and
also in POV 3.1).  These will be fixed for POV 3.5.  Basically, the line of
code that sets ResCol[TRANSM] should be moved into the preceeding
if(one_colour_found) block, and should use RfrCol[TRANSM] and Trans instead
of FilCol[TRANSM].

-Nathan


Post a reply to this message

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