### color trial 2019

• 21 Replies
• 632 Views

0 Members and 1 Guest are viewing this topic.

• Moderator
• Posts: 757

#### color trial 2019

« on: March 08, 2019, 09:46:30 AM »
Fractal is  an abox/asurf  with variable scale parameters

For color testing  there is implemented  one way of getting color from a spherical_fold.
The additional color parameters are hacked into the min (orbitTrap) maths.
There are also several  // commented_out variations.

Next i will convert to using a palette

« Last Edit: March 18, 2019, 05:21:05 AM by mclarekin, Reason: remove old version attachment »

• 3c
• Posts: 819

#### Re: color trial 2019

« Reply #1 on: March 08, 2019, 10:24:57 AM »
Nice work, mclarekin! The SphereFoldColour throws up really beautiful colour-details.

One thing: the fact that the sliders add/remove light-strength (not a word, probably ) also makes it near impossible to add yellow, cyan or magenta since all goes very dark very quickly. To get the light back you need to switch to the Coloring tab and rummage around there to get the light back Probably no way around this?
To thine own self be true

• Moderator
• Posts: 757

#### Re: color trial 2019

« Reply #2 on: March 08, 2019, 11:54:23 AM »
the controls are terrible and very sensitive.

It should work better with a palette

• 3c
• Posts: 819

#### Re: color trial 2019

« Reply #3 on: March 08, 2019, 12:47:41 PM »
I'm looking forward to your palette-trial, then

• Moderator
• Posts: 757

#### Re: color trial 2019

« Reply #4 on: March 10, 2019, 08:31:29 AM »
I have converted  the fractal to run with a palette (stripped down version of previous experiments). It still has the option to modify the distance between each color in the palette, but next version will have a fixed integer distance.

#include "DE-Raytracer_palette6.frag" is made from "DE-Raytracer.frag" by inserting the green text

Quote
vec4 orbitTrap = vec4(10000.0);
vec4 palette = vec4(10000.0);
float fractionalCount = 0.0;

#group Coloring

// This is the pure color of object (in white light)
uniform vec3 BaseColor; color[1.0,1.0,1.0];
// Determines the mix between pure light coloring and pure orbit trap coloring
uniform float OrbitStrength; slider[0,0,1]

// mix in palette color
uniform float PaletteStrength; slider[0,1,1]

Quote
vec3 getColor() { ........................

// mix between old orbitTrap and palette color
orbitColor = mix(orbitColor, palette.xyz * palette.w,  PaletteStrength);

// final mix with base color

vec3 color = mix(BaseColor, 3.0*orbitColor,  OrbitStrength);
return color;
}
« Last Edit: March 18, 2019, 05:21:56 AM by mclarekin, Reason: remove old version attachment »

• 3f
• Posts: 1715

#### Re: color trial 2019

« Reply #5 on: March 10, 2019, 09:26:03 AM »
M Benesi did some work on palette and color control in Fast-Raytracer-with-Palette.frag with cycle speed , offset, sharpness, orbit strength, base strength, ranges etc.
He hacked it into the default raytracer frag so it should be relatively portable (in FragM terms). Used in his FunballColorsAccordion.frag

Just mentioning it here for comparison and research purposes

• 3c
• Posts: 819

#### Re: color trial 2019

« Reply #6 on: March 10, 2019, 11:53:37 AM »
Too many optionsssssss, I am getting dizzy

Very nice though!

• Moderator
• Posts: 757

#### Re: color trial 2019

« Reply #7 on: March 11, 2019, 01:38:15 AM »
@ 3DickUlus, thanks I had a look. Palette positioning  is similar to my current setup,

Next, I want to find an example using floor(), instead of if (<), for location on palette

@sabine Most of the palette options are commented out
If we ignore the palette:

Original Point Color
We can start with all points having an initial color value of zero, or we can assign different initial color values for each point. In this frag i have used distance from the origin for initial color value,  plus can mix in a sin(initial color value). There is  a lot more options possible and it is cheap as the maths is only done once per point.

Spherical folding.  Values are added each iteration depending on the points distance to the sphereFold conditions of MinimumRR and MaximumRR
I have used a vec3    where   .x   is point < MinRR,  .y  is  MinRR <  point  < MaxRR,  and .z  is point > MaxRR

OrbitTrap is a simple  min(orbitTrap, rr)  ie minimum distance from  (0,0,0).

The summation of the three components is then assigned a color from the palette

« Last Edit: March 18, 2019, 05:23:32 AM by mclarekin, Reason: remove old code »

• Moderator
• Posts: 757

#### Re: color trial 2019

« Reply #8 on: March 12, 2019, 11:39:46 PM »
color palette with a menger sponge

« Last Edit: March 18, 2019, 05:24:36 AM by mclarekin, Reason: remove old code »

• Moderator
• Posts: 757

#### Re: color trial 2019

« Reply #9 on: March 13, 2019, 03:50:14 AM »
sym4 using palette
« Last Edit: March 18, 2019, 05:25:14 AM by mclarekin, Reason: remove old version attachment »

• 3c
• Posts: 819

#### Re: color trial 2019

« Reply #10 on: March 13, 2019, 12:03:28 PM »
@Graeme, thanks a lot for the explanation! I've sifted through your code (.frags and ray-tracers), and see lots of ideas and possibilities. And there's lots more to explore by commenting in stuff from your shaders... --I always thought that colouring would be something really difficult, and found that the LVI-colouring I did some time ago was surprisingly easy. But now - looking with a bit more knowlegde - it seems the sky's the limit, you can do all sorts of things with light, sample where you want, modify, mangle it etc.

FragM did throw up some crashes and they might be due to divisons by zero... It behaved much better when I changed the col_dist uniforms to a slider range where they can't be 0
like
Code: [Select]
uniform float ColDist_1to2; slider[0.0001,1.0,100.0]
Will also have a good look at the sym4-code (thank you for using that as an example!), because I am trying (until now successless  )to get MB3D's polyfold_sym ported. So your code might be useful there for inspiration together with the link to the old FF-thread it gives (will of course credit the Mbulber-team if I can get something working from it  )

• 3c
• Posts: 819

#### Re: color trial 2019

« Reply #11 on: March 13, 2019, 01:07:41 PM »
Found the polyfold-sym by interchanging a constant for a uniform in Eiffie's shadertoy-code form the FF thread

http://www.fractalforums.com/theory/choosing-the-squaring-formula-by-location/msg80020/#msg80020
Code: [Select]
uniform float poly;slider[0.000000001,8,100]#define pi 3.14159//and then somewhere shortly before exiting the loop:float psi = abs(mod(atan(p.z,p.y)+pi/poly,pi/(0.5*poly))-pi/poly);p.yz=vec2(cos(psi),sin(psi))*length(p.yz);
Until now successfully tested on Knighty's pseudoKleinian

Thanks for making my day, Graeme, without you using that example I would never have found this!

PS sorry for the side-track!

Update: needs more research, but it's a start;)
« Last Edit: March 13, 2019, 01:21:42 PM by Sabine62 »

• Moderator
• Posts: 757

#### Re: color trial 2019

« Reply #12 on: March 14, 2019, 02:55:35 AM »
Last night I tried applying the palette to quatCubic4D and is crashed A LOT. I have the palette locked at default settings.  I need to interrogate the code to look for /0 errors, but i was making it stop crashing by commenting out the    //ColorValue += ColorAddOP;, weird as there are no divisions by zero. But the crashes do feel like infinite calculation crashes.

I will  fix my code   ie The uniform float ColDist_1to2; slider[0.0001,1.0,100.0] .   I want to get this palette working but the next one  will have  the palette colors  spaced at integer 1 intervals.

Quote
it seems the sky's the limit, you can do all sorts of things with light, sample where you want, modify, mangle it etc.
Sure is we can assign any color we like to a point in the set (color preferably created by the fractals maths, however I once colored a menger sponge with a mandelbox generated coloring ).

I am glad you are looking at poly fold, as it is still a work in progress for me (my current code in Mandelbulber only works well with a six fold and I need to look at the DE.)

« Last Edit: March 14, 2019, 08:36:16 AM by mclarekin »

• Moderator
• Posts: 757

#### Re: color trial 2019

« Reply #13 on: March 14, 2019, 02:59:42 AM »
Quote
is my favorite sym3 JuliaBulb, it hybrids beautifully

• 3c
• Posts: 819

#### Re: color trial 2019

« Reply #14 on: March 14, 2019, 10:02:30 AM »
For the polyFold_sym look here: https://fractalforums.org/fragmentarium/17/polyfoldsym-pre-transform/2684/msg13476#msg13476
Does change some formulas at order=1, so must be run conditionally if original structure needs to be shown. Can be well run as pre-transform so does not to be iterated, but using within the loop does give different and more detailed results. So maybe add in both places and run conditionally.
Still to add: shiftXY/skew and a shift in degrees...

is my favorite sym3 JuliaBulb, it hybrids beautifully
Then I must try that!  Though it's beautiful on its own already!

Will try and add your palette to other formulas to see if can reproduce your ColorValue += ColorAddOP;-problems and get back to you. It's Really weird that that should throw up errors, like you say...
Here all is stable since I changed the Col_Dist-uniforms...

### Similar Topics

###### color trial

Started by mclarekin on Color Snippets

46 Replies
3162 Views
February 27, 2018, 02:58:46 AM
by mclarekin
###### color trial s12.

Started by mclarekin on Fractal Image Gallery

0 Replies
361 Views
October 07, 2017, 01:36:23 AM
by mclarekin
###### color trial s13

Started by mclarekin on Fractal Image Gallery

0 Replies
300 Views
October 13, 2017, 12:01:14 PM
by mclarekin
###### color by depth

Started by mclarekin on Fractal Image Gallery

1 Replies
310 Views
January 29, 2018, 06:35:32 AM
by M Benesi