#version 140

// positions are in world space
in highp vec4 position;
in mediump vec2 texcoord0;
in mediump vec4 sdf_params;
in mediump vec4 face_color;
in mediump vec4 outline_color;
in mediump vec4 shadow_color;
in mediump vec3 layer_mask;

out mediump vec2 var_texcoord0;
out mediump vec4 var_face_color;
out mediump vec4 var_outline_color;
out mediump vec4 var_shadow_color;
out mediump vec4 var_sdf_params;
out mediump vec4 var_layer_mask;

uniform vs_uniforms
{
    highp mat4 view_proj;
};

void main()
{
    var_texcoord0 = texcoord0;
    var_face_color = vec4(face_color.xyz * face_color.w, face_color.w);
    var_outline_color = vec4(outline_color.xyz * outline_color.w, outline_color.w);
    var_shadow_color = vec4(shadow_color.xyz * shadow_color.w, shadow_color.w);
    var_sdf_params = sdf_params;
    var_layer_mask.rgb = layer_mask;
    var_layer_mask.a = layer_mask.r * layer_mask.g * layer_mask.b;
    gl_Position = view_proj * vec4(position.x, position.y, position.z, 1.0);
}
