POV-Ray : Newsgroups : povray.binaries.images : Documenting special turbulence handling tangle. : Documenting special turbulence handling tangle. Server Time
18 Apr 2024 23:55:55 EDT (-0400)
  Documenting special turbulence handling tangle.  
From: William F Pokorny
Date: 24 Sep 2020 05:42:16
Message: <5f6c69f8$1@news.povray.org>
I've been working on povr's it_ prefixed, internal turbulence, keywords 
implementation for patterns which have special turbulence handling. 
Those patterns are: agate, marble, spiral1, spiral2 and wood.

I've come to understand the pattern's internal turbulence cannot be run 
apart from also running classic turbulence excepting for agate, which 
has the agate_turb keyword. Even with agate, if you make the mistake of 
specifying an actual turbulence vector value you'll see both internal 
value turbulence and regular spacial turbulence. Supposing you leave the 
turbulence vector at the default 0.0 by using only agate_turb, octaves, 
omega and lambda - the null spacial turbulence is still getting calculated!

While news to me, I do not believe this is news to the v3.7 developers. 
There is in "struct ClassicTurbulence" a carefully set, but unused, 
handledByPattern boolean which was likely intended to skip the classic 
turbulence in the special turbulence patterns when running through the 
warp{} list. I checked v3.6 code and the value/spatial turbulence is 
tangled there too. I think the developers matched previous behavior.

In all but agate, the reason for the coupled value/spatial turbulence is 
the turbulence vector's value is being borrowed for what should be an 
independent agate_turb like keyword in all the patterns. For example, 
spiral2's pattern code has:

Turb = GetTurb(warps);
turb_val = Turb->Turbulence[X]*Turbulence(EPoint,Turb,GetNoiseGen(pThread));
//|||||||||||||||||

Aside: Yes, the EPoint as used in Turbulence could be better decoupled 
too.  As in providing an it_scale / it_offset vector options for 
starters, but perhaps such things are better left to the inbuilt 
functions. Not decided. I am leaning to enabling the it_scale keyword 
for special/value turbulence patterns, but we'll see.

Even if you carefully code say:

spiral1 1 turbulence <0.03,0,0>

to avoid y and z spatial turbulence, you get the x turbulence value as 
regular turbulence on top of the internal spiral1 pattern value turbulence.

There's more detail, but, perhaps another day.

Attached is an image showing size renders labeled A thru F all showing 
spiral1 examples.

(A) v3.8 current tangled turbulences.

     spiral1 1
     turbulence (1/3)*0.5

(B) A version of povr with only the Turbulence() omega distribution 
drift fix, but otherwise still tangled turbulences.

     spiral1 1
     turbulence (1/3)*0.5

(C) v3.8 again, but where we turn off both the internal value turbulence 
and the spatial x turbulence by coding the full vector with x at 0:

     spiral1 1
     turbulence <0,(1/3)*0.5,(1/3)*0.5>

(D) A current povr render with the it_, internal turbulence, keywords. 
Here with it_frequency we get only the pattern's value turbulence.

     spiral1 1
     it_frequency (1/3)*0.5

(E) A current povr render with the it_, internal turbulence, keywords. 
Specifying and getting only spacial turbulence.

     spiral1 1
     turbulence (1/3)*0.5

(F) A current povr render with the it_, internal turbulence, keywords. 
Specifying and getting both the internal value and spacial turbulence.

     spiral1 1
     it_frequency (1/3)*0.5
     turbulence (1/3)*0.5

Aside: Originally I was going to get rid of classic turbulence in povr, 
but, as mentioned recently elsewhere, it allows updates on inheriting 
from an existing pattern, so now thinking I'll keep it. Making, in the 
special turbulence cases this sort of turbulence/warp order:

it_ <-- classic turbulence <-- warp { turbulence, et al }

Aside: In povr I moved the wood pattern's use of DTurbulence() to 
Turbulence() so it uses the pattern specific noise generator if one is 
specified. The wood pattern was somewhat unique in always using noise 
generator 2 due the DTurbulence() use.

Aside: Due the omega distribution drift in Turbulence() I expect at 
times, with these special turbulence patterns, folks were mostly getting 
the spatial turbulence.

FWIW.

Bill P.


Post a reply to this message


Attachments:
Download 'storyspcturb.jpg' (272 KB)

Preview of image 'storyspcturb.jpg'
storyspcturb.jpg


 

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