POV-Ray : Newsgroups : povray.advanced-users : additive transparency for image_maps? : Re: additive transparency for image_maps? Server Time
5 Jul 2024 14:18:16 EDT (-0400)
  Re: additive transparency for image_maps?  
From: Christian Froeschlin
Date: 11 Dec 2007 16:17:36
Message: <475efe70$1@news.povray.org>
> I think in the worst case it should be possible using three separate
> function patterns for RGB and rebuilding the pigment using color_maps
> and average.

ok, just tried it and it seems to work. The macro pigment_scale
below multiplies the color values for arbitrary (non-transparent)
pigments. Transmit/Filter would need some further effort, but
I'm inclined to think it would be possible as well.

In order to additively mix two pigments, it should be enough to
average them and then scale the result up by a factor of two.

#macro from_black(COLOR)
color_map
{
   [0 color rgb 0]
   [1 color COLOR]
}
#end

#macro pigment_scale(PIGMENT, SCALE)
#local F = function { pigment {PIGMENT} }
#local R = pigment {function {F(x,y,z).red}   from_black(3*SCALE*Red)  }
#local G = pigment {function {F(x,y,z).green} from_black(3*SCALE*Green)}
#local B = pigment {function {F(x,y,z).blue}  from_black(3*SCALE*Blue) }
pigment {average pigment_map {[R] [G] [B]} }
#end


Post a reply to this message

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