(Solved) can't use Complex.frag with both float and double versions simultaneously

  • 4 Replies
  • 194 Views

0 Members and 1 Guest are viewing this topic.

Offline claude

  • *
  • 3f
  • ******
  • Posts: 1378
    • mathr.co.uk
« on: January 01, 2019, 04:15:24 PM »
As written, Complex.frag is either for single or double precision.  In some frags I want some parts single and some parts double. Workaround:
Code: [Select]
#define M_PI M_PIf
#define M_2PI M_2PIf
#define M_PI2 M_PI2f
#define M_E M_Ef
#define M_EHALF M_EHALFf
#include "Complex.frag"
#undef REAL
#undef VEC2
#undef VEC3
#undef VEC4
#undef M_PI
#undef M_2PI
#undef M_PI2
#undef M_E
#undef M_EHALF
#define USE_DOUBLE
#include "Complex.frag"
Would be nice not to need this fudge...

Linkback: https://fractalforums.org/fragmentarium/17/cant-use-complex-frag-with-both-float-and-double-versions-simultaneously/2503/
« Last Edit: March 01, 2020, 08:09:33 PM by 3DickUlus, Reason: marked as solved »

Offline Sabine62

  • *
  • Fractal Freak
  • **
  • Posts: 667
  • It's just a jump to the left...
    • sabine62.deviantart.com
« Reply #1 on: January 01, 2019, 04:41:49 PM »
There's an #undef? I never knew  ::)  :fp:

Thank you for the code, claude!

To thine own self be true

Offline claude

  • *
  • 3f
  • ******
  • Posts: 1378
    • mathr.co.uk
« Reply #2 on: January 23, 2020, 06:06:01 PM »
Worked on this recently.

Ticket: https://github.com/3Dickulus/FragM/issues/67
Pull request: https://github.com/3Dickulus/FragM/pull/91

I only tested on AMD RX 580, as my other hardware does not support double at all.  Please test!

Easiest way is to download the changed 3 files to your Examples/Include folder:
Complex.frag
ComplexBase.frag
Math.frag
From https://github.com/claudeha/FragM/tree/feature-complex-both-float-and-double/Fragmentarium-Source/Examples/Include

No need to recompile.

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1548
    • Digilantism
« Reply #3 on: January 28, 2020, 03:58:29 AM »
An amazing piece of code! all the math stuff that should be in the GL drivers like double type trig functions etc... and stuff that's missing from older implementations.

I have renamed Complex.frag to NewComplex.frag so it can coexist with the current Complex.frag, this hasn't been merged yet but is destined to be part of master.

It would be really nice to get some feedback so the files are attached for easier access ;) (hope that's ok claude) as mentioned, just put these files in Examples/Include/ and use #include NewComplex.frag for access to double type trig functions for testing etc...

edit: maybe change the title of this to "can use Complex.frag with both float and double versions simultaneously" ?
« Last Edit: January 28, 2020, 04:10:15 AM by 3DickUlus, Reason: edit »

Offline claude

  • *
  • 3f
  • ******
  • Posts: 1378
    • mathr.co.uk
« Reply #4 on: January 28, 2020, 06:29:34 PM »
edit: maybe change the title of this to "can use Complex.frag with both float and double versions simultaneously" ?
I'll do that and mark it solved once it's merged :)


xx
"Time Span"

Started by cricke49 on Fractal Image Gallery

0 Replies
447 Views
Last post August 02, 2018, 07:05:21 AM
by cricke49
question
[Solved] Color interpolation

Started by galac on Programming

5 Replies
374 Views
Last post March 02, 2019, 09:03:11 AM
by mclarekin
question
New Theory of Super-Real and Complex-Complex Numbers and Aleph-Null

Started by M8W on Fractal Mathematics And New Theories

2 Replies
484 Views
Last post January 06, 2018, 08:40:15 AM
by M8W
xx
Birdie Style

Started by gannjondal on Fractal Image Gallery

1 Replies
495 Views
Last post May 08, 2018, 02:39:37 PM
by who8mypnuts
clip
Mandelbulb frag with some options

Started by mclarekin on Fragmentarium

1 Replies
218 Views
Last post October 07, 2018, 07:56:54 AM
by Sabine62