POV-Ray : Newsgroups : povray.general : Color add Server Time
17 Nov 2024 21:19:39 EST (-0500)
  Color add (Message 1 to 10 of 19)  
Goto Latest 10 Messages Next 9 Messages >>>
From: Rafal 'Raf256' Maj
Subject: Color add
Date: 3 Jan 2003 16:23:31
Message: <Xns92F8E38A5EB08raf256com@204.213.191.226>
How can I make a texture with pigment of following components :
  red = function { FA(x,y,z) }
green = function { FB(x,y,z) }
 blue = function { FC(x,y,z) }
?

The problem is, IMHO that there is no ADDITIVE filter in color.
I tryed to use 3 texture layers but I don't know how to define colormaps ?

texture { pigment{function{..}} color_map{[0 rgb 0][1 rgb <1,0,0>]} }
texture { pigment{function{..}} color_map{[0 rgb 0][1 rgb <0,1,0>]} }
texture { pigment{function{..}} color_map{[0 rgb 0][1 rgb <0,0,1>]} }

using filter and/or transmit didn't work as I expected. How set them to get 
result :
if i.e. texture A pigment    = <1.0 ,0.5, 0.0>
    and texture B pigment    = <0.1 ,0.1, 0.7>
then final pigment for point = <1.1, 0.6, 0.7>


-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Christopher James Huff
Subject: Re: Color add
Date: 3 Jan 2003 16:33:15
Message: <cjameshuff-018002.16291203012003@netplex.aussie.org>
In article <Xns### [at] 204213191226>,
 "Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote:

> How can I make a texture with pigment of following components :
>   red = function { FA(x,y,z) }
> green = function { FB(x,y,z) }
>  blue = function { FC(x,y,z) }
> ?
> 
> The problem is, IMHO that there is no ADDITIVE filter in color.
> I tryed to use 3 texture layers but I don't know how to define colormaps ?

texture {average
    texture_map {
        [1 pigment{function{..} color_map{[0 rgb 0][1 rgb < 3, 0, 0>]}}
        [1 pigment{function{..} color_map{[0 rgb 0][1 rgb < 0, 3, 0>]}}
        [1 pigment{function{..} color_map{[0 rgb 0][1 rgb < 0, 0, 3>]}}
    }
}

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Marc-Hendrik Bremer
Subject: Re: Color add
Date: 3 Jan 2003 16:36:55
Message: <3e160277@news.povray.org>
"Rafal 'Raf256' Maj" <raf### [at] raf256com> schrieb im Newsbeitrag
news:Xns### [at] 204213191226...
> How can I make a texture with pigment of following components :
>   red = function { FA(x,y,z) }
> green = function { FB(x,y,z) }
>  blue = function { FC(x,y,z) }
> ?
You try to use keywords as functionnames here that won't work IMO. You
should always use a capital letter to avoid that.

Does
#declare Red= function { FA(x,y,z) }
#declare Green = function { FB(x,y,z) }
#declare  Blue = function { FC(x,y,z)

...

 pigment{ rgb <Red, Green, Blue>}

not work? Or do I miss something obvious?

Marc-Hendrik


Post a reply to this message

From: Christoph Hormann
Subject: Re: Color add
Date: 3 Jan 2003 16:45:02
Message: <3E16045E.23919376@gmx.de>
Christopher James Huff wrote:
> 
> texture {average
>     texture_map {
>         [1 pigment{function{..} color_map{[0 rgb 0][1 rgb < 3, 0, 0>]}}
>         [1 pigment{function{..} color_map{[0 rgb 0][1 rgb < 0, 3, 0>]}}
>         [1 pigment{function{..} color_map{[0 rgb 0][1 rgb < 0, 0, 3>]}}
>     }
> }

That definitely won't work.  Better:

texture {average
  texture_map {
    [1 pigment{function{..} color_map{[0 rgb 0][1 rgb < 3, 0, 0>]}} ]
    [1 pigment{function{..} color_map{[0 rgb 0][1 rgb < 0, 3, 0>]}} ]
    [1 pigment{function{..} color_map{[0 rgb 0][1 rgb < 0, 0, 3>]}} ]
  }
}

Even better:

texture {
  pigment {
    average
    pigment_map {
      [1 function{..} color_map{[0 rgb 0][1 rgb < 3, 0, 0>]} ]
      [1 function{..} color_map{[0 rgb 0][1 rgb < 0, 3, 0>]} ]
      [1 function{..} color_map{[0 rgb 0][1 rgb < 0, 0, 3>]} ]
    }
  }
}

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 31 Dec. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: Color add
Date: 3 Jan 2003 17:08:58
Message: <Xns92F8EB3F9F6F2raf256com@204.213.191.226>
"Marc-Hendrik Bremer" <Mar### [at] t-onlinede> wrote in 
news:3e160277@news.povray.org

> Does
> #declare Red= function { FA(x,y,z) }
> #declare Green = function { FB(x,y,z) }
> #declare  Blue = function { FC(x,y,z)
>  pigment{ rgb <Red, Green, Blue>}
> not work? Or do I miss something obvious?

I don't want 
pigment { rgb ... }
  but 
pigment { function { .... } color_map ...


-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Marc-Hendrik Bremer
Subject: Re: Color add
Date: 3 Jan 2003 17:27:46
Message: <3e160e62@news.povray.org>
"Rafal 'Raf256' Maj" <raf### [at] raf256com> schrieb im Newsbeitrag
news:Xns### [at] 204213191226...
> "Marc-Hendrik Bremer" <Mar### [at] t-onlinede> wrote in
> news:3e160277@news.povray.org
>
> > Does
> > #declare Red= function { FA(x,y,z) }
> > #declare Green = function { FB(x,y,z) }
> > #declare  Blue = function { FC(x,y,z)
> >  pigment{ rgb <Red, Green, Blue>}
> > not work? Or do I miss something obvious?
>
> I don't want
> pigment { rgb ... }
>   but
> pigment { function { .... } color_map ...


It doesn't work anyway. It's been a while since my last serious poving -
forgot a lot allready.

Regards,

Marc-Hendrik


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: Color add
Date: 3 Jan 2003 17:34:16
Message: <Xns92F8EF8995540raf256com@204.213.191.226>
Christoph Hormann <chr### [at] gmxde> wrote in 
news:3E16045E.23919376@gmx.de

[...]

Thanks :)

Another colors question:
I have i.e. sphere rgb <1,0,0> behind a box rgb <0,1,0> and all this behind 
a wall rgb .3

Now I want color of pixel, that is on render output "inside" all 3 shapes 
(inside there projection on view port exacly) to have color :

<1,0,0> + <0,1,0> + .3 = <1.3,1.3,0.3>

so - box and wall will act just like "particle", in OGL it would be 
"additive-alpha" afair


-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Slime
Subject: Re: Color add
Date: 3 Jan 2003 19:20:44
Message: <3e1628dc@news.povray.org>
POV-Ray doesn't have an additive alpha feature. All it has for alpha is
transparency and filtering. Additive effects can, however, be created with
emission media.

Nonetheless, I think an additive-alpha feature would be a good thing for a
patch...

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: Color add
Date: 3 Jan 2003 19:33:20
Message: <Xns92F9F95DAD19raf256com@204.213.191.226>
"Slime" <slm### [at] slimelandcom> wrote in news:3e1628dc@news.povray.org

> POV-Ray doesn't have an additive alpha feature. All it has for alpha
> is transparency and filtering. Additive effects can, however, be
> created with emission media.

> Nonetheless, I think an additive-alpha feature would be a good thing
> for a patch...

I agree, and it's very easy to implement imho.



-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Warp
Subject: Re: Color add
Date: 3 Jan 2003 20:24:02
Message: <3e1637b2@news.povray.org>
Slime <slm### [at] slimelandcom> wrote:
> Nonetheless, I think an additive-alpha feature would be a good thing for a
> patch...

  IMHO it should be more generic than just a specific "additive-alpha"
filter. This way you could get many other type of filters for free.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

Goto Latest 10 Messages Next 9 Messages >>>

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