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

#include "shaders/vertexVersionSimple.h"

attribute vec3 POSITION_3;
attribute vec4 COLOR_4;
attribute vec4 ADDITIONAL;

uniform mat4 TRANSFORM;

varying vec4 ColorOut;
varying vec4 AdditionalOut;
varying vec3 ScreenNormalPosition;

void main(void)
{
	vec4 outPos = vec4(POSITION_3, 1.0) * TRANSFORM;
	ScreenNormalPosition = POSITION_3.xyz;

	// Translate to -1..1 with perspective correction
	float w = outPos.w;
	outPos.x = outPos.x * 2.0 - w;
	outPos.y = (w - outPos.y) * 2.0 - w;

	ColorOut = COLOR_4;
	AdditionalOut = ADDITIONAL;

	gl_Position = outPos;
}
