SHADER_INIT_PARAMS()
	{
		SetupVars( s_info );
		InitParamsLightmappedGeneric_DX9( this, params, pMaterialName, s_info );

		bool bDeferredActive = GetDeferredExt()->IsDeferredLightingEnabled();
		if( bDeferredActive )
		{
			defParms_gBuffer parms_gbuffer;
			SetupParmsGBuffer( parms_gbuffer );
			InitParmsGBuffer( parms_gbuffer, this, params );
		
			defParms_shadow parms_shadow;
			SetupParmsShadow( parms_shadow );
			InitParmsShadowPass( parms_shadow, this, params );
		}
	}
Exemple #2
0
	SHADER_INIT_PARAMS()
	{
		SET_FLAGS2( MATERIAL_VAR2_SUPPORTS_HW_SKINNING );

		if ( g_pHardwareConfig->HasFastVertexTextures() )
			SET_FLAGS2( MATERIAL_VAR2_USES_VERTEXID );

		//const bool bIsDecal = IS_FLAG_SET( MATERIAL_VAR_DECAL );
		const bool bDeferredActive = GetDeferredExt()->IsDeferredLightingEnabled();
		if( bDeferredActive )// && !bIsDecal )
		{
			const bool bTranslucent = IS_FLAG_SET( MATERIAL_VAR_TRANSLUCENT );
			const bool bAlphaTest = IS_FLAG_SET( MATERIAL_VAR_ALPHATEST );

			if( bTranslucent ) 
			{
				CLEAR_FLAGS( MATERIAL_VAR_TRANSLUCENT );
				SET_FLAGS( MATERIAL_VAR_ALPHATEST );

				params[ALPHATESTREFERENCE]->SetFloatValue( 0.5f );
			}
			else if( bAlphaTest )
			{
				if( params[ALPHATESTREFERENCE]->GetFloatValue() == 0.0f )
					params[ALPHATESTREFERENCE]->SetFloatValue( 0.5f );
			}
		}

		const bool bDrawToGBuffer = DrawToGBuffer( params );

		if ( bDrawToGBuffer )
		{
			defParms_gBuffer parms_gbuffer;
			SetupParmsGBuffer( parms_gbuffer );
			InitParmsGBuffer( parms_gbuffer, this, params );
		
			defParms_shadow parms_shadow;
			SetupParmsShadow( parms_shadow );
			InitParmsShadowPass( parms_shadow, this, params );
		}
	}