 
 
 
-float quad_bezier(float a, float b, float c, float t, float omt) {
-	return (omt * omt * a) + (2 * omt * t * b) + (t * t * c);
+void main(void) {
+    
+	out_Color = vec4(1,1,1, 1); //vs_norm;
 }
 
-float quad_bezier_dt(float a, float b, float c, float t, float omt) {
-	return (2 * omt * (b - a)) + (2 * t * (c - b));
-}
-
-void main(void) {
-
-	vec2 screenCoord = gl_FragCoord.xy / screenSize;
-	
-	float depth = texture(sDepth, screenCoord).r;
-	if (depth > 0.99999) {
-		discard; // stencil later?
-	}
-	
-	float ndc_depth = depth * 2.0 - 1.0;
-	
-	vec4 tmppos = inverse(mProj * mView) * vec4(screenCoord * 2.0 - 1.0, ndc_depth, 1.0);
-    vec3 pos = tmppos.xyz / tmppos.w;
-    
-    // pos is in model-space, which is what our control points are in
-    // TODO: block instance offset lookups
-    
-    vec3 npos = pos / 256;
-    
-    
-    float t = vs_t;
-    float omt = 1 - vs_t;
-    
-    // this is the actual vertex location
-	vec4 spline = vec4(
-		quad_bezier(vs_cp0.x, vs_cp1.x, vs_cp2.x, t, omt),
-		quad_bezier(vs_cp0.y, vs_cp1.y, vs_cp2.y, t, omt),
-		0, 1);
-		
-	// tangent vector of the curve
-	vec2 sdt = normalize(vec2(
-		quad_bezier_dt(vs_cp0.x, vs_cp1.x, vs_cp2.x, t, omt),
-		quad_bezier_dt(vs_cp0.y, vs_cp1.y, vs_cp2.y, t, omt)));
-	
-	// normal vector from the curve
-	sdt = sdt.yx;
-	sdt.x *= -0.5;
-	
-	vec2 norm = normalize(sdt); 
-	
-	float width = abs(dot(pos.xy - spline.xy, norm));
-    if(width > 1) discard;
-    
-	out_Color = vec4(texture(sRoadTex, vec2((width + 1.0) / 2.0, t)).rgb , 1); //vs_norm;
-	out_Normal = vs_norm;
-}
-


#version 430 core

// in vec4 vs_pos;
in vec4 vs_norm;
in vec2 vs_tex;
flat in vec2 vs_cp0;
flat in vec2 vs_cp1;
flat in vec2 vs_cp2;
in float vs_t;

// fragment shader
uniform vec4 color;
uniform vec2 screenSize;

uniform sampler2D sDepth;
uniform sampler2D sRoadTex;

uniform mat4 mModel;
uniform mat4 mView;

out float vs_t;


out Vertex {
  vec3 pos;
} vertex;



void main() {
	
	
	vec4 spritePos = vec4(start_pos_fn_in.xyz, 1.0);
	
	//	gl_Position = (mProj * mView * mModel) * vec4(pos_tex_in.xy, 0, 1);
	gl_Position = spritePos;
	
}


