### Knighty Menger Sponge basic setup for FragM

• 2 Replies
• 163 Views

0 Members and 1 Guest are viewing this topic.

#### mclarekin #### Knighty Menger Sponge basic setup for FragM

« on: November 18, 2018, 07:15:34 AM »
This is a  basic set up  = rotation, offset, scale, 2nd offset
Code: [Select]
// Menger Sponge formula created by Knighty// reference http://www.fractalforums.com/ifs-iterated-function-systems/kaleidoscopic-(escape-time-ifs)/// The distance estimation code was originally devised by Buddhi.// reference http://www.fractalforums.com/3d-fractal-generation/a-mandelbox-distance-estimate-formula/15/#info Menger Sponge Distance Estimator.#include "MathUtils.frag"#define providesInit//#define USE_IQ_CLOUDS//#define KN_VOLUMETRIC//#define USE_EIFFIE_SHADOW//#define MULTI_SAMPLE_AO//uniform float time;#include "DE-Raytracer.frag"#group Mengeruniform int maxiter;  slider[0,10,50]uniform int ColorIterations;  slider[0,3,300]uniform float bailout; slider[0,16,100]uniform vec3 Rotation; slider[(-180,-180,-180),(0,0,0),(180,180,180)]mat3 rot;uniform vec3 PreOffset; slider[(-2,-2,-2),(0,0,0),(2,2,2)]uniform float Scale; slider[0.0,3.0,5.0]uniform vec3 PostOffset; slider[(-2,-2,-2),(0,0,0),(2,2,2)]void init() { rot = rotationMatrixXYZ(Rotation);}int i = 0; float DE(vec3 pos){ vec3 z = vec3(pos); float rr = 0.0; float Dd = 1.0; for( i=0; i<maxiter ; i++)   { z *= rot; z += PreOffset; z = abs(z); if (z.x - z.y < 0.0) z.xy = z.yx; if (z.x - z.z < 0.0) z.xz = z.zx; if (z.y - z.z < 0.0) z.yz = z.zy; z *= Scale; Dd *= Scale; z.x -= 2.0; z.y -= 2.0; if (z.z > 1.0) z.z -= 2.0; z += PostOffset; rr = dot(z,z); if (i<ColorIterations) orbitTrap = min(orbitTrap, abs(vec4(z.xyz,rr))); if ( rr > bailout) { float r = sqrt(rr); return r / Dd; } }}#preset std presetFOV = 0.5062657Eye = 0,-3,0Target = 0,0,0Up = 0,0,1EquiRectangular = falseAutoFocus = falseFocalPlane = 1Aperture = 0Gamma = 2.08335ToneMapping = 3Exposure = 0.6522Brightness = 1Contrast = 1Saturation = 1GaussianWeight = 1AntiAliasScale = 2DepthToAlpha = falseShowDepth = falseDepthMagnitude = 1Detail = -3.173575DetailAO = -1.35716FudgeFactor = 0.4573864MaxDistance = 1000MaxRaySteps = 164Dither = 0NormalBackStep = 1AO = 0,0,0,0.85185Specular = 1SpecularExp = 16.364SpecularMax = 10SpotLight = 1,1,1,1SpotLightDir = 0.63626,0.5CamLight = 1,1,1,1.53846CamLightMin = 0.12121Glow = 1,1,1,0.43836GlowMax = 52Fog = 0HardShadow = 0.35385ShadowSoft = 12.5806QualityShadows = falseReflection = 0DebugSun = falseBaseColor = 1,1,1OrbitStrength = 1X = 1,1,1,0.1851852Y = 0.345098,0.666667,0,0.02912Z = 1,0.666667,0,0.6147757R = 0.0784314,1,0.941176,-0.0194BackgroundColor = 0.607843,0.866667,0.560784GradientBackground = 0.3261CycleColors = falseCycles = 4.04901EnableFloor = false NotLockedFloorNormal = 0,0,0FloorHeight = 0FloorColor = 1,1,1analytic = falsemaxiter = 10ColorIterations = 3bailout = 16PreOffset = 0,0,0Scale = 3PostOffset = 0,0,0#endpreset

#### Sabine62 #### Re: Knighty Menger Sponge basic setup for FragM

« Reply #1 on: November 18, 2018, 08:35:19 AM »
We are swamped with fantastic goodies   Thank you so very much, mclarekin! To thine own self be true

#### timemit #### Re: Knighty Menger Sponge basic setup for FragM

« Reply #2 on: November 18, 2018, 11:27:00 AM »
Excellent thanks mclarekin..yes so much to explore atm : )

### Similar Topics ###### colorTrial Knighty's menger sphere

Started by mclarekin on Fractal Image Gallery

0 Replies
140 Views February 01, 2018, 08:32:27 AM
by mclarekin ###### Menger sponge

Started by ArtIco on Fractal Image Gallery

0 Replies
160 Views December 21, 2017, 11:33:39 AM
by ArtIco ###### Menger Sponge Tour 2

Started by utak3r on Fractal movie gallery

1 Replies
196 Views February 22, 2018, 11:37:07 AM
by freakiebeat ###### inverted Menger Sponge C

Started by mclarekin on Fractal Image Gallery

0 Replies
81 Views September 26, 2018, 11:22:38 AM
by mclarekin ###### Menger sponge transformation

Started by Nintendokater on Fractal movie gallery

0 Replies
69 Views January 27, 2019, 01:59:46 PM
by Nintendokater