POV-Ray : Newsgroups : povray.beta-test : Difference in wrapped vs raw wood in normal{} Server Time
21 Dec 2024 11:21:20 EST (-0500)
  Difference in wrapped vs raw wood in normal{} (Message 1 to 6 of 6)  
From: William F Pokorny
Subject: Difference in wrapped vs raw wood in normal{}
Date: 27 Nov 2024 08:00:55
Message: <67471807@news.povray.org>
In writing this post to the v4.0 forum:

http://news.povray.org/povray.pov4.discussion.general/thread/%3C67471126%241%40news.povray.org%3E/

I discovered weird differences in results between using the wood pattern 
directly within a normal and wrapping it in pigment_pattern{} or 
function{pattern{}}.

In other words, the following:

normal {
   wood
   rotate*90
}

Results in behavior different than either:

#declare Fn = function {
   pattern {
     wood
     rotate x*90
   }
}
...
normal { Fn(x,y,z) }

     or

normal {
   pigment_pattern {
     wood
     color_map {
       [0 rgb 0]
       [1 rgb 1]
     }
     rotate x*90
}

In the attached image the left column is using one of the wood {} 
wrapped forms. The middle column uses 'wood' directly in the normal{}.
The right column showing a 4x multiple of differences which should not 
exist. No AA used. The image results are from v3.8 beta 2, but this 
issue exists in the yuqk fork too.

The top row is just the wood base normal. The bottom row showing the 
wood based normal used in a slope map{}.

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.

Bill P.


Post a reply to this message


Attachments:
Download 'wrappedvsrawwoodinnormal.jpg' (145 KB)

Preview of image 'wrappedvsrawwoodinnormal.jpg'
wrappedvsrawwoodinnormal.jpg


 

From: William F Pokorny
Subject: Re: Difference in wrapped vs raw wood in normal{}
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

From: Mr
Subject: Re: Difference in wrapped vs raw wood in normal{}
Date: 29 Nov 2024 06:25:00
Message: <web.6749a39149345a6016086ed06830a892@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> 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.

So... Is there still no chance to create tangent space normal maps macros since
most recent fixes?


Post a reply to this message

From: William F Pokorny
Subject: Re: Difference in wrapped vs raw wood in normal{}
Date: 29 Nov 2024 21:13:57
Message: <674a74e5$1@news.povray.org>
On 11/29/24 06:20, Mr wrote:
> So... Is there still no chance to create tangent space normal maps macros since
> most recent fixes?

Probably not... :-)

I don't know is my actual answer. I have doubts I've changed mapping 
capability enough in yuqk to do much new over what POV-Ray can do.

When I have a little more time I'll have to search the web and the 
newsgroups for exactly what you mean by "tangent space normal maps macro".

Bill P.


Post a reply to this message

From: Mr
Subject: Re: Difference in wrapped vs raw wood in normal{}
Date: 30 Nov 2024 05:55:00
Message: <web.674aee8249345a609ab1ad886830a892@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> On 11/29/24 06:20, Mr wrote:
> > So... Is there still no chance to create tangent space normal maps macros since
> > most recent fixes?
>
> Probably not... :-)
>
> I don't know is my actual answer. I have doubts I've changed mapping
> capability enough in yuqk to do much new over what POV-Ray can do.
>
> When I have a little more time I'll have to search the web and the
> newsgroups for exactly what you mean by "tangent space normal maps macro".
>
> Bill P.

This is the first result and does seem relevant:
https://learnopengl.com/Advanced-Lighting/Normal-Mapping

Crossfingers! Anyway, thanks a lot for ALL the work you are doing, very much
appreciated, please keep having fun !


Post a reply to this message

From: William F Pokorny
Subject: Re: Difference in wrapped vs raw wood in normal{}
Date: 30 Nov 2024 06:22:38
Message: <674af57e$1@news.povray.org>
On 11/30/24 05:52, Mr wrote:
> This is the first result and does seem relevant:
> https://learnopengl.com/Advanced-Lighting/Normal-Mapping

Thank you for the reference!

Bill P.


Post a reply to this message

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