POV-Ray : Newsgroups : povray.general : Dynamic Normals : Re: Dynamic Normals Server Time
7 Aug 2024 09:26:10 EDT (-0400)
  Re: Dynamic Normals  
From: Jérôme Grimbert
Date: 14 Oct 2001 04:29:29
Message: <3BC94DAF.79A06BD0@free.fr>
Batronyx wrote:
> 
> Does anyone know of a way to determine the normal of a surface dynamically at
> render time? trace() is static/parse time. Attempting to infer from a functions
> using the slope pattern doesn't work; its not allowed in pattern syntax and
> isn't evaluated dynamically during a render using pigment syntax.
> And of course there isn't a f_normal() in functions include.
> 
> I created a generic box mapping function that works similar to uv_mapping for a
> box and can use box map images made in UV Mapper or alternatively, one of up to
> six other pigment functions. It behaves better with cutaway_textures than
> uv_mapping for a box, and can be applied to spheres, or other arbitrary shapes.
> However, it behaves more like the boxed pigment meaning it is better with mostly
> convex objects whereas a proper implementation should take the direction of the
> surface normal into account, thereby allowing proper behavior with more concave
> objects as well.
> 
> I can think of a couple of other uses for having the normal available at
> rendertime as well. Any ideas?
> 
Yes...


(Opening the pandora box...)
The normal is available at the rendering engine level, but is not given when
evaluating the pigment. It is possible(*) to modify the parameters of the relevant 
functions (just adding the normal), in order to propagate that information to 
your pattern.

But keep in mind that adding the normal information to a pattern means that you
break the orthogonality between textures and forms(**). So, doing that is not a thing
to be done as a quick patch, it must be the result of a long reflection regarding
the global philosophy of Pov. 

Do you really need that ?



(**): Pattern starting to depend on the object on which they apply is not the usual
behaviour for Pov.

(*): In fact, I did it some months ago. it's not that hard, just a bit extensive.
The problem I still have is warping the normal. It's not that simple and clear as it
might first seems.
PS: Do not dare to ask, I won't publish that (it was for 3.1 anyway)!


Post a reply to this message

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