color trial

  • 46 Replies
  • 1837 Views

0 Members and 1 Guest are viewing this topic.

Offline mclarekin

  • *
  • Fractal Flamingo
  • ****
  • Posts: 304
« on: September 22, 2017, 01:35:00 AM »
For anyone who is interested, here are some experiments with color controls.  (can not attach zip so here are the two necessary  frag files)

Offline 3DickUlus

  • *
  • Fractal Freak
  • **
  • Posts: 679
    • Digilantism
« Reply #1 on: September 22, 2017, 05:34:00 AM »
so many buttons to twiddle ! don't know where to start  :-\\
nice to have these all in one file though, nice work :D
Resistance is fertile... you will be illuminated!

https://en.wikibooks.org/wiki/Fractals/fragmentarium

Offline mclarekin

  • *
  • Fractal Flamingo
  • ****
  • Posts: 304
« Reply #2 on: September 22, 2017, 07:02:37 AM »
It ain't easy to use LOL, I struggle even though I understand how it works.  . And if you apply these color algorithms to other types of fractals the required settings can be very different. I would recommend commenting out any color transforms that are not actually being used before rendering.

 Basically I have two main options  - , the colorValue  at termination or minimum colorValue found during iterations.  ToolW at the very bottom is very important for adjusting the overall shade, you use it to fish for the sweat spot. 

One day I hope to figure out how to make a dynamic visual display of the palette so i can see what is happening when i adjust the palette parameters, but for now I am just happy that I have learnt enough to make  it work :D

Offline timemit

  • *
  • Strange Attractor
  • ******
  • Posts: 80
    • timemit@DeiantArt
« Reply #3 on: September 28, 2017, 12:10:38 AM »
this looks really funky.. one of the things i always find tricky is getting good colour work into my frag fracs ..this, although complex and hard to know how to make do it things certainly gives tons more options and approaches, look forward to sussing it out a bit ..many thanks indeed. A nice abox variety as well  :thumbs:

Offline mclarekin

  • *
  • Fractal Flamingo
  • ****
  • Posts: 304
« Reply #4 on: September 29, 2017, 06:30:17 AM »
Nice image Tim O0.

I was struggling with the three number RGB way of doing color, so implemented this hack. You can also blend the original coloring method with the new colors   using the  "new color" slider on the ColoringTab.

Fundamentally we can get color data from anywhere within the iteration loop.   We have "c" at the beginning, then z , i and DE throughout the iteration. This provides radial and xyz linear data that can be used for coloring in it's raw state, or can be conditionally distorted.  Data can be sourced after any translation in the formula at any iteration. I have just coded a few of the infinite possibilities in this .frag.  :)




Offline timemit

  • *
  • Strange Attractor
  • ******
  • Posts: 80
    • timemit@DeiantArt
« Reply #5 on: September 29, 2017, 09:48:24 AM »
Thanks mclarekin, .. I have been having fun with it, so many options!!! I hadn't noticed the 'new colour slider' in the old colouring tab...even more choice : ) , it gives some very nice intense colours and complex patterning.

As you know i'm a total noob at implementing or mixing frags so how easy is it for me to  transfer this colouring to a different fractal frag  ie Asurf or a psuedokleinian frag.?

Offline Sabine62

  • *
  • Fractal Furball
  • ***
  • Posts: 220
    • sabine62.deviantart.com
« Reply #6 on: September 29, 2017, 10:03:27 PM »
I am in slider-heaven!  ;D
But no way I will ever remember what does what ;) Still, great job, mclarekin, I never knew there were so many colouring methods!

It's just a jump to the left...

Offline mclarekin

  • *
  • Fractal Flamingo
  • ****
  • Posts: 304
« Reply #7 on: September 30, 2017, 02:10:45 AM »
@ sabine. Very difficult to use,  especially if you are using more than one color algorithm.  A slider may work between, say, 0 and 10, but when other settings are involved,   then the new working range  may become 0 - .0001 is.  Also  once we start building the cumulative color number  for a point, we can then start using some negative settings.  Also when using a few algorithms,  it is good practice to turn off the preceding  algorithms one at a time to check whether they are still doing anything noticeable.



@ tim.  You can apply this to other fractals, but will have to make these changes to the raytracing frag used for the specific fractal.

Have a look and see how it was done

Open DE-RaytracerColour.frag,  look for     #group Coloring

a few lines above you will  see I have added
Code: [Select]
vec4 orbitTrap2 = vec4(10000.0);
  then in #coloring group, see where i have added the "new color" slider

Code: [Select]
// zero = no old color in the mix
uniform float NewColor; slider[0,1,1]

Then quite a bit further  down look for the following code:


Code: [Select]
vec3 getColor() {
orbitTrap.w = sqrt(orbitTrap.w);

vec3 orbitColor;


if (CycleColors) {
orbitColor = cycle(X.xyz,orbitTrap.x)*X.w*orbitTrap.x +
cycle(Y.xyz,orbitTrap.y)*Y.w*orbitTrap.y +
cycle(Z.xyz,orbitTrap.z)*Z.w*orbitTrap.z +
cycle(R.xyz,orbitTrap.w)*R.w*orbitTrap.w;
} else {
orbitColor = X.xyz*X.w*orbitTrap.x +
Y.xyz*Y.w*orbitTrap.y +
Z.xyz*Z.w*orbitTrap.z +
R.xyz*R.w*orbitTrap.w;
}

// mix between old and new color
orbitColor = mix(orbitColor, orbitTrap2.xyz * orbitTrap2.w,  NewColor);


vec3 color = mix(BaseColor, 3.0*orbitColor,  OrbitStrength);

return color;
}


orbitTrap is the original color data and orbitrap2 is the new color data

so we add in this code to use the new color data, and be able to mix them both together if we wish.

Code: [Select]
// mix between old and new color
orbitColor = mix(orbitColor, orbitTrap2.xyz * orbitTrap2.w,  NewColor);


So that is what was required to bring in the new color data into this  particular raytracing frag.

Send me a frag and I will do it for you if  wish.

Offline mclarekin

  • *
  • Fractal Flamingo
  • ****
  • Posts: 304
« Reply #8 on: September 30, 2017, 03:27:44 AM »
oops, in the formula frag I coded there are two methods for  transitioning  between the 6 colors. One is a simple linear transition, the other is using half a cosine function. Currently I have it working with the linear,  with the cosine transition commented out. I need to install a bool to easily change between the two. For now you need to comment out the one you are not using. :)   

Also I need to implement options for

 options  min and max capping,
option  transition from  color 5  back to  color 0 again

Offline timemit

  • *
  • Strange Attractor
  • ******
  • Posts: 80
    • timemit@DeiantArt
« Reply #9 on: September 30, 2017, 11:30:48 AM »
@Mclarekin ..thanks for the clear instructions..just what someone like me needs.. I will have a go and if I fail I will come get you to show me how it's done, then I can compare and see where I was going wrong...gives me something to muck about with  : ) many thanks

Offline timemit

  • *
  • Strange Attractor
  • ******
  • Posts: 80
    • timemit@DeiantArt
« Reply #10 on: September 30, 2017, 03:42:14 PM »
Ok I had a shot but get an unexpected = , expecting :: at token =  but can't track this down.. I'm probably miles off.. attached the frags I was trying to alter

Offline 3DickUlus

  • *
  • Fractal Freak
  • **
  • Posts: 679
    • Digilantism
« Reply #11 on: September 30, 2017, 06:09:53 PM »
line 556 - 557 in DE-KN2.frag

Offline timemit

  • *
  • Strange Attractor
  • ******
  • Posts: 80
    • timemit@DeiantArt
« Reply #12 on: September 30, 2017, 07:03:45 PM »
@ 3Dickulus..so here    orbitColor = mix(orbitColor, orbitTrap2.xyz * orbitTrap2.w,  NewColor); I replace the = with :: ?  If I do this i get  ' unexpected identifier , expecting identifier or type ident at token 'mix'

revel at my noobieness : )

Offline 3DickUlus

  • *
  • Fractal Freak
  • **
  • Posts: 679
    • Digilantism
« Reply #13 on: September 30, 2017, 07:43:43 PM »
those lines are out of context, remove them, they are duplicated at 548 and 549 ?

Offline timemit

  • *
  • Strange Attractor
  • ******
  • Posts: 80
    • timemit@DeiantArt
« Reply #14 on: October 01, 2017, 05:17:59 PM »
yes. idk how they ended up duplicated , my bad.. .. ok so that got it to load without errors but no newcolour options in sliders. So I mucked about some more and got that to appear but no actual sliders apparent in newcolour group .. again my noobieness much apparent !  Where/what else do I need to add to get these active?


xx
color trial s13

Started by mclarekin on Fractal Image Gallery

0 Replies
162 Views
Last post October 13, 2017, 12:01:14 PM
by mclarekin
xx
color trial s12.

Started by mclarekin on Fractal Image Gallery

0 Replies
185 Views
Last post October 07, 2017, 01:36:23 AM
by mclarekin
xx
color by depth

Started by mclarekin on Fractal Image Gallery

1 Replies
153 Views
Last post January 29, 2018, 06:35:32 AM
by M Benesi
xx
menger sponge color 2

Started by mclarekin on Fractal Image Gallery

0 Replies
67 Views
Last post March 19, 2018, 04:19:41 AM
by mclarekin
xx
pseudoKleinian hybrid color

Started by mclarekin on Fractal Image Gallery

0 Replies
21 Views
Last post August 25, 2018, 12:52:00 AM
by mclarekin