POV-Ray : Newsgroups : povray.general : Color help... : Re: Color help... Server Time
7 Aug 2024 19:26:20 EDT (-0400)
  Re: Color help...  
From: Michael Andrews
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

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