POV-Ray : Newsgroups : povray.newusers : Use image_map for object transparency only? Server Time
25 Nov 2024 13:48:28 EST (-0500)
  Use image_map for object transparency only? (Message 1 to 2 of 2)  
From: zachrahan
Subject: Use image_map for object transparency only?
Date: 12 Sep 2005 01:40:00
Message: <web.432512e5370c1e9c1e6432b90@news.povray.org>
Hello,

I'm trying to figure out a good way to use an image to specify only the
transparency of an object while still being able to specify the rest of the
texture directly in povray.

Specifically, I've got a set of complex shape outlines represented as
grayscale alpha masks. I'd like to apply the mask to a square polygon
object so that the object is fully opaque in the black (or white) regions,
fully transparent in the white (or black) regions, and of intermediate
opacity in the intermediate grays. Where the polygon is (partially) opaque,
I'd like to paint a procedural texture to it.

The eventual effect will be something like a stained-glass window with the
shapes created in an external paint program.

I can see how to use a texture map to use the mask to blend between a given
texture an a fully-transparent texture. However, is there a faster/better
way to do this just using image maps and/or layered textures?

Thanks,

Zach Pincus


Post a reply to this message

From: zachrahan
Subject: Re: Use image_map for object transparency only?
Date: 13 Sep 2005 03:00:01
Message: <web.43267884f72e9dca1e6432b90@news.povray.org>
[Replying to my own question for future reference of others.]

On close inspection of the documentation, it seems that image_pattern is the
best way to use a grayscale image as an opacity map:

texture {
  image_pattern { png "image.png" }
  texture_map {
    [0  texture { pigment {transmit 1 } }  ]
    [1 OtherTexture  ]
  }
}

Or for simple colors:

pigment {
  image_pattern { png "image.png" }
  pigment_map {
    [0  transmit 1  ]
    [1 OtherPigment  ]
  }
}


Post a reply to this message

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