|
![](/i/fill.gif) |
"Ben Chambers" <bdc### [at] hotmail com> wrote in message
news:3b575d7a@news.povray.org...
>
> Ben Chambers <bdc### [at] hotmail com> 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
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |