/*---------------------------------------------------------------------------

    NN Library for LINDBERGH Standard Shader

    Copyright (C) 2004 - 2006 SEGA Corporation Creative Center Graphics Sect.
    All Rights Reserved.

    Module  : NN Standard Shader
    File    : 
    Create  : 2006/05/15
    Modify  : 2006/05/30
    Version : 1.13.04
    Note    : 

---------------------------------------------------------------------------*/

#if ( NNGLD_OPT_FRAG_LIGHTING || NNGLD_PROF_FOG_MODEL || NNGLD_FRAG_DUALPARAMAP )
	#define NNGLD_USE_VIEWPOSITIONFOG	1
#else
	#define NNGLD_USE_VIEWPOSITIONFOG	0
#endif

#if ( NNGLD_OPT_FRAG_LIGHTING || NNGLD_FRAG_DUALPARAMAP )
	#if NNGLD_OPT_TANGENT_SPACE
		#define NNGLD_NUM_OF_NORMAL	3
	#else
		#define NNGLD_NUM_OF_NORMAL	1
	#endif
#else
	#define NNGLD_NUM_OF_NORMAL	0
#endif

#if ( NNGLD_OPT_TEX_NORMAL != -1 )
	#define NNGLD_USE_TEX_NORMAL			1
#else
	#define NNGLD_USE_TEX_NORMAL			0
#endif
#if ( NNGLD_OPT_TEX_BASE != -1 )
	#define NNGLD_USE_TEX_BASE				1
#else
	#define NNGLD_USE_TEX_BASE				0
#endif
#if ( NNGLD_OPT_TEX_DECAL != -1 )
	#define NNGLD_USE_TEX_DECAL				1
#else
	#define NNGLD_USE_TEX_DECAL				0
#endif
#if ( NNGLD_OPT_TEX_DECAL2 != -1 )
	#define NNGLD_USE_TEX_DECAL2			1
#else
	#define NNGLD_USE_TEX_DECAL2			0
#endif
#if ( NNGLD_OPT_TEX_DECAL3 != -1 )
	#define NNGLD_USE_TEX_DECAL3			1
#else
	#define NNGLD_USE_TEX_DECAL3			0
#endif
#if ( NNGLD_OPT_TEX_SPECULAR != -1 )
	#define NNGLD_USE_TEX_SPECULAR			1
#else
	#define NNGLD_USE_TEX_SPECULAR			0
#endif
#if ( NNGLD_OPT_TEX_SHININESS != -1 )
	#define NNGLD_USE_TEX_SHININESS			1
#else
	#define NNGLD_USE_TEX_SHININESS			0
#endif
#if ( NNGLD_OPT_TEX_DUALPARABOLOID != -1 )
	#define NNGLD_USE_TEX_DUALPARABOLOID	1
#else
	#define NNGLD_USE_TEX_DUALPARABOLOID	0
#endif
#if ( NNGLD_OPT_TEX_ENVMASK != -1 )
	#define NNGLD_USE_TEX_ENVMASK			1
#else
	#define NNGLD_USE_TEX_ENVMASK			0
#endif
#if ( NNGLD_OPT_TEX_MODULATE != -1 )
	#define NNGLD_USE_TEX_MODULATE			1
#else
	#define NNGLD_USE_TEX_MODULATE			0
#endif
#if ( NNGLD_OPT_TEX_ADD != -1 )
	#define NNGLD_USE_TEX_ADD				1
#else
	#define NNGLD_USE_TEX_ADD				0
#endif
#if ( NNGLD_OPT_TEX_OPACITY != -1 )
	#define NNGLD_USE_TEX_OPACITY			1
#else
	#define NNGLD_USE_TEX_OPACITY			0
#endif
#if ( NNGLD_OPT_TEX_USER1 != -1 )
	#define NNGLD_USE_TEX_USER1				1
#else
	#define NNGLD_USE_TEX_USER1				0
#endif
#if ( NNGLD_OPT_TEX_USER2 != -1 )
	#define NNGLD_USE_TEX_USER2				1
#else
	#define NNGLD_USE_TEX_USER2				0
#endif
#if ( NNGLD_OPT_TEX_USER3 != -1 )
	#define NNGLD_USE_TEX_USER3				1
#else
	#define NNGLD_USE_TEX_USER3				0
#endif
#if ( NNGLD_OPT_TEX_USER4 != -1 )
	#define NNGLD_USE_TEX_USER4				1
#else
	#define NNGLD_USE_TEX_USER4				0
#endif
#if ( NNGLD_OPT_TEX_USER5 != -1 )
	#define NNGLD_USE_TEX_USER5				1
#else
	#define NNGLD_USE_TEX_USER5				0
#endif
#if ( NNGLD_OPT_TEX_USER6 != -1 )
	#define NNGLD_USE_TEX_USER6				1
#else
	#define NNGLD_USE_TEX_USER6				0
#endif
#if ( NNGLD_OPT_TEX_USER7 != -1 )
	#define NNGLD_USE_TEX_USER7				1
#else
	#define NNGLD_USE_TEX_USER7				0
#endif
#if ( NNGLD_OPT_TEX_USER8 != -1 )
	#define NNGLD_USE_TEX_USER8				1
#else
	#define NNGLD_USE_TEX_USER8				0
#endif

#define NNGLD_NUM_OF_TEXCOORD		(NNGLD_USE_TEX_NORMAL + NNGLD_USE_TEX_BASE + NNGLD_USE_TEX_DECAL + NNGLD_USE_TEX_DECAL2 + NNGLD_USE_TEX_DECAL3 + NNGLD_USE_TEX_SPECULAR + NNGLD_USE_TEX_SHININESS + NNGLD_USE_TEX_ENVMASK + NNGLD_USE_TEX_DUALPARABOLOID + NNGLD_USE_TEX_MODULATE + NNGLD_USE_TEX_ADD + NNGLD_USE_TEX_OPACITY + NNGLD_USE_TEX_USER1 + NNGLD_USE_TEX_USER2 + NNGLD_USE_TEX_USER3 + NNGLD_USE_TEX_USER4 + NNGLD_USE_TEX_USER5 + NNGLD_USE_TEX_USER6 + NNGLD_USE_TEX_USER7 + NNGLD_USE_TEX_USER8)
#define NNGLD_NUM_OF_TEXCOORD_PAIR	((NNGLD_NUM_OF_TEXCOORD + 1) / 2)

#if ( NNGLD_OPT_TEX_SHADOW != -1 )
	#if ( NNGLD_OPT_TEX_SHADOW2 != -1 )
		#define NNGLD_NUM_OF_TEXCOORDSHADOW		2
	#else
		#define NNGLD_NUM_OF_TEXCOORDSHADOW		1
	#endif
#else
	#define NNGLD_NUM_OF_TEXCOORDSHADOW		0
#endif

#define NNGLD_VARYING_INDEX_VIEWPOSITIONFOG		0
#define NNGLD_VARYING_INDEX_NORMAL				(NNGLD_USE_VIEWPOSITIONFOG)
#define NNGLD_VARYING_INDEX_TANGENT				(NNGLD_USE_VIEWPOSITIONFOG + 1)
#define NNGLD_VARYING_INDEX_BINORMAL			(NNGLD_USE_VIEWPOSITIONFOG + 2)
#define NNGLD_VARYING_INDEX_TEXCOORD01			(NNGLD_USE_VIEWPOSITIONFOG + NNGLD_NUM_OF_NORMAL + 0)
#define NNGLD_VARYING_INDEX_TEXCOORD23			(NNGLD_USE_VIEWPOSITIONFOG + NNGLD_NUM_OF_NORMAL + 1)
#define NNGLD_VARYING_INDEX_TEXCOORD45			(NNGLD_USE_VIEWPOSITIONFOG + NNGLD_NUM_OF_NORMAL + 2)
#define NNGLD_VARYING_INDEX_TEXCOORD67			(NNGLD_USE_VIEWPOSITIONFOG + NNGLD_NUM_OF_NORMAL + 3)
#define NNGLD_VARYING_INDEX_TEXCOORDSHADOW		(NNGLD_USE_VIEWPOSITIONFOG + NNGLD_NUM_OF_NORMAL + NNGLD_NUM_OF_TEXCOORD_PAIR + 0)
#define NNGLD_VARYING_INDEX_TEXCOORDSHADOW2		(NNGLD_USE_VIEWPOSITIONFOG + NNGLD_NUM_OF_NORMAL + NNGLD_NUM_OF_TEXCOORD_PAIR + 1)
#define NNGLD_NUM_OF_VARYING					(NNGLD_USE_VIEWPOSITIONFOG + NNGLD_NUM_OF_NORMAL + NNGLD_NUM_OF_TEXCOORD_PAIR + NNGLD_NUM_OF_TEXCOORDSHADOW)

#if (NNGLD_VARYING_INDEX_VIEWPOSITIONFOG == 0)
	#define NNGLD_BINDVARYING_VIEWPOSITIONFOG	:TEXCOORD0
#endif

#if (NNGLD_VARYING_INDEX_NORMAL == 0)
	#define NNGLD_BINDVARYING_NORMAL			:TEXCOORD0
	#define NNGLD_BINDVARYING_TANGENT			:TEXCOORD1
	#define NNGLD_BINDVARYING_BINORMAL			:TEXCOORD2
#elif (NNGLD_VARYING_INDEX_NORMAL == 1)
	#define NNGLD_BINDVARYING_NORMAL			:TEXCOORD1
	#define NNGLD_BINDVARYING_TANGENT			:TEXCOORD2
	#define NNGLD_BINDVARYING_BINORMAL			:TEXCOORD3
#endif

#if (NNGLD_VARYING_INDEX_TEXCOORD01 == 0)
	#define NNGLD_BINDVARYING_TEXCOORD01		:TEXCOORD0
	#define NNGLD_BINDVARYING_TEXCOORD23		:TEXCOORD1
	#define NNGLD_BINDVARYING_TEXCOORD45		:TEXCOORD2
	#define NNGLD_BINDVARYING_TEXCOORD67		:TEXCOORD3
#elif (NNGLD_VARYING_INDEX_TEXCOORD01 == 1)
	#define NNGLD_BINDVARYING_TEXCOORD01		:TEXCOORD1
	#define NNGLD_BINDVARYING_TEXCOORD23		:TEXCOORD2
	#define NNGLD_BINDVARYING_TEXCOORD45		:TEXCOORD3
	#define NNGLD_BINDVARYING_TEXCOORD67		:TEXCOORD4
#elif (NNGLD_VARYING_INDEX_TEXCOORD01 == 2)
	#define NNGLD_BINDVARYING_TEXCOORD01		:TEXCOORD2
	#define NNGLD_BINDVARYING_TEXCOORD23		:TEXCOORD3
	#define NNGLD_BINDVARYING_TEXCOORD45		:TEXCOORD4
	#define NNGLD_BINDVARYING_TEXCOORD67		:TEXCOORD5
#elif (NNGLD_VARYING_INDEX_TEXCOORD01 == 3)
	#define NNGLD_BINDVARYING_TEXCOORD01		:TEXCOORD3
	#define NNGLD_BINDVARYING_TEXCOORD23		:TEXCOORD4
	#define NNGLD_BINDVARYING_TEXCOORD45		:TEXCOORD5
	#define NNGLD_BINDVARYING_TEXCOORD67		:TEXCOORD6
#elif (NNGLD_VARYING_INDEX_TEXCOORD01 == 4)
	#define NNGLD_BINDVARYING_TEXCOORD01		:TEXCOORD4
	#define NNGLD_BINDVARYING_TEXCOORD23		:TEXCOORD5
	#define NNGLD_BINDVARYING_TEXCOORD45		:TEXCOORD6
	#define NNGLD_BINDVARYING_TEXCOORD67		:TEXCOORD7
#endif

#if (NNGLD_VARYING_INDEX_TEXCOORDSHADOW == 0)
	#define NNGLD_BINDVARYING_TEXCOORDSHADOW	:TEXCOORD0
	#define NNGLD_BINDVARYING_TEXCOORDSHADOW2	:TEXCOORD1
#elif (NNGLD_VARYING_INDEX_TEXCOORDSHADOW == 1)
	#define NNGLD_BINDVARYING_TEXCOORDSHADOW	:TEXCOORD1
	#define NNGLD_BINDVARYING_TEXCOORDSHADOW2	:TEXCOORD2
#elif (NNGLD_VARYING_INDEX_TEXCOORDSHADOW == 2)
	#define NNGLD_BINDVARYING_TEXCOORDSHADOW	:TEXCOORD2
	#define NNGLD_BINDVARYING_TEXCOORDSHADOW2	:TEXCOORD3
#elif (NNGLD_VARYING_INDEX_TEXCOORDSHADOW == 3)
	#define NNGLD_BINDVARYING_TEXCOORDSHADOW	:TEXCOORD3
	#define NNGLD_BINDVARYING_TEXCOORDSHADOW2	:TEXCOORD4
#elif (NNGLD_VARYING_INDEX_TEXCOORDSHADOW == 4)
	#define NNGLD_BINDVARYING_TEXCOORDSHADOW	:TEXCOORD4
	#define NNGLD_BINDVARYING_TEXCOORDSHADOW2	:TEXCOORD5
#elif (NNGLD_VARYING_INDEX_TEXCOORDSHADOW == 5)
	#define NNGLD_BINDVARYING_TEXCOORDSHADOW	:TEXCOORD5
	#define NNGLD_BINDVARYING_TEXCOORDSHADOW2	:TEXCOORD6
#elif (NNGLD_VARYING_INDEX_TEXCOORDSHADOW == 6)
	#define NNGLD_BINDVARYING_TEXCOORDSHADOW	:TEXCOORD6
	#define NNGLD_BINDVARYING_TEXCOORDSHADOW2	:TEXCOORD7
#elif (NNGLD_VARYING_INDEX_TEXCOORDSHADOW == 7)
	#define NNGLD_BINDVARYING_TEXCOORDSHADOW	:TEXCOORD7
#endif

#if (NNGLD_NUM_OF_VARYING == 0)
	#define NNGLD_BINDVARYING_USER0				:TEXCOORD0
	#define NNGLD_BINDVARYING_USER1				:TEXCOORD1
	#define NNGLD_BINDVARYING_USER2				:TEXCOORD2
	#define NNGLD_BINDVARYING_USER3				:TEXCOORD3
	#define NNGLD_BINDVARYING_USER4				:TEXCOORD4
	#define NNGLD_BINDVARYING_USER5				:TEXCOORD5
	#define NNGLD_BINDVARYING_USER6				:TEXCOORD6
	#define NNGLD_BINDVARYING_USER7				:TEXCOORD7
#elif (NNGLD_NUM_OF_VARYING == 1)
	#define NNGLD_BINDVARYING_USER0				:TEXCOORD1
	#define NNGLD_BINDVARYING_USER1				:TEXCOORD2
	#define NNGLD_BINDVARYING_USER2				:TEXCOORD3
	#define NNGLD_BINDVARYING_USER3				:TEXCOORD4
	#define NNGLD_BINDVARYING_USER4				:TEXCOORD5
	#define NNGLD_BINDVARYING_USER5				:TEXCOORD6
	#define NNGLD_BINDVARYING_USER6				:TEXCOORD7
#elif (NNGLD_NUM_OF_VARYING == 2)
	#define NNGLD_BINDVARYING_USER0				:TEXCOORD2
	#define NNGLD_BINDVARYING_USER1				:TEXCOORD3
	#define NNGLD_BINDVARYING_USER2				:TEXCOORD4
	#define NNGLD_BINDVARYING_USER3				:TEXCOORD5
	#define NNGLD_BINDVARYING_USER4				:TEXCOORD6
	#define NNGLD_BINDVARYING_USER5				:TEXCOORD7
#elif (NNGLD_NUM_OF_VARYING == 3)
	#define NNGLD_BINDVARYING_USER0				:TEXCOORD3
	#define NNGLD_BINDVARYING_USER1				:TEXCOORD4
	#define NNGLD_BINDVARYING_USER2				:TEXCOORD5
	#define NNGLD_BINDVARYING_USER3				:TEXCOORD6
	#define NNGLD_BINDVARYING_USER4				:TEXCOORD7
#elif (NNGLD_NUM_OF_VARYING == 4)
	#define NNGLD_BINDVARYING_USER0				:TEXCOORD4
	#define NNGLD_BINDVARYING_USER1				:TEXCOORD5
	#define NNGLD_BINDVARYING_USER2				:TEXCOORD6
	#define NNGLD_BINDVARYING_USER3				:TEXCOORD7
#elif (NNGLD_NUM_OF_VARYING == 5)
	#define NNGLD_BINDVARYING_USER0				:TEXCOORD5
	#define NNGLD_BINDVARYING_USER1				:TEXCOORD6
	#define NNGLD_BINDVARYING_USER2				:TEXCOORD7
#elif (NNGLD_NUM_OF_VARYING == 6)
	#define NNGLD_BINDVARYING_USER0				:TEXCOORD6
	#define NNGLD_BINDVARYING_USER1				:TEXCOORD7
#elif (NNGLD_NUM_OF_VARYING == 7)
	#define NNGLD_BINDVARYING_USER0				:TEXCOORD7
#endif

/* End of file */
