POV-Ray : Newsgroups : povray.newusers : How to combine an image map, color and transparency? : Re: How to combine an image map, color and transparency? Server Time
1 May 2024 16:46:19 EDT (-0400)
  Re: How to combine an image map, color and transparency?  
From: MichaelJF
Date: 24 Nov 2014 14:15:01
Message: <web.547382ae54c41e2211dcbc4e0@news.povray.org>
"Dicko" <dic### [at] gmailcom> wrote:
> Hi all,
>
> How do I combine these three?
>
> I already found a function to combine a color and an image map:
>
> #macro pigment_multiply(p1,p2)
> #local PR1 = function {pigment{p1}}
> #local PR2 = function {pigment{p2}}
> #local PR_FRed = function (x,y,z) {PR1(x,y,z).red*PR2(x,y,z).red}
> #local PR_FGrn = function (x,y,z) {PR1(x,y,z).green*PR2(x,y,z).green}
> #local PR_FBlu = function (x,y,z) {PR1(x,y,z).blue*PR2(x,y,z).blue}
>
> average pigment_map {
>     [function{PR_FRed(x,y,z)} color_map{[0 rgb 0][1 rgb <1,0,0>*3]}]
>     [function{PR_FGrn(x,y,z)} color_map{[0 rgb 0][1 rgb <0,1,0>*3]}]
>     [function{PR_FBlu(x,y,z)} color_map{[0 rgb 0][1 rgb <0,0,1>*3]}]
> }
> #end
>
> So I use for example:
> texture {pigment {pigment_multiply(pigment {color rgb<0,1,0>}, pigment
> {image_map {jpeg "image.jpg"}})}}
>
> I tried to use a rgbf color, but that adds no transparency.
>
> How to proceed?
>
> Thanks, Dick

In fact, I have no real idea, but playing around with something like that:

average pigment_map {
    [0.3 function{PR_FRed(x,y,z)} color_map{[0 rgb 0][1 rgb <1,0,0>*3]}]
    [0.3 function{PR_FGrn(x,y,z)} color_map{[0 rgb 0][1 rgb <0,1,0>*3]}]
    [0.3 function{PR_FBlu(x,y,z)} color_map{[0 rgb 0][1 rgb <0,0,1>*3]}]
    [0.7 Clear ]
}

seems to help a Little bit.

Best regards,
Micahel


Post a reply to this message

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