I checked your frag and noticed you have some issues within the DE.
I am not sure what you meant there.
float DE(vec3 pos) {
int i=0;
for (i=0; i<Iterations; i++) {
float h = height(pos);
float k = Kaliset(pos);
if (KTex) {orbitTrap=vec4(1,1,1,1)*(k*ColorScale+ColorOffset);}
if (KHeightmap) {
float sc=k*Strength;
pos+=vec3(sc,sc,sc)*Strength2;}
h += k;
if (i<ColorIterations) orbitTrap = min(orbitTrap, abs(vec4(pos.xyz,expsmoothing)));
return (pos.z-Slope*h);
}
}
Since return is within the "for" loop it's actually never going through the loop cause it breaks the loop on return.
Also if KHeightmap is false, even if it did go through the loop, it wouldn't do much cause nothing changes there.
And Iterations is bound to both terrain and main loop, so I'd suggest adding another control for that. 5-6 its for terrain are sufficient and in your presets there were like 25-35 values which is an overkill even for my Titan X.
Finally you're nesting a lot of DE functions within a for loop which is a computational overkill (not sure if that's crucial for the intended result here).
So a proposed alternate:
#info Terrain
#include "MathUtils.frag"
#include "DE-kn9.frag"
#include "Classic-Noise.frag"
#group Terrain
// Number of differnt noise scales
uniform int Iterations; slider[0,5,100]
uniform int mIterations; slider[0,5,100]
uniform int ColorIterations; slider[0,3,300]
uniform bool fromFloor; checkbox[true]
// Slope
uniform float terrSlope; slider[-5,-0.5,5]
uniform float kaliSlope; slider[-5,-0.5,5]
uniform float FreqMul; slider[1,2,10]
uniform float Offset; slider[0,0.4,1]
uniform float AmpMul; slider[0,0.3,1]
uniform float WaterLevel; slider[0.0,0.6,1]
uniform float S; slider[0,1,3]
float expsmoothing = 0.0;
float height(vec3 pos) {
float A = 1.0;
float B = 1.0;
float r = 0.0;
for (int j = 0; j < 5; j++) {
r+= B*cnoise(A*(pos.xy)+Offset);
A*=FreqMul;
B*=AmpMul;
}
if (r>WaterLevel) r = WaterLevel;
return r;
}
vec3 baseColor(vec3 pos, vec3 normal) {
float h = height(pos);
if (h==WaterLevel) return vec3(0.0,0.0,1.0);
h = 1.0-clamp(h, 0.0, 1.0);
if (h>0.5) return vec3(h-0.5,1.0,h-0.5);
if (h<0.5) return mix(vec3(0.0,0.0,1.0),vec3(0.0,1.0,0.0),h*2.0);
}
float DE(vec3 pos) {
float h = height(pos);
float k = Kaliset(pos);
if (KHeightmap) {
float sc=k*Strength;
pos+=vec3(sc,sc,sc)*Strength2;
}
if (KTex) {
orbitTrap=vec4(1,1,1,1)*(k*ColorScale+ColorOffset);
} else {
orbitTrap = min(orbitTrap, abs(vec4(pos.xyz,expsmoothing)));
}
float de = pos.z - (k * kaliSlope + h * terrSlope);
return de;
}