#version 330

 in vec3 vtxPos;
 in vec2 vtxTexCoord;
 in vec2 vtxOverlayCoord;
 in uint vtxFlags;


out vec3 fragmentColor;

uniform mat4 MVP;


void main(){
	gl_Position =  MVP * vec4(vtxPos,1);
	

	//
	// FLAGS
	//
	
	uint voxelTMU 	= (vtxFlags) 		& 0xfu;
	uint overlayTMU = (vtxFlags >> 4u)	& 0xfu;
	uint r 			= (vtxFlags >> 8u) 	& 0x3fu;
	uint g			= (vtxFlags >> 14u)	& 0x3fu;
	uint b			= (vtxFlags >> 20u)	& 0x3fu;
	uint level		= (vtxFlags >> 26u) & 0x3fu;
	
	fragmentColor = vec3(r/63.0, g/63.0, b/63.0);
	//fragmentColor = vec3(1.0,0.0,1.0);
	
}
