varying vec3 MCposition; varying vec4 Color; varying float LightIntensity; uniform sampler3D Noise3; uniform float Min, Max; uniform float Scale; void main() { vec4 noisevec = texture3D( Noise3, Scale*MCposition ); float size = noisevec[0] + noisevec[1] + noisevec[2] + noisevec[3]; size = .5 * ( size - 1. ); // size = size * size * size; // float a = smoothstep( Min, Max, size ); if( size < Min ) discard; if( size > Max ) discard; gl_FragColor = vec4( LightIntensity*Color.rgb, 1. ); #ifdef WANT_RED_AT_EDGES if( size < Min + .05 ) gl_FragColor = vec4( LightIntensity*vec3(1.,0.,0.), 1. ); #endif }