POV-Ray : Newsgroups : povray.newusers : Semitransparent objects on transparent background? Server Time
29 Jul 2024 12:30:05 EDT (-0400)
  Semitransparent objects on transparent background? (Message 1 to 7 of 7)  
From: Maciej
Subject: Semitransparent objects on transparent background?
Date: 20 Sep 2005 15:05:01
Message: <web.43305d05d4ba86742c265ecd0@news.povray.org>
Hi,

I was recently playing with rendering transparent-background PNGs with
POV-Ray. I think this feature could be *very* useful for rendering icons
and images for desktop widgets. By widgets I mean not the system controls
but mini-programs running on the desktop (see e.g. http://www.kwidgets.com/
or specifically http://www.kwidgets.com/forge.aspx).

In particular I would like to render a semi-transparent object, e.g. a glass
pane with shiny edges, on a transparent background. Of course I would like
it to cast some soft shadow. Is it currently possible with POV-Ray?

I know the "shadow on transparent background" topic was discussed before,
but my feeling is it would not work with semitransparent objects. Somehow I
feel there should be a simple, complete solution for all kinds of scenes. I
would envisage putting a surface behind the scene, with a special
"background" color that would be completely transparent if not obscured by
any object and with no shadow cast on it. I can also imagine a poor man's
way of implementing it, by replacing the background with different solid
colors and seeing how the presence/absence of other objects affects the
resulting color. My question really is: is there any better way to do it in
POV using some clever surface color attributes? Has anyone tried it/posted
examples?

Thanks,

Maciej.


Post a reply to this message

From: Maciej
Subject: Re: Semitransparent objects on transparent background?
Date: 20 Sep 2005 15:35:01
Message: <web.4330637d1915705c2c265ecd0@news.povray.org>
Sorry, the second link above seems to show up wrong (although I typed it
correctly). I'll try again:
http://www.kwidgets.com/forge.aspx

Maciej.


Post a reply to this message

From: Christoph Hormann
Subject: Re: Semitransparent objects on transparent background?
Date: 20 Sep 2005 16:15:01
Message: <dgpqia$dnh$1@chho.imagico.de>
Maciej wrote:
> 
> In particular I would like to render a semi-transparent object, e.g. a glass
> pane with shiny edges, on a transparent background. Of course I would like
> it to cast some soft shadow. Is it currently possible with POV-Ray?

Of course there are limitations due to the fact that an alpha channel in 
an image file only allows to linearly mix the background color with the 
image color.  Fancy things like 'pixel appears blue if the background is 
red but red if the background is blue' are not possible but this is not 
a limit of POV-Ray.

Apart from that you can do pretty much anything you want by rendering 
multiple variants of a scene and combining the results.  I included a 
demonstration how this can be done in the KIO-POV package (icons/source 
subdir):

http://www.tu-bs.de/~y0013390/kiopov/index.html

It uses ImageMagick to assemble the images.

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.tu-bs.de/~y0013390/ (Last updated 24 Jul. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: Maciej
Subject: Re: Semitransparent objects on transparent background?
Date: 20 Sep 2005 16:55:00
Message: <web.433076641915705c2c265ecd0@news.povray.org>
Thanks! Yes, of course the only kind of transparency possible in a PNG is
based on alpha channel. I think your solution does exactly what I was
looking for. I'll get MegaPOV and play with it. Thanks again!

Any chance of such a special "background" attribute being implemented in
POV-Ray?


Post a reply to this message

From: Mike Williams
Subject: Re: Semitransparent objects on transparent background?
Date: 20 Sep 2005 16:56:43
Message: <aQRlLBAJbHMDFwEo@econym.demon.co.uk>
Wasn't it Maciej who wrote:
>
>I know the "shadow on transparent background" topic was discussed before,
>but my feeling is it would not work with semitransparent objects.

I can't think of any reason why this wouldn't work with semitransparent
objects. 

http://www.econym.demon.co.uk/shadowtut/soft.htm


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Christoph Hormann
Subject: Re: Semitransparent objects on transparent background?
Date: 20 Sep 2005 18:20:01
Message: <dgq1ov$f4p$1@chho.imagico.de>
Maciej wrote:
> Thanks! Yes, of course the only kind of transparency possible in a PNG is
> based on alpha channel. I think your solution does exactly what I was
> looking for. I'll get MegaPOV and play with it. Thanks again!

I think you misunderstood me - the technique you can find in the KIO-POV 
package has nothing to do with MegaPOV.  Only the scenes used there 
require MegaPOV for other resons.

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.tu-bs.de/~y0013390/ (Last updated 24 Jul. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: Maciej
Subject: Re: Semitransparent objects on transparent background?
Date: 23 Sep 2005 04:25:00
Message: <web.4333bb0a1915705c7b9e74320@news.povray.org>
Christoph Hormann <chr### [at] gmxde> wrote:
> I think you misunderstood me - the technique you can find in the KIO-POV
> package has nothing to do with MegaPOV.  Only the scenes used there
> require MegaPOV for other resons.
>
> Christoph

Yes, I understand that, but as a new user I needed MegaPOV to see what the
scene was about before I could learn from it.

Thanks Christoph and Mike for the replies!


Post a reply to this message

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