uniform float offset;
uniform sampler2D T0;
varying vec4 worldPosition;
varying vec4 lightCol;
varying float dist;
uniform float brightness;

void main(void) 
{
  float l = length(worldPosition)*.5;
  //gl_FragColor = cos(offset);
  float fog = max(0.0, min(1.0, brightness + 1.0 - dist * 7.4 ) );
  gl_FragColor =  lightCol * fog; // + vec4(0.3,0.4,1.0,0.0)*pow(lightCol.y,10.0);
}
                            
