@ 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
vec4 orbitTrap2 = vec4(10000.0);
then in #coloring group, see where i have added the "new color" slider
// 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:
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.
// 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.