POV-Ray : Newsgroups : povray.general : At-render texture blending : Re: At-render texture blending Server Time
30 Jul 2024 08:19:04 EDT (-0400)
  Re: At-render texture blending  
From: Reactor
Date: 29 Nov 2009 16:20:01
Message: <web.4b12e525dd0a65f9ffc2ddb80@news.povray.org>
"Siber" <nomail@nomail> wrote:

> I had originally exported them simply as black and white images, white
> representing where the color should be added. I have since put the information
> in the alpha channel as well, in an attempt to get layering to work, but haven't
> been successful in that yet.




It sounds like you should be able to use the image_map as a pigment function,
then make the color_map match the colors you want.  I believe someone above
mentioned this, so here is some sample code:

//--------------
#declare ImageMap = function{
    pigment{
        image_map{
            "test.png"
            map_type 0
            interpolate 2
        }
    }
}


box{
    0, 1
    pigment{
        function{ ImageMap(x,y,z).gray }
        color_map{
        // color of the black areas of the image
        [0.00 color rgb <0.5,0.5,0.5> ]
        // color of the white areas of the image
        [1.00 color rgb <1.0,0.0,0.0> ]
            }
    }
}

//--------------

The image "test.png" is a grayscale png, and the color_map determines what the
actual colors will be.  You could use this in a layered pigment, and set some of
the colors to be transparent.  Alternatively, you could use this in a
pigment_map, and specify different pigments to be associated with the grayscale
range of the input image.

    HTH
 -Reactor


Post a reply to this message

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