POV-Ray : Newsgroups : povray.newusers : How to combine an image map, color and transparency? : How to combine an image map, color and transparency? Server Time
1 May 2024 14:17:46 EDT (-0400)
  How to combine an image map, color and transparency?  
From: Dicko
Date: 24 Nov 2014 11:10:00
Message: <web.547357465d472a0ecb72b3c0@news.povray.org>
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


Post a reply to this message

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