1/** 2 * Mandelbulber v2, a 3D fractal generator _%}}i*<. ____ _______ 3 * Copyright (C) 2021 Mandelbulber Team _>]|=||i=i<, / __ \___ ___ ___ / ___/ / 4 * \><||i|=>>%) / /_/ / _ \/ -_) _ \/ /__/ /__ 5 * This file is part of Mandelbulber. )<=i=]=|=i<> \____/ .__/\__/_//_/\___/____/ 6 * The project is licensed under GPLv3, -<>>=|><|||` /_/ 7 * see also COPYING file in this folder. ~+{i%+++ 8 * 9 * Parabolic Fold by mclarekin 10 11 * This file has been autogenerated by tools/populateUiInformation.php 12 * from the file "fractal_transf_parab_fold.cpp" in the folder formula/definition 13 * D O N O T E D I T T H I S F I L E ! 14 */ 15 16REAL4 TransfParabFoldIteration(REAL4 z, __constant sFractalCl *fractal, sExtendedAuxCl *aux) 17{ 18 REAL4 temp = z; 19 20 REAL4 slope2 = fractal->transformCommon.constantMultiplier111; 21 REAL4 lengthAdd = fractal->transformCommon.additionConstant000; 22 REAL4 factorP; 23 24 factorP.x = -slope2.x / (lengthAdd.x * 2.0f); 25 factorP.y = -slope2.y / (lengthAdd.y * 2.0f); 26 factorP.z = -slope2.z / (lengthAdd.z * 2.0f); 27 factorP.w = 0.0f; 28 29 if (temp.x > 0) 30 { 31 if (temp.x < lengthAdd.x) 32 { 33 z.x = z.x * z.x * factorP.x; 34 } 35 else 36 { 37 z.x = (z.x - lengthAdd.x / 2.0f) * slope2.x; 38 } 39 } 40 if (temp.y > 0) 41 { 42 if (temp.y < lengthAdd.y) 43 { 44 z.y = z.y * z.y * factorP.y; 45 } 46 else 47 { 48 z.y = (z.y - lengthAdd.y / 2.0f) * slope2.y; 49 } 50 } 51 if (temp.z > 0) 52 { 53 if (temp.z < lengthAdd.z) 54 { 55 z.z = z.z * z.z * factorP.z; 56 } 57 else 58 { 59 z.z = (z.z - lengthAdd.z / 2.0f) * slope2.z; 60 } 61 } 62 63 if (temp.x < 0) 64 { 65 if (temp.x > -lengthAdd.x) 66 { 67 z.x = z.x * z.x * -factorP.x; 68 } 69 else 70 { 71 z.x = (z.x + lengthAdd.x / 2.0f) * slope2.x; 72 } 73 } 74 if (temp.y < 0) 75 { 76 if (temp.y > -lengthAdd.y) 77 { 78 z.y = z.y * z.y * -factorP.y; 79 } 80 else 81 { 82 z.y = (z.y + lengthAdd.y / 2.0f) * slope2.y; 83 } 84 } 85 86 if (temp.z < 0) 87 { 88 89 if (temp.z > -lengthAdd.z) 90 { 91 z.z = z.z * z.z * -factorP.z; 92 } 93 else 94 { 95 z.z = (z.z + lengthAdd.z / 2.0f) * slope2.z; 96 } 97 } 98 99 if (fractal->transformCommon.functionEnabledxFalse) 100 { 101 z = (z - temp) * fractal->transformCommon.scale3D111; 102 } 103 if (fractal->transformCommon.functionEnabledyFalse) 104 { 105 z = (z - temp) * temp * fractal->transformCommon.scale3D111; 106 107 z.x = sign(temp.x) * z.x; 108 z.y = sign(temp.y) * z.y; 109 z.z = sign(temp.z) * z.z; 110 } 111 if (fractal->transformCommon.functionEnabledzFalse) 112 { 113 z = (z - temp) * temp * fractal->transformCommon.scale3D111; 114 } 115 116 if (fractal->analyticDE.enabled) 117 { 118 if (!fractal->analyticDE.enabledFalse) 119 aux->DE = aux->DE * fractal->analyticDE.scale1 + fractal->analyticDE.offset0; 120 else 121 { 122 REAL avgScale = length(z) / length(temp); 123 aux->DE = aux->DE * avgScale * fractal->analyticDE.scale1 + fractal->analyticDE.offset0; 124 } 125 } 126 return z; 127}