POV-Ray : Newsgroups : povray.beta-test : Alpha channel with background color Server Time
1 Jun 2024 22:16:43 EDT (-0400)
  Alpha channel with background color (Message 16 to 25 of 25)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Cousin Ricky
Subject: Re: Alpha channel with background color
Date: 16 Feb 2012 05:45:00
Message: <web.4f3cdde33d3e0ec478641e0c0@news.povray.org>
"Cousin Ricky" <rickysttATyahooDOTcom> wrote:
> sphere
> {  0, HUGE_RADIUS
>    pigment { rgb BACKGROUND_COLOR }
>    finish { ambient 0 diffuse 0 emission 1 }
>    no_image
> }

That sphere should be declared hollow.

What happened to that warning about the camera being inside a non-hollow object?
 That could have saved me days of banging my head against the wall.


Post a reply to this message

From: clipka
Subject: Re: Alpha channel with background color
Date: 16 Feb 2012 10:33:50
Message: <4f3d21de$1@news.povray.org>
Am 16.02.2012 11:43, schrieb Cousin Ricky:
> "Cousin Ricky"<rickysttATyahooDOTcom>  wrote:
>> sphere
>> {  0, HUGE_RADIUS
>>     pigment { rgb BACKGROUND_COLOR }
>>     finish { ambient 0 diffuse 0 emission 1 }
>>     no_image
>> }
>
> That sphere should be declared hollow.
>
> What happened to that warning about the camera being inside a non-hollow object?
>   That could have saved me days of banging my head against the wall.

There's no reason to warn about such a situation. The "hollow" keyword 
only affects how the object interacts with media.

BTW, instead of a huge sphere you could just as well use a sky_sphere - 
it /should/ do exactly the same (provided you're using "#version 3.7"). 
There /is/ a difference between specifying a background and specifying a 
single-colored sky sphere.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Alpha channel with background color
Date: 17 Feb 2012 13:05:00
Message: <web.4f3e95e73d3e0ec478641e0c0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> There's no reason to warn about such a situation. The "hollow" keyword
> only affects how the object interacts with media.

That was exactly my situation.

The warning is (was) useful.


Post a reply to this message

From: Stephen
Subject: Re: Alpha channel with background color
Date: 17 Feb 2012 13:39:34
Message: <4f3e9ee6@news.povray.org>
On 17/02/2012 6:01 PM, Cousin Ricky wrote:
> The warning is (was) useful.

I agree.

-- 
Regards
     Stephen


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Alpha channel with background color
Date: 18 Feb 2012 20:07:42
Message: <4f404b5e$1@news.povray.org>
Cousin Ricky wrote:
> clipka <ano### [at] anonymousorg> wrote:
>> There's no reason to warn about such a situation. The "hollow" keyword
>> only affects how the object interacts with media.
> 
> That was exactly my situation.
> 
> The warning is (was) useful.

I think the point of clipka's comment was that the old warning
also did not test whether the media container was inside a non-hollow
object (the situation creating the problem). It only warned for the
camera position (not related to the problem, although you could get
lucky if the culprit was an enclosing room or environment object).

Of course, it does beg the question whether a warning couldn't just
be printed when some media is encountered but not rendered due to the
non-hollowness (it has to be checked somewhere to have an effect?).


Post a reply to this message

From: Subclick
Subject: Re: Alpha channel with background color
Date: 27 Apr 2013 13:22:45
Message: <1367083343.7291.39.camel@Ucalito>
On Thu, 2012-02-16 at 16:33 +0100, clipka wrote: 
> Am 16.02.2012 11:43, schrieb Cousin Ricky:
> > "Cousin Ricky"<rickysttATyahooDOTcom>  wrote:
> >> sphere
> >> {  0, HUGE_RADIUS
> >>     pigment { rgb BACKGROUND_COLOR }
> >>     finish { ambient 0 diffuse 0 emission 1 }
> >>     no_image
> >> }
> >
> > That sphere should be declared hollow.
> >
> > What happened to that warning about the camera being inside a non-hollo
w object?
> >   That could have saved me days of banging my head against the wall.
> 
> There's no reason to warn about such a situation. The "hollow" keyword
 
> only affects how the object interacts with media.
> 
> BTW, instead of a huge sphere you could just as well use a sky_sphere -
 
> it /should/ do exactly the same (provided you're using "#version 3.7").
 
> There /is/ a difference between specifying a background and specifying a
 
> single-colored sky sphere.

I don’t know if what I’ve found is a bug, but, for me, a 
“sky_sphere”
object does not work the same as a huge sphere object like that. I’
ve
rendered the test scene at the end of this message with different
parameters and got the following results.

Transp    Backgnd      UA    │   TB     SURR






false        0       false   │  false   true
false        0       true    │  false   true
false        1       false   │  false   true
false        1       true    │  false   true
false        2       false   │  false   true
false        2       true    │  false   true
true         0       false   │  false   false
true         0       true    │  true    true
true         1       false   │  false   false
true         1       true    │  true    false
true         2       false   │  false   true
true         2       true    │  true    true

“Transp” and “Backgnd” stand for the values
 of the variables with those
names in the scene. “UA” means whether alpha output was ena
bled (true,
“+ua” in the command line) or disabled (false, “-ua
”). “TB” means
whether the output picture had a transparent background, and “SURR
”,
whether the scene background showed up in reflections and radiosity,
regardless of whether it could be seen directly or not. It never
happened to be visible in reflections, but not radiosity, or vice-versa.

There are no surprises as to whether the output image has a transparent
background or not. I’m not sure, however, how reflections and radio
sity
should behave, but I think a transparent “sky_sphere” shoul
d show up in
them, at least when alpha output is enabled, the same way a flat
background does. Otherwise, there’s no way to make an environment w
hich
influences the visible objects through reflection or radiosity and still
have a transparent background, unless you resort to the huge, hollow
sphere object with “no_image”, or an even more convoluted w
orkaround. If


avoid such a need.

My POV-Ray version is 3.7.0.RC7 for Unix, compiled from source.


/////////////////////// TEST SCENE ///////////////////////

#version 3.7;

// +w400 +h300 +ua

//-------------------- OPTIONS --------------------

#declare Transp = true; // Transparent background

#declare Backgnd = 0; // Background type:
                      // 0 = flat background;
                      // 1 = sky_sphere;
                      // 2 = sphere object

#declare Refl = true; // Mirror-like object to test
               // reflection, instead of diffusing
               // object to test radiosity

#declare Rad = false; // Enable radiosity


//--------------------- SCENE ---------------------

global_settings{
    assumed_gamma 1
    max_trace_level 25
    #if(Rad)
        radiosity{
            count 300 error_bound .2 normal on
            recursion_limit 5
        }
    #end
}

camera{
  location <-.15,.2,-.6>
  right .2*x
  up .15*y
  direction .6*z
  look_at 0
}

#switch(Backgnd)
    #case(0)
        background{rgbt <0, 1, 0, Transp>}
        #break
    #case(1)
        sky_sphere{
            pigment{
                gradient y color_map{
                    [0 rgbt <1, 0, 0, Transp>]
                    [1 rgbt <0, 1, 1, Transp>]
                }
                scale 2 translate -y
            }
        }
        #break
    #case(2)
        sphere{0, 1 hollow no_shadow
            #if(Transp)
                no_image
            #end
            pigment{
                gradient y color_map{
                    [0 rgb <1, 0, 0>]
                    [1 rgb <0, 1, 1>]
                }
                scale 2 translate -y
            }
            finish{diffuse 0 emission 1} scale 1e6
        }
        #break
#end

union{
    sphere{0, .05}
    box{<0, -.05, -.05>, <.05, .05, .05>}
    pigment{rgb 1}
    normal{dents scale .02}
    finish{
        #if(Refl)
            diffuse .2
            reflection{.6}
        #end
    }
}


Post a reply to this message

From: clipka
Subject: Re: Alpha channel with background color
Date: 27 Apr 2013 17:59:40
Message: <517c4a4c@news.povray.org>
Am 27.04.2013 19:22, schrieb Subclick:

>> BTW, instead of a huge sphere you could just as well use a sky_sphere -
>> it /should/ do exactly the same (provided you're using "#version 3.7").
>> There /is/ a difference between specifying a background and specifying a
>> single-colored sky sphere.
>
> I don’t know if what I’ve found is a bug, but, for me, a “sky_sphere”
> object does not work the same as a huge sphere object like that. I’ve
> rendered the test scene at the end of this message with different
> parameters and got the following results.

As the aim was for the 3.7 version to get a consistent behaviour 
regardless of whether you use a sky_sphere or a huge regular sphere, any 
inconsistency between the two must be considered a bug.

Can you please file your findings in a bug report at bugs.povray.org? 
Thanks a lot.


Post a reply to this message

From: clipka
Subject: Re: Alpha channel with background color
Date: 27 Apr 2013 18:06:17
Message: <517c4bd9@news.povray.org>
Am 27.04.2013 23:59, schrieb clipka:
> Am 27.04.2013 19:22, schrieb Subclick:
>
>>> BTW, instead of a huge sphere you could just as well use a sky_sphere -
>>> it /should/ do exactly the same (provided you're using "#version 3.7").
>>> There /is/ a difference between specifying a background and specifying a
>>> single-colored sky sphere.
>>
>> I don’t know if what I’ve found is a bug, but, for me, a “sky_sphere”
>> object does not work the same as a huge sphere object like that. I’ve
>> rendered the test scene at the end of this message with different
>> parameters and got the following results.
>
> As the aim was for the 3.7 version to get a consistent behaviour
> regardless of whether you use a sky_sphere or a huge regular sphere, any
> inconsistency between the two must be considered a bug.
>
> Can you please file your findings in a bug report at bugs.povray.org?
> Thanks a lot.

Then again, please don't - I just noticed that you're using a different 
pigment for the regular sphere, which causes the inconsistencies.


Post a reply to this message

From: Subclick
Subject: Re: Alpha channel with background color
Date: 28 Apr 2013 01:42:42
Message: <1367127723.2090.33.camel@Ucalito>
Their only difference is transparency.

In earlier versions of POV-Ray, it was possible to have a background
pigment showing up in reflections and radiosity but not directly
visible, so the output image would have a transparent background, simply
by using a “sky_sphere” and enabling alpha output. This isn
’t possible
now, because you don’t get a transparent background in the output f
ile
unless the “sky_sphere” is transparent, and this in turn re
moves its
effects altogether, including reflections and radiosity.

This behavior does match that of a very large sphere object, but it
departs from that of the “background” feature: the latter d
oes produce
reflections and radiosity when it’s transparent and alpha output is
enabled. Therefore, now, in order to cast environmental light onto the
subject matter, from a non-uniform pattern, a workaround is needed, such
as using an opaque sphere object with “no_image”—if
 it were transparent,
it’d have no effect, just like the “sky_sphere”.

A “sky_sphere” used to be basically a “background
” with a whole pigment,
or a layered stack of them, rather than a solid color. This version has
introduced a significant difference, as a transparent “background
”
generates reflections and radiosity when alpha output is enabled, while
a transparent “sky_sphere” does not. I think this makes a t
ransparent
“sky_sphere” essentially useless. I don’t know if t
his can be fixed
somehow, but perhaps the simplest and more versatile way would be to add
something like the “no_image” switch to the “sky_sp
here” feature. It’d
eliminate the need for a regular sphere.


Post a reply to this message

From: clipka
Subject: Re: Alpha channel with background color
Date: 28 Apr 2013 03:02:13
Message: <517cc975$1@news.povray.org>
Am 28.04.2013 07:42, schrieb Subclick:
> Their only difference is transparency.
>
> In earlier versions of POV-Ray, it was possible to have a background
> pigment showing up in reflections and radiosity but not directly
> visible, so the output image would have a transparent background, simply
> by using a “sky_sphere” and enabling alpha output. This isn’t possible
> now, because you don’t get a transparent background in the output file
> unless the “sky_sphere” is transparent, and this in turn removes its
> effects altogether, including reflections and radiosity.

Note that this is a "damned if you do, damned if you don't" situation: 
In earlier versions, it was impossible to have a partially transparent 
background that shows up both in reflections (with transparent areas 
filled in by the background) /and/ in the image itself (with transparent 
areas being... well, transparent); think of clouds for instance.

As you already noted, the obvious solution to this is not to go for one 
option or the other, but add the same flexibility that already exists 
for huge spheres.

There's even more benefit to such a solution than just having a 
patterned background to be reflected but not seen: Adding the full set 
of "no_image", "no_reflection" and "no_radiosity" keywords (with 
"no_shadow" being the obvious exception), it would also be possible to 
have a high-detail sky_sphere for reflections, while using a highly 
blurred one for radiosity to avoid blotches from a single small bright 
spot on the sky_sphere such as the sun.

This (or an alternative syntax providing similar flexibility) is 
actually on my to-do list already, but hasn't made it into 3.7 yet due 
to feature-freeze.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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