POV-Ray : Newsgroups : povray.beta-test : Difference in wrapped vs raw wood in normal{} : Re: Difference in wrapped vs raw wood in normal{} Server Time
9 Dec 2024 08:53:54 EST (-0500)
  Re: Difference in wrapped vs raw wood in normal{}  
From: William F Pokorny
Date: 27 Nov 2024 14:28:41
Message: <674772e9$1@news.povray.org>
On 11/27/24 08:00, William F Pokorny wrote:
> Real life keeping me busy over the next few days, but I plan to dig into 
> this when I get some time. My guess at the moment is it is some 
> numerical difference near values of 0 and/or 1, but we'll see.

What is going on popped into my head 10 minutes ago. The following does 
produce the same result as normal{ wood rotatex*90 } :

     #declare Fn = function {
         pattern {  // This {} enables value modifiers
             wood
           //rotate x*90
         }
     }
     normal {
         Fn(x,y,z)
         rotate x*90  // Moved the rotation here
     }

Where I had coded this:

     #declare Fn = function {
         pattern {  // This {} enables value modifiers
             wood
             rotate x*90
         }
     }
     normal {
         Fn(x,y,z)
     }

In the top the rotate happens in normal{} context. With the bottom 
encoding it happens in the pre-compiled function{ pattern{} } context.

The normal{} value sampling - in being only a pyramid  of 4 samples - is 
asymmetric. It sees the wood pattern's value not-rotated in one case and 
rotated in the other and we get different perturbed normal results.

Bill P.


Post a reply to this message

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