POV-Ray : Newsgroups : povray.pov4.discussion.general : Wood pattern and v4.0. : Wood pattern and v4.0. Server Time
20 May 2024 06:42:14 EDT (-0400)
  Wood pattern and v4.0.  
From: William F Pokorny
Date: 13 Sep 2023 13:36:40
Message: <6501f328@news.povray.org>
I'd re-written the povr fork's wood, scalar value pattern (not povr's 
f_wood() inbuilt) a couple years back. I found myself twiddling with it 
again recently. I wanted to document some of how I understand it to be 
working in official releases (since v1.0) and how it is now working in 
the povr fork.

An image is attached. In the top row on the left and right showing how 
'special turbulence' (naked 'turbulence' and associated keywords) today 
produces a wood pattern with harmonics. This is due a melding of the 
incoming x and y coordinates with the turbulence.

My best guess is odd turbulence treatment was done to get differing size 
growth rings - so long as users carefully position the pattern with 
respect to the surface(s) being textured. Namely, orthogonal / ortho45 
arrangements with respect to x & y axes. The behavior is very touchy 
with respect to the turbulence settings.

Lastly, the middle top row shows that if the user codes 'warp { 
turbulence ...}' over 'turbulence ...' they get no internal / special 
turbulence treatment at all, but rather only warp turbulence. This one 
of the reasons the povr fork has new it_ prefixed (internal turbulence) 
keywords where features make use of internal turbulence.

     //...  Official POV-Ray code
     plane { -z 0
         pigment {
             wood
             turbulence 0.05
             color_map {
                 [0 rgb 0]
                 [1 rgb 1]
             }
         }
         scale 1/8
         finish { emission 1 }
     }

---

Originally, I'd re-code to match the behavior above, but the povr fork 
now has f_wood() and I wanted to change the basic wood pattern to 
something easier to understand and use well.

The povr update is shown on the bottom row. The special melding of x and 
y with the DTurbulence() result is gone in favor of using the output of 
DTurbulence() directly. Further, as a general enhancement, there is now 
an it_scale option for warp { turbulence .. } and also scalar value 
patterns like wood.

     //... Example for povr fork using it_* turbulence and
     // warp{ turbulence ... it_scale ... }
     plane { -z 0
         pigment {
             wood
             it_amount 0.05  // New
             it_scale 1/4    // New
//          scale 1/3  // Old turbulence scaling method
             translate <pi,pi/2,pi/3>
             warp {
		turbulence 0.1 octaves 3
		omega 0.67 lambda 1.7 it_scale 3.0 // New
             }
             translate <pi,pi/2,pi/3>*-1
//          scale 3   // Old turbulence scaling method
             scale 1/24
             color_map {
                 [0 rgb 0]
                 [1 rgb 1]
             }
         }
         finish { emission 1 }
     }

Bill P.


Post a reply to this message


Attachments:
Download 'woodpatstory.jpg' (577 KB)

Preview of image 'woodpatstory.jpg'
woodpatstory.jpg


 

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