varying float LightIntensity; varying vec3 MCposition; uniform sampler3D Noise3; uniform float Amplify; uniform vec4 Color1; uniform vec4 Color2; uniform float NoiseScale; uniform float Turbulent; void main() { vec4 nv = texture3D(Noise3, MCposition * NoiseScale); float sum; if( Turbulent > 0.5 ) { sum = abs(nv[0]-.5) + abs(nv[1]-.5) + abs(nv[2]-.5) + abs(nv[3]-.5); } else { sum = nv[0] + nv[1] + nv[2] + nv[3]; sum = ( sum - 1. ) / 2.; } sum = clamp(sum * Amplify, 0.0, 1.0); vec3 color = mix(Color1.rgb, Color2.rgb, sum) * LightIntensity; gl_FragColor = vec4(color, 1.0); }