POV-Ray : Newsgroups : povray.programming : Normal perturbation algorithm : Re: Normal perturbation algorithm Server Time
28 Jul 2024 14:22:30 EDT (-0400)
  Re: Normal perturbation algorithm  
From: Nathan Kopp
Date: 6 Jul 2000 00:10:02
Message: <3964069a@news.povray.org>
Fabien Mosen <fab### [at] skynetbe> wrote...
> I hope this is the right place to ask that...
>
> Can someone explain to me how the perturbated normal of a given
> point of a surface is calculated ?
>
> I think I uderstood partially, but I miss parts of the
> reasoning. AFAIK, the "apparent height" of a point is determined
> by the pattern value of the point (0 to 1) and the bump_size.
> Now, how do you determine the "apparent" normal at that point ?
> Do you have to take the "height" of adjacent points in
> order to determine the slope ?  If so, how much points, and
> how far ?

Yes.  When turning a pattern (3d potential function with an output range of
0..1) into a bump map, POV uses a pyramid of four (I think) sample points to
determine the gradient of the function.  This gradient is used to perturb
the surface normal.  The specific details of when and where this pyramid of
sample points is selected differs between POV 3.1 and MegaPov (MegaPov fixes
some bugs).  Also, the perturbed normal at times needs to be transformed
sometimes, too.  The exact algorithm, taking into account layered textures,
averaged textures, and various transformations and warps, is actually rather
complex and difficult to explain, but I hope that this has helped at least a
little bit.

-Nathan


Post a reply to this message

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