POV-Ray : Newsgroups : povray.general : Color help... Server Time
15 Oct 2026 17:39:42 EDT (-0400)
  Color help... (Message 1 to 22 of 22)  
From: Ben Chambers
Subject: Color help...
Date: 14 Jul 2001 21:31:16
Message: <3b50f264@news.povray.org>
Does anyone know how I can make a texture vary depending on the
angle from which it is viewed?  I've thought about using a radial, but that
isn't quite what I want...  As in, the angle of incidence between the
intersecting ray and the surface normal would act as a sort of index
into a pigment map.

...Chambers


Post a reply to this message

From: Warp
Subject: Re: Color help...
Date: 14 Jul 2001 21:35:53
Message: <3b50f379@news.povray.org>
Ben Chambers <bdc### [at] hotmailcom> wrote:
: Does anyone know how I can make a texture vary depending on the
: angle from which it is viewed?  I've thought about using a radial, but that
: isn't quite what I want...  As in, the angle of incidence between the
: intersecting ray and the surface normal would act as a sort of index
: into a pigment map.

  AFAIK patterns do not get info about the incoming ray nor the normal
vector, so they can't produce a pattern depending on them. Not even a function
pattern can do this.

  I don't know how the shaders of the povman patch work, but that might be
one solution.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: jim charter
Subject: Re: Color help...
Date: 15 Jul 2001 01:19:31
Message: <3B5152F4.5ACF52FA@aol.com>
Perhaps if you built your own mesh to describe the surface you could apply a
color calculation to individual triangles.

Ben Chambers wrote:

> Does anyone know how I can make a texture vary depending on the
> angle from which it is viewed?  I've thought about using a radial, but that
> isn't quite what I want...  As in, the angle of incidence between the
> intersecting ray and the surface normal would act as a sort of index
> into a pigment map.
>
> ...Chambers


Post a reply to this message

From: Mark Wagner
Subject: Re: Color help...
Date: 15 Jul 2001 01:33:27
Message: <3b512b27$1@news.povray.org>
Ben Chambers wrote in message <3b50f264@news.povray.org>...
>Does anyone know how I can make a texture vary depending on the
>angle from which it is viewed

Sounds like what you want is anisotropic shading.  Check out RenderMan
shaders and the POV-MAN unofficial version of POV-Ray.

--
Mark


Post a reply to this message

From: Ben Chambers
Subject: Re: Color help...
Date: 15 Jul 2001 13:14:34
Message: <3b51cf7a@news.povray.org>
Unfortunately, then the colors would be fixed.  What I want is similar to
those cars that change color based on the angle from which you view them.
Its not a real high priority for me right now, so I'm not too sure I want to
try out POV-Man for it yet, but when I _do_ really need it now I know
where to go.

...Chambers

jim charter <jrc### [at] aolcom> wrote in message
news:3B5152F4.5ACF52FA@aol.com...
> Perhaps if you built your own mesh to describe the surface you could apply
a
> color calculation to individual triangles.
>
> Ben Chambers wrote:
>
> > Does anyone know how I can make a texture vary depending on the
> > angle from which it is viewed?  I've thought about using a radial, but
that
> > isn't quite what I want...  As in, the angle of incidence between the
> > intersecting ray and the surface normal would act as a sort of index
> > into a pigment map.
> >
> > ...Chambers
>


Post a reply to this message

From: John VanSickle
Subject: Re: Color help...
Date: 15 Jul 2001 16:29:07
Message: <3B51FEDE.2FFD6732@erols.com>
Ben Chambers wrote:
> 
> jim charter wrote:
>
> > Ben Chambers wrote:
> >
> > > Does anyone know how I can make a texture vary depending on the
> > > angle from which it is viewed?  I've thought about using a radial,
> > > but that isn't quite what I want...  As in, the angle of incidence
> > > between the intersecting ray and the surface normal would act as a
> > > sort of index into a pigment map.
> >
> > Perhaps if you built your own mesh to describe the surface you could
> > apply a color calculation to individual triangles.
>
> Unfortunately, then the colors would be fixed.  What I want is similar
> to those cars that change color based on the angle from which you view
> them. Its not a real high priority for me right now, so I'm not too
> sure I want to try out POV-Man for it yet, but when I _do_ really need
> it now I know where to go.

If the colors were calculated based on the current camera settings,
and the .INC file called only after the camera settings were made,
then it should be no difficulty animating it.

Regards,
John
--
ICQ: 46085459


Post a reply to this message

From: Ben Chambers
Subject: Re: Color help...
Date: 16 Jul 2001 02:34:36
Message: <3b528afc@news.povray.org>
But what if it showed up in a reflection or a refraction?  Then the
rays wouldn't even be coming from the camera.  Of course, you
could work around this (avoid reflections and refractions, or render
the image in two portions with and without the reflection, and other
such tricks) but it would be easier to give the texture information on
the angle of incidence (is that the correct term?).

...Chambers

John VanSickle <van### [at] erolscom> wrote in message
news:3B51FEDE.2FFD6732@erols.com...
> If the colors were calculated based on the current camera settings,
> and the .INC file called only after the camera settings were made,
> then it should be no difficulty animating it.
>
> Regards,
> John


Post a reply to this message

From: Michael Andrews
Subject: Re: Color help...
Date: 16 Jul 2001 09:01:33
Message: <3B52E6F8.4D86963@reading.ac.uk>
The way I'd have done it with a POVMan shader would be something like

#declare incoming = pigment {
  shader{
    shader_file "incoming.slp"
    "falloff" 5
    shadow_type shader_shadow
  }
}

sphere { 0,5
  pigment {
    pigment_pattern { incoming }
    pigment_map {
      [0.5 granite colour_map {[0 rgb x][1 rgb y]} ]
      [0.5 bozo colour_map {[0 rgb z][1 rgb 1]} ]
    }
  }
  finish { ambient 1 diffuse 0 specular 0 metallic }
}

where the shader just returns the dot product between I (the incoming
ray) and N (the surface normal).

Unfortunately, POVMan seems to count the pigment_pattern interior as a
non-object pigment definition so neither I nor N are defined. I'm having
to assume this from the fact that it does not work; usually it warns you
about an incomplete initialization (when a shader is used in a warp, for
instance) but in this case the pigment_pattern simply returns a value of
1 without any warnings.

If anyone can see another way of doing it I would also like to know ...

Bye for now,
	Mike Andrews.


Ben Chambers wrote:
> 
> But what if it showed up in a reflection or a refraction?  Then the
> rays wouldn't even be coming from the camera.  Of course, you
> could work around this (avoid reflections and refractions, or render
> the image in two portions with and without the reflection, and other
> such tricks) but it would be easier to give the texture information on
> the angle of incidence (is that the correct term?).
> 
> ...Chambers
> 
> John VanSickle <van### [at] erolscom> wrote in message
> news:3B51FEDE.2FFD6732@erols.com...
> > If the colors were calculated based on the current camera settings,
> > and the .INC file called only after the camera settings were made,
> > then it should be no difficulty animating it.
> >
> > Regards,
> > John


Post a reply to this message

From: Bob H 
Subject: Re: Color help...
Date: 16 Jul 2001 09:46:30
Message: <3b52f036@news.povray.org>
"Michael Andrews" <M.C### [at] readingacuk> wrote in message
news:3B5### [at] readingacuk...
>
> If anyone can see another way of doing it I would also like to know ...

What I just thought of was to use the MegaPOV angle dependent reflection in
a two layered texture, trick being to use opposing min and max color
vectors.  Maybe that has already been mentioned, if so I didn't notice.

Bob H.


Post a reply to this message

From: Bob H 
Subject: Re: Color help...
Date: 16 Jul 2001 10:08:36
Message: <3b52f564@news.povray.org>
"Bob H." <omn### [at] msncom> wrote in message
news:3b52f036@news.povray.org...
> "Michael Andrews" <M.C### [at] readingacuk> wrote in message
> news:3B5### [at] readingacuk...
> >
> > If anyone can see another way of doing it I would also like to know ...
>
> What I just thought of was to use the MegaPOV angle dependent reflection
in
> a two layered texture, trick being to use opposing min and max color
> vectors.  Maybe that has already been mentioned, if so I didn't notice.

Okay, maybe that wasn't relating to the previous message reply so much but I
just gave it a try to see how it would look.  It's close to that kind of car
paint, since cars do reflect it's about all it might pass for becuase it
certainly isn't a ny sort of angle dependent pigment.

sphere {0,1
texture {
 pigment {rgb .25}
  finish {
        reflection_type 0 reflection_min <.1,0,0> reflection_max <1,0,0>
        }
}
texture {
 pigment {rgbt .75}
  finish {
        reflection_type 0 reflection_min <0,0,1> reflection_max <0,0,.1>
        }
}
}


Bob H.


Post a reply to this message

From: Bill DeWitt
Subject: Re: Color help...
Date: 16 Jul 2001 11:39:23
Message: <3b530aab$1@news.povray.org>
"Bob H." <omn### [at] msncom> wrote :
>
> sphere {0,1
> texture {
>  pigment {rgb .25}
>   finish {
>         reflection_type 0 reflection_min <.1,0,0> reflection_max <1,0,0>
>         }
> }
> texture {
>  pigment {rgbt .75}
>   finish {
>         reflection_type 0 reflection_min <0,0,1> reflection_max <0,0,.1>
>         }
> }
> }


    I don't know about car paint, but it's a neat effect!


Post a reply to this message

From: Michael Andrews
Subject: Re: Color help...
Date: 16 Jul 2001 13:06:52
Message: <3B532077.21E40706@reading.ac.uk>
Actually, if you only want a mix of two colours dependant on the angle
then you can do this with a very simple  pigment shader:

surface incoming ( float falloff = 1.0; color col1 = (1,0,0), col2 =
(0,1,0);)
{ 
  Ci = mix(col1, col2, pow (abs(normalize(N).normalize(I)), falloff));
}

and in POVMan use a declaration such as

#declare incoming = pigment {
  shader{
    shader_file "incoming.slp"
    "falloff" 5
    "col1" <1,0.5,0>
    "col2" <0,1,0.5>
  }
}

This works with direct and reflected rays, you can add whatever finish
you like too.

Bye for now,
	Mike Andrews.


"Bob H." wrote:
> 
> "Bob H." <omn### [at] msncom> wrote in message
> news:3b52f036@news.povray.org...
> > "Michael Andrews" <M.C### [at] readingacuk> wrote in message
> > news:3B5### [at] readingacuk...
> > >
> > > If anyone can see another way of doing it I would also like to know ...
> >
> > What I just thought of was to use the MegaPOV angle dependent reflection
> in
> > a two layered texture, trick being to use opposing min and max color
> > vectors.  Maybe that has already been mentioned, if so I didn't notice.
> 
> Okay, maybe that wasn't relating to the previous message reply so much but I
> just gave it a try to see how it would look.  It's close to that kind of car
> paint, since cars do reflect it's about all it might pass for becuase it
> certainly isn't a ny sort of angle dependent pigment.
> 
> sphere {0,1
> texture {
>  pigment {rgb .25}
>   finish {
>         reflection_type 0 reflection_min <.1,0,0> reflection_max <1,0,0>
>         }
> }
> texture {
>  pigment {rgbt .75}
>   finish {
>         reflection_type 0 reflection_min <0,0,1> reflection_max <0,0,.1>
>         }
> }
> }
> 
> Bob H.


Post a reply to this message

From: Fabien Mosen
Subject: Re: Color help...
Date: 16 Jul 2001 13:39:14
Message: <3B532585.8FBFFFEC@skynet.be>
Ben Chambers wrote:
> 
> Does anyone know how I can make a texture vary depending on the
> angle from which it is viewed?  I've thought about using a radial, but that
> isn't quite what I want...  As in, the angle of incidence between the
> intersecting ray and the surface normal would act as a sort of index
> into a pigment map.

There's a soluition for you : ML-Pov, a tiny MegaPOV 7 based patch,
which has an "aoi" pattern !

http://martial.rameaux.free.fr/mael/mlpovall.zip

pigment {aoi color_map {..}}

Fabien.


Post a reply to this message

From: Michael Andrews
Subject: Re: Color help...
Date: 17 Jul 2001 12:32:18
Message: <3B5469DE.FE19F511@reading.ac.uk>
I've put an image on p.b.i which uses an angle dependant mix of two
colours. This is a one-line shader for POVMan, but it can only mix two
colours as it stands. It could probably be adapted to do other things
...

I'll post the source to the shaders and the pov file to p.b.s-f.

Bye for now,
	Mike Andrews.


Ben Chambers wrote:
> 
> Does anyone know how I can make a texture vary depending on the
> angle from which it is viewed?  I've thought about using a radial, but that
> isn't quite what I want...  As in, the angle of incidence between the
> intersecting ray and the surface normal would act as a sort of index
> into a pigment map.
> 
> ...Chambers


Post a reply to this message

From: Ben Chambers
Subject: Re: Color help...
Date: 17 Jul 2001 18:16:55
Message: <3b54b957@news.povray.org>
I just get a gray sphere... What's it supposed to do?

...Chambers

Bill DeWitt <bde### [at] cflrrcom> wrote in message
news:3b530aab$1@news.povray.org...
>
> "Bob H." <omn### [at] msncom> wrote :
> >
> > sphere {0,1
> > texture {
> >  pigment {rgb .25}
> >   finish {
> >         reflection_type 0 reflection_min <.1,0,0> reflection_max <1,0,0>
> >         }
> > }
> > texture {
> >  pigment {rgbt .75}
> >   finish {
> >         reflection_type 0 reflection_min <0,0,1> reflection_max <0,0,.1>
> >         }
> > }
> > }
>
>
>     I don't know about car paint, but it's a neat effect!
>
>


Post a reply to this message

From: Bill DeWitt
Subject: Re: Color help...
Date: 17 Jul 2001 22:55:24
Message: <3b54fa9c$1@news.povray.org>
"Ben Chambers" <bdc### [at] hotmailcom> wrote in message
news:3b54b957@news.povray.org...
> I just get a gray sphere... What's it supposed to do?


    It's supposed to use MegaPOV and it helps if you give it something to
reflect.


Post a reply to this message

From: Bob H 
Subject: Re: Color help...
Date: 18 Jul 2001 06:16:11
Message: <3b5561eb@news.povray.org>
"Bill DeWitt" <bde### [at] cflrrcom> wrote in message
news:3b54fa9c$1@news.povray.org...
>
> "Ben Chambers" <bdc### [at] hotmailcom> wrote in message
> news:3b54b957@news.povray.org...
> > I just get a gray sphere... What's it supposed to do?
>
>
>     It's supposed to use MegaPOV and it helps if you give it something to
> reflect.

Ha ha, yeah, sorry.  I knew it needed an "environment" to expose the
different colors but I neglecting to say so.  My apologies.  Actually,
anything other than rgb 0 works even if just background {rgb .5} , for
example, is used.

Bob H.


Post a reply to this message

From: Ben Chambers
Subject: Re: Color help...
Date: 18 Jul 2001 18:28:43
Message: <3b560d9b@news.povray.org>
Well, I have megapov, and I tried it with a plane below...
the reflection still doesn't work there.  However, the plane
_above_ it reflects quite nicely.

...Chambers

Bill DeWitt <bde### [at] cflrrcom> wrote in message
news:3b54fa9c$1@news.povray.org...
>
> "Ben Chambers" <bdc### [at] hotmailcom> wrote in message
> news:3b54b957@news.povray.org...
> > I just get a gray sphere... What's it supposed to do?
>
>
>     It's supposed to use MegaPOV and it helps if you give it something to
> reflect.
>
>


Post a reply to this message

From: Chris Huff
Subject: Re: Color help...
Date: 19 Jul 2001 15:28:37
Message: <chrishuff-9199CF.14271519072001@netplex.aussie.org>
In article <3b50f379@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   AFAIK patterns do not get info about the incoming ray nor the normal
> vector, so they can't produce a pattern depending on them. Not even a function
> pattern can do this.

It is possible (and fairly easy, though tedious) to make the ray 
information available to patterns, I had to do so for my portal pigment 
patch. I assume the POVMan and aoi pattern patches also have this 
modification.
The surface normal is already available, though...it is part of the 
intersection information.

-- 
Christopher James Huff - chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Ben Chambers
Subject: Re: Color help...
Date: 19 Jul 2001 18:21:46
Message: <3b575d7a@news.povray.org>
Ben Chambers <bdc### [at] hotmailcom> wrote in message
news:3b560d9b@news.povray.org...
> Well, I have megapov, and I tried it with a plane below...
> the reflection still doesn't work there.  However, the plane
> _above_ it reflects quite nicely.
>
> ...Chambers

I figured it out... the texture reflected red and blue lights.  The plane
below it was green :)

...Chambers


Post a reply to this message

From: Bob H 
Subject: Re: Color help...
Date: 19 Jul 2001 23:50:25
Message: <3b57aa81@news.povray.org>
"Ben Chambers" <bdc### [at] hotmailcom> wrote in message
news:3b575d7a@news.povray.org...
>
> Ben Chambers <bdc### [at] hotmailcom> wrote in message
> news:3b560d9b@news.povray.org...
> > Well, I have megapov, and I tried it with a plane below...
> > the reflection still doesn't work there.  However, the plane
> > _above_ it reflects quite nicely.
> >
> > ...Chambers
>
> I figured it out... the texture reflected red and blue lights.  The plane
> below it was green :)

Oh, yeah, makes sense.  Same as filter does with colors always need some
color component present to pass to the other.

Bob H.


Post a reply to this message

From: Vahur Krouverk
Subject: Re: Color help...
Date: 24 Jul 2001 14:29:35
Message: <3B5DBF56.1C6DDD06@comtrade.ee>
Michael Andrews wrote:
> 
> The way I'd have done it with a POVMan shader would be something like
> 
> #declare incoming = pigment {
>   shader{
>     shader_file "incoming.slp"
>     "falloff" 5
>     shadow_type shader_shadow
>   }
> }
> 
> sphere { 0,5
>   pigment {
>     pigment_pattern { incoming }
>     pigment_map {
>       [0.5 granite colour_map {[0 rgb x][1 rgb y]} ]
>       [0.5 bozo colour_map {[0 rgb z][1 rgb 1]} ]
>     }
>   }
>   finish { ambient 1 diffuse 0 specular 0 metallic }
> }
> 
> where the shader just returns the dot product between I (the incoming
> ray) and N (the surface normal).
> 
> Unfortunately, POVMan seems to count the pigment_pattern interior as a
> non-object pigment definition so neither I nor N are defined. I'm having
> to assume this from the fact that it does not work; usually it warns you
> about an incomplete initialization (when a shader is used in a warp, for
> instance) but in this case the pigment_pattern simply returns a value of
> 1 without any warnings.
> 
> If anyone can see another way of doing it I would also like to know ...
 
I tried it and indeed it doesn't work as expected. Seems like I vector
is wrong. POVMan calculates I by subtracting initial point of incoming
ray from intersection point in order to obtain 'true' (unnormalized)
view vector (incoming ray structure contains direction vector, but it is
normalized.) I assume that intersection point is correct, so initial
point in ray structure is one to blame. Unfortunately I don't have time
to examine it right now (i'm on vacation and packing for bicycle tour)
and I can't say, where is the problem. But I made note in 'things to do'
list to correct it in next version.
Temporary solution, which will work for trivial cases, would be to
calculate I vector by 'hand' by subtracting E (camera position) from P
(shading point). I made quick test and it seems to work. However, this
will not work in more complicated cases (e.g. with reflecting rays or
materials with different ior.)

HTH,
Vahur


Post a reply to this message

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