POV-Ray : Newsgroups : povray.advanced-users : Calculating normals and perturbing them. : Re: Calculating normals and perturbing them. Server Time
28 Nov 2025 02:35:46 EST (-0500)
  Re: Calculating normals and perturbing them.  
From: Cousin Ricky
Date: 26 Nov 2025 15:50:54
Message: <6927682e$1@news.povray.org>
On 2025-11-26 10:53 (-4), Bald Eagle wrote:
> 
> I was also trying to re-code an old scene where I was initially trying to
> replicate source-code methods in SDL, and I believe I was trying to do what
> Cousin Ricky was doing - which is trying to use a scalar value to create a
> "normal".
> 
> A surface normal is, by definition, a vector perpendicular to the surface at
> that point.   It's a vector, not a scalar, so using the scalar result from an
> SDL function as a normal really doesn't make any sense.

So far as I understand, the scalar is an offset from the surface, and as
such, a vector perpendicular to the unperturbed surface is implied.
POV-Ray then computes a normal vector by comparing adjacent
perturbations, "adjacent" being defined by the 'accuracy' attribute.

I haven't examined the source code, so I could be wrong, but I would
expect "adjacent" samples to be free from bias, at least from opposite
directions.

> I believe one would need to use a spline function, a pigment function, or some
> other vector-valued function to properly use a function {} in a normal statement
> to get meaningful if not proper results.

This actually sounds like an excellent way to *introduce* directional
bias if you're not careful with the function.  ISTR some of POV-Ray's
built-in normals already have that problem.


Post a reply to this message

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