POV-Ray : Newsgroups : povray.general : Adding two images via functions...? : Re: Adding two images via functions...? Server Time
5 Nov 2024 05:22:07 EST (-0500)
  Re: Adding two images via functions...?  
From: John VanSickle
Date: 17 Jun 2003 16:46:16
Message: <3EEF7E13.F4C7D223@hotmail.com>
Tim Nikias v2.0 wrote:
> 
> What I'm trying to do is following:
> I've got two images, one in grayscale,
> the other just some image. I want to
> add the grayscale to the other image, so
> that white areas of the grayscale are white
> in the combination, and black won't change
> the colored image.
> 
> There has got to be some way to do this
> and to use that function as a pattern (along
> with colors and all), so that I may map the
> resulting function using uv-mapping onto
> two triangles which cover exactly the camera's
> field of view.
> 
> Thus I want to create a method of combining
> specularity-image (made by my latest macros)
> with an image (which has no specularity components),
> and still do it all in POV.
> 
> Any hints, code-snippets, links?

// the grayscale
#local pigM=pigment { image_map { png "mymask.png" } }

// the overlaid picture
#local pigP=pigment { image_map { png "mypic.png" } }

// this combines them
pigment { pigment_pattern { pigM }
  pigment_map {
    [0 pigP]
    [1 pigM]
  }
}

Hope this helps,
John


Post a reply to this message

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