// in:	C = Diffuse
//	N = Normal
//	S = Specular + A(sign(Nz))
//	NN = SurfaceNormal (only for FakeLighting)
#if defined(FAKE_PPL)
out	vec4	fragData[4];
void PackData (in vec4 C, in vec3 N, in vec3 S, in vec3 NN, in vec3 vertexColor)
{
	N = normalize(N);	// be sure that N normalized! Don't delete it!!!
	fragData[0] = C;
	// Stereographic Projection
	fragData[1].xy = N.xy / (N.z + 1.0) * 0.2812623 + 0.5;
	vertexColor *= 0.95;	// mul to 0.95 for avoidance 1.0 (special case for portal/mirror marks)
	fragData[2] = vec4(S, vertexColor.r);
	// store surface normal and lightmap sample
	fragData[3] = vec4((NN.xy + 1.0) * 0.5, vertexColor.gb);
}
#else
out	vec4	fragData[3];
void PackData (in vec4 C, in vec3 N, in vec3 S)
{
	N = normalize(N);	// be sure that N normalized! Don't delete it!!!
	fragData[0] = C;
	// Stereographic Projection
	fragData[1].xy = N.xy / (N.z + 1.0) * 0.2812623 + 0.5;
	fragData[2] = vec4(S, 0.0);
}
#endif
