POV-Ray : Newsgroups : povray.general : Suggestion: alpha channel control : Suggestion: alpha channel control Server Time
14 Nov 2024 23:18:59 EST (-0500)
  Suggestion: alpha channel control  
From: Peter Popov
Date: 16 Apr 1999 07:37:39
Message: <3717f78e.7455679@news.povray.org>
Do you guys think that having a means of implicitly specifying the
alpha channel of an object base makes any sense? I am thinking along
the following lines:

[object type]
{
  object settings...
  texture setings...
  interior settings...

  alpha
  {
    [pattern [pattern modifiers]  [transparency map] ]
    [transformations]
    [channel settings]
  }
}

For example, you can have the following:

global_settings
{
  alpha_channels 2   // 0..1
}

sphere
{
  0, 1
  pigment { Red }
  alpha
  {
    channel 0
    invert
    wood
    ramp_wave
    {
       alpha_map
      {
        [0 White]
        [0.9 White]
        [1 Black]
      }
    }
  }
}

box
{
  <0.5,0,1.1>, <1.5,1,2.1>
  pigment { Blue }
  alpha
  {
    channel 1
    invert
  }
}

plane
{
  y, 0
  pigment { Green }
  alpha { transparency off }

Alpha channel 0 will look like a white circle with fuzzy edges, and
channel 1 will be white where the cube is visible (not hidden by the
sphere}. The ground plane will not affect the alpha channels at all. I
am assuming the default camera and default point light source from the
insert menu have been used.

Some clarifications of the above keywords:

In global_settings the number of alpha channels is specified. Both PNG
and TGA support multichannel.

In the alpha properties of an object all alpha related settings are
specified.

The channel keyword specifies the alpha channel for the current
object. Channels are zero-indexed.

Any pattern can be used for an object's alpha. All pattern modifiers
(turbulence, frequency and the like), warps and transformations should
be applicable to it. The colors in the alpha map or list (eg. checker,
hexagon, bricks) are either rgb->grayscale converted or only one color
component is used (eg. red, as in tga height_fields).

The transparency keyword is a "pattern" type applicable only for alpha
channel settings. It can take a float in the range [0..1]. The usage
of the transparency keyword overrides the alpha pattern.

The invert keyword indicates that higher values mean less transparency
(useful for making selections).

Well, that's basically it. Does it make sense? Is it hard to
implement? Is it worth the effort? Comments are welcome.

---------
Peter Popov
ICQ: 15002700


Post a reply to this message

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