// __multiversion__
// This signals the loading code to prepend either #version 100 or #version 300 es as apropriate.

#include "vertexVersionSimple.h"
#include "uniformWorldConstants.h"
#include "uniformPerFrameConstants.h"
#include "uniformShaderConstants.h"

attribute vec4 POSITION;
attribute vec4 COLOR;
varying highp vec4 color;
varying highp vec3 pos;

const float fogNear = 0.3;

void main() {
    highp vec4 posi = POSITION;
    posi.y -= 0.028;
    posi.y -= 0.15 * length(POSITION.xz);
    
    gl_Position = WORLDVIEWPROJ * posi;
    pos = POSITION.xyz;
    
    color = mix( CURRENT_COLOR, FOG_COLOR, COLOR.r );
}