POV-Ray : Newsgroups : povray.beta-test.binaries : Function / pattern issues. New inbuilt f_agate(). : Re: Function / pattern issues. New inbuilt f_agate(). Server Time
29 Apr 2024 07:07:03 EDT (-0400)
  Re: Function / pattern issues. New inbuilt f_agate().  
From: William F Pokorny
Date: 3 Jun 2020 14:30:09
Message: <5ed7ec31$1@news.povray.org>
On 5/7/20 9:45 PM, William F Pokorny wrote:
...
> In a surprise, I expected f_agate() to be a little slower than the 
> inbuilt used as a pattern in a pigment, for example. It's running about 
> 16% faster for reasons not currently understood. This the first pattern 
> where - other than f_dents which is cheap - the inbuilt function 
> implementation can match the pattern one exactly. (My f_granite23 
> inbuilt doesn't match granite.) A mystery for another day.
...

A significant part of the performance degrade in the normal agate 
pattern looks to be due the use of a dynamic_cast(1) while it checks 
which turbulence warp exists / is the internal agate one. So, other 
special turbulence patterns likely have this slow down too - though I've 
not tested them.

In povr I'm now on the path of creating a set of it_ prefix turbulence 
keywords and have this going for fog. Plan to move all the special 
turbulence to these over time and move the special turbulence storage 
out of the warp list into whatever. The it_ stands for (i)nternal 
(t)urbulence. What I'm working with currently is:

it_depth      - Scaling by value along ray or other single vector.

it_frequency  - Multiplying the turbulence returned value(s). In action 
                  it's a synonym for it_magnitude, butthe result is used 
for a pattern map, or similar. Meaning the value(s) will see some form 
of fmod() resulting in a frequency of repetitions through the map - or 
whatever.

it_lambda     - Violence of each step(2.0).

it_magnitude  - Synonym for it_frequency in action, but better
description when thinking about vector turbulence and we are changing 
              the magnitude of the returned DTurbulence vectors.

it_octaves    - Integer. Number of iterations 1 to 10?.

it_omega      - Dampening factor (0.5)

it_scale      - Multiplies input coordinates before turbulence 
generated.  Internally x|y|z/<float(s)>. The fog turbulence 3d vector is 
really acting as a 3d inverse scale.it_translate  - Moves from input 
location before turbulence generated.  Internally x|y|z - floats(s)

Today we have ambiguity with just turbulence <vector>. In straight 
turbulence it means it_magnitude. In fog - POV-Ray proper - it means 
it_scale(2). In other places it means wave modification frequency 
multiplication because of what the magnitude multiplication sees post 
value(s) multiplication. Trying to make each sort explicit over time.

Bill P.

(1) - We've hit similar issues before with dynamic_cast. It's really, 
really slow.

(2) - Frequency scaling is missing from our pattern 'magnitude' 
turbulence today which is why you see people do things like:

scale 5/1  // scaling the whole mess up.
warp { turbulence... }
scale 1/5 // scaling the whole mess back down.


Post a reply to this message

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