• May 06, 2021, 05:42:06 PM

Login with username, password and session length

Author Topic: (Question) How to implement Series Approximation in GLSL?  (Read 279 times)

0 Members and 1 Guest are viewing this topic.

Offline Mr Rebooted

  • Fractal Phenom
  • ****
  • Posts: 57
(Question) How to implement Series Approximation in GLSL?
« on: November 19, 2020, 02:54:34 PM »
I've seen that Perturbation Theory also comes with Series approximation. How would I implement this in OpenGL? (Using vec2 and stuff like that)

Linkback: https://fractalforums.org/index.php?topic=3870.0

Online claude

  • 3f
  • ******
  • Posts: 1849
    • mathr.co.uk
Re: How to implement Series Approximation in GLSL?
« Reply #1 on: November 19, 2020, 04:10:05 PM »
Start by implementing a function for complex multiplication.  Then look at Horner's form for polynomial evaluation.  You can pass small series in a uniform array, larger numbers of terms might be better in texture1d (not sure).  Also note that for higher order series you will want to rescale the coefficients and inputs, because they can get very big and small and can over/underflow.  Ideally you want all the values to be near 1.  gerrit explained that to me once on this forum but I didn't implement it yet, KF just uses floatexp for higher range to avoid the issue (at the cost of speed).

You can calculate the series coefficients on the CPU, it's sequential work so not worth doing on GPU.  You can use the low precision reference orbit (note: you need to compute the reference at high precision, but you can round it for the series calculation and perturbed iterations).  You need to check for "overskipping", KF does this by comparing perturbed iterations vs series approximation for "probe points" (8 points on the image boundary) and stopping before they diverge too much.

The formula for the series is at https://mathr.co.uk/blog/2016-03-06_simpler_series_approximation.html , not quite optimal (evaluating ab+ba is more costly than 2ab).

Offline sjhalayka

  • Fractal Fruit Salad
  • *****
  • Posts: 69
Re: How to implement Series Approximation in GLSL?
« Reply #2 on: November 23, 2020, 10:45:25 PM »
I have put up a small compute shader program example for you:

https://github.com/sjhalayka/qjs_compute_shader

Changing the shader to do what you want should be relatively straightforward.


xx
"Time Span"

Started by cricke49 on Fractal Image Gallery

0 Replies
917 Views
Last post August 02, 2018, 07:05:21 AM
by cricke49
xx
How to Get More Than 3 Series Approximation Terms?

Started by Byte11 on Fractal Mathematics And New Theories

16 Replies
1389 Views
Last post December 21, 2017, 09:09:44 AM
by knighty
xx
Series approximation for the Burning Ship

Started by claude on Fractal Mathematics And New Theories

0 Replies
315 Views
Last post September 27, 2018, 06:05:07 PM
by claude
clip
using Misiurewicz points for perturbation and/or series approximation

Started by claude on Fractal Mathematics And New Theories

19 Replies
1538 Views
Last post November 10, 2017, 01:46:31 AM
by gerrit
clip
bad analytic DE/slopes when series approximation is disabled

Started by claude on Kalles Fraktaler

4 Replies
176 Views
Last post June 23, 2020, 07:44:35 AM
by claude