--- /dev/null
+import msp_interface;
+import common;
+
+uniform sampler2D texture;
+uniform vec4 tint;
+
+layout(constant_id=auto) const bool use_texture = false;
+layout(constant_id=auto) const bool use_vertex_color = false;
+layout(constant_id=auto) const bool use_fog = false;
+
+#pragma MSP stage(fragment)
+vec4 get_color()
+{
+ vec4 result = tint;
+ if(use_texture)
+ result *= texture(texture, texcoord.xy);
+ if(use_vertex_color)
+ result *= color;
+ return result;
+}
+
+void main()
+{
+ vec4 color = get_color();
+ if(use_fog)
+ color.rgb = apply_fog(color.rgb);
+ frag_color = color;
+}