Example #1
0
void	CBlender_Particle::Compile	(CBlender_Compile& C)
{
	IBlender::Compile		(C);
	switch	(C.iElement) 
	{
	case SE_R2_NORMAL_HQ: 	// deffer
	case SE_R2_NORMAL_LQ: 	// deffer
		switch (oBlend.IDselected)
		{
		case 0:	C.r_Pass	("deffer_particle",	"deffer_particle",	FALSE,	TRUE,TRUE,	FALSE,	D3DBLEND_ONE,		D3DBLEND_ZERO,			FALSE,200);	break;	// SET
		case 1: C.r_Pass	("particle",		"particle",			FALSE,	TRUE,FALSE,	TRUE,	D3DBLEND_SRCALPHA,	D3DBLEND_INVSRCALPHA,	TRUE,0);	break;	// BLEND
		case 2:	C.r_Pass	("particle",		"particle",			FALSE,	TRUE,FALSE,	TRUE,	D3DBLEND_ONE,		D3DBLEND_ONE,			TRUE,0);	break;	// ADD
		case 3:	C.r_Pass	("particle",		"particle",			FALSE,	TRUE,FALSE,	TRUE,	D3DBLEND_DESTCOLOR,	D3DBLEND_ZERO,			TRUE,0);	break;	// MUL
		case 4:	C.r_Pass	("particle",		"particle",			FALSE,	TRUE,FALSE,	TRUE,	D3DBLEND_DESTCOLOR,	D3DBLEND_SRCCOLOR,		TRUE,0);	break;	// MUL_2X
		case 5:	C.r_Pass	("particle",		"particle",			FALSE,	TRUE,FALSE,	TRUE,	D3DBLEND_SRCALPHA,	D3DBLEND_ONE,			TRUE,0);	break;	// ALPHA-ADD
		};
		C.r_Sampler			("s_base",	C.L_textures[0],false,oClamp.value?D3DTADDRESS_CLAMP:D3DTADDRESS_WRAP);
		C.r_Sampler_rtf		("s_position",	"$user$position"); // Nummer: for soft particles
		C.r_End				();
		break;
	case SE_R2_SHADOW:		// smap
		// HARD or SOFT: shadow-map
		switch (oBlend.IDselected)
		{
		case 0:	C.r_Pass	("particle",		"particle",			FALSE,	TRUE,TRUE,	FALSE,	D3DBLEND_ONE,		D3DBLEND_ZERO,	TRUE,200);	break;	// SET
		case 1: C.r_Pass	("particle-clip",	"particle_s-blend",	FALSE,	TRUE,FALSE,	TRUE,	D3DBLEND_DESTCOLOR,	D3DBLEND_ZERO,	TRUE,0);	break;	// BLEND
		case 2:	C.r_Pass	("particle-clip",	"particle_s-add",	FALSE,	TRUE,FALSE,	TRUE,	D3DBLEND_DESTCOLOR,	D3DBLEND_ZERO,	TRUE,0);	break;	// ADD
		case 3:	C.r_Pass	("particle-clip",	"particle_s-mul",	FALSE,	TRUE,FALSE,	TRUE,	D3DBLEND_DESTCOLOR,	D3DBLEND_ZERO,	TRUE,0);	break;	// MUL
		case 4:	C.r_Pass	("particle-clip",	"particle_s-mul",	FALSE,	TRUE,FALSE,	TRUE,	D3DBLEND_DESTCOLOR,	D3DBLEND_ZERO,	TRUE,0);	break;	// MUL_2X
		case 5:	C.r_Pass	("particle-clip",	"particle_s-aadd",	FALSE,	TRUE,FALSE,	TRUE,	D3DBLEND_DESTCOLOR,	D3DBLEND_ZERO,	TRUE,0);	break;	// ALPHA-ADD
		};
		C.r_Sampler			("s_base",	C.L_textures[0],false,oClamp.value?D3DTADDRESS_CLAMP:D3DTADDRESS_WRAP);
		C.r_Sampler_rtf		("s_position",	"$user$position"); // Nummer: for soft particles
		C.r_End				();
		break;
	case 4: 	// deffer-EMAP
		break;
	};
}
Example #2
0
void	CBlender_accum_direct_mask::Compile(CBlender_Compile& C)
{
	IBlender::Compile		(C);

	switch (C.iElement) 
	{
	case SE_MASK_SPOT:		// spot or omni-part
		C.r_Pass			("accum_mask",		"dumb",				false,	TRUE,FALSE);
		C.r_Sampler_rtf		("s_position",		r2_RT_P);
		C.r_End				();
		break;
	case SE_MASK_POINT:		// point
		C.r_Pass			("accum_mask",		"dumb",				false,	TRUE,FALSE);
		C.r_Sampler_rtf		("s_position",		r2_RT_P);
		C.r_End				();
		break;
	case SE_MASK_DIRECT:	// stencil mask for directional light
		C.r_Pass			("null",			"accum_sun_mask",	false,	FALSE,FALSE,TRUE,D3DBLEND_ZERO,D3DBLEND_ONE,TRUE,1);
		C.r_Sampler_rtf		("s_normal",		r2_RT_N);
		C.r_End				();
		break;
	case SE_MASK_ACCUM_VOL:	// copy accumulator (temp -> real), volumetric (usually after blend)
		C.r_Pass			("accum_volume",	"copy_p",			false,	FALSE,FALSE);
		C.r_Sampler_rtf		("s_base",			r2_RT_accum_temp	);
		C.r_End				();
		break;
	case SE_MASK_ACCUM_2D:	// copy accumulator (temp -> real), 2D (usually after sun-blend)
		C.r_Pass			("null",			"copy",				false,	FALSE,FALSE);
		C.r_Sampler_rtf		("s_base",			r2_RT_accum_temp	);
		C.r_End				();
		break;
	case SE_MASK_ALBEDO:	// copy accumulator, 2D (for accum->color, albedo_wo)
		C.r_Pass			("null",			"copy",				false,	FALSE,FALSE);
		C.r_Sampler_rtf		("s_base",			r2_RT_accum			);
		C.r_End				();
		break;
	}
}
Example #3
0
void	CBlender_accum_spot::Compile(CBlender_Compile& C)
{
	IBlender::Compile		(C);

	BOOL		b_HW_smap	= RImplementation.o.HW_smap;
	BOOL		b_HW_PCF	= RImplementation.o.HW_smap_PCF;
	BOOL		blend		= RImplementation.o.fp16_blend;
	D3DBLEND	dest		= blend?D3DBLEND_ONE:D3DBLEND_ZERO;

	switch (C.iElement)
	{
	case SE_L_FILL:			// masking
		C.r_Pass			("null", 			"copy",						false,	FALSE,	FALSE);
		C.r_Sampler			("s_base",			C.L_textures[0]);
		C.r_End				();
		break;
	case SE_L_UNSHADOWED:	// unshadowed
		C.r_Pass			("accum_volume",	"accum_spot_unshadowed",	false,	FALSE,FALSE,blend,D3DBLEND_ONE,dest);
		C.r_Sampler_rtf		("s_position",		r2_RT_P);
		C.r_Sampler_rtf		("s_normal",		r2_RT_N);
		C.r_Sampler_clw		("s_material",		r2_material);
		C.r_Sampler			("s_lmap",			C.L_textures[0],false,D3DTADDRESS_CLAMP);
		C.r_Sampler_rtf		("s_accumulator",	r2_RT_accum		);
		C.r_End				();
		break;
	case SE_L_NORMAL:		// normal
		C.r_Pass			("accum_volume",	"accum_spot_normal",		false,	FALSE,FALSE,blend,D3DBLEND_ONE,dest);
		C.r_Sampler_rtf		("s_position",		r2_RT_P);
		C.r_Sampler_rtf		("s_normal",		r2_RT_N);
		C.r_Sampler_clw		("s_material",		r2_material);
		C.r_Sampler			("s_lmap",			C.L_textures[0],false,D3DTADDRESS_CLAMP);
		if (b_HW_smap)		{
			if (b_HW_PCF)	C.r_Sampler_clf		("s_smap",r2_RT_smap_depth	);
			else			C.r_Sampler_rtf		("s_smap",r2_RT_smap_depth	);
		}
		else				C.r_Sampler_rtf		("s_smap",r2_RT_smap_surf	);
		jitter				(C);
		C.r_Sampler_rtf		("s_accumulator",	r2_RT_accum		);
		C.r_End				();
		break;
	case SE_L_FULLSIZE:		// normal-fullsize
		C.r_Pass			("accum_volume",	"accum_spot_fullsize",		false,	FALSE,FALSE,blend,D3DBLEND_ONE,dest);
		C.r_Sampler_rtf		("s_position",		r2_RT_P);
		C.r_Sampler_rtf		("s_normal",		r2_RT_N);
		C.r_Sampler_clw		("s_material",		r2_material);
		C.r_Sampler			("s_lmap",			C.L_textures[0],false,D3DTADDRESS_CLAMP);
		if (b_HW_smap)		{
			if (b_HW_PCF)	C.r_Sampler_clf		("s_smap",r2_RT_smap_depth	);
			else			C.r_Sampler_rtf		("s_smap",r2_RT_smap_depth	);
		}
		else				C.r_Sampler_rtf		("s_smap",r2_RT_smap_surf	);
		jitter				(C);
		C.r_Sampler_rtf		("s_accumulator",	r2_RT_accum		);
		C.r_End				();
		break;
	case SE_L_TRANSLUENT:	// shadowed + transluency
		C.r_Pass			("accum_volume",	"accum_spot_fullsize",		false,	FALSE,FALSE,blend,D3DBLEND_ONE,dest);
		C.r_Sampler_rtf		("s_position",		r2_RT_P);
		C.r_Sampler_rtf		("s_normal",		r2_RT_N);
		C.r_Sampler_clw		("s_material",		r2_material);
		C.r_Sampler_clf		("s_lmap",			r2_RT_smap_surf);			// diff here
		if (b_HW_smap)		{
			if (b_HW_PCF)	C.r_Sampler_clf		("s_smap",r2_RT_smap_depth	);
			else			C.r_Sampler_rtf		("s_smap",r2_RT_smap_depth	);
		}
		else				C.r_Sampler_rtf		("s_smap",r2_RT_smap_surf	);
		C.r_Sampler_rtf		("s_accumulator",	r2_RT_accum		);
		jitter				(C);
		C.r_End				();
		break;
	}
}
Example #4
0
void	CBlender_combine::Compile(CBlender_Compile& C)
{
	IBlender::Compile		(C);

	switch (C.iElement)
	{
	case 0:	// combine
		C.r_Pass			("combine_1",		"combine_1",		FALSE,	FALSE,	FALSE, TRUE, D3DBLEND_INVSRCALPHA, D3DBLEND_SRCALPHA);	//. MRT-blend?
		C.r_Sampler_rtf		("s_position",		r2_RT_P				);
		C.r_Sampler_rtf		("s_normal",		r2_RT_N				);
		C.r_Sampler_rtf		("s_diffuse",		r2_RT_albedo		);
		C.r_Sampler_rtf		("s_accumulator",	r2_RT_accum			);
		C.r_Sampler_rtf		("s_depth",			r2_RT_depth			);
		C.r_Sampler_rtf		("s_tonemap",		r2_RT_luminance_cur	);
		C.r_Sampler_clw		("s_material",		r2_material			);
		C.r_Sampler_clw		("s_occ",			r2_RT_ssao_temp		);
		C.r_Sampler_rtf		("s_half_depth",	r2_RT_half_depth);
		C.r_Sampler_clf		("env_s0",			r2_T_envs0			);
		C.r_Sampler_clf		("env_s1",			r2_T_envs1			);
		C.r_Sampler_clf		("sky_s0",			r2_T_sky0			);
		C.r_Sampler_clf		("sky_s1",			r2_T_sky1			);
		jitter(C);
		C.r_End				();
		break;
	case 1:	// aa-edge-detection + AA :)
		C.r_Pass			("null",			"combine_2_AA",		FALSE,	FALSE,	FALSE);
		C.r_Sampler_rtf		("s_position",		r2_RT_P);
		C.r_Sampler_rtf		("s_normal",		r2_RT_N);
		C.r_Sampler_clf		("s_image",			r2_RT_generic0);
		C.r_Sampler_clf		("s_bloom",			r2_RT_bloom1);
		C.r_Sampler_clf		("s_distort",		r2_RT_generic1);
		C.r_End				();
		break;
	case 2:	// non-AA
		C.r_Pass			("null",			"combine_2_NAA",	FALSE,	FALSE,	FALSE);
		C.r_Sampler_rtf		("s_position",		r2_RT_P);
		C.r_Sampler_rtf		("s_normal",		r2_RT_N);
		C.r_Sampler_clf		("s_image",			r2_RT_generic0);
		C.r_Sampler_clf		("s_bloom",			r2_RT_bloom1);
		C.r_Sampler_clf		("s_distort",		r2_RT_generic1);
		C.r_End				();
		break;
	case 3:	// aa-edge-detection + AA :) + DISTORTION
		C.r_Pass			("null",			"combine_2_AA_D",	FALSE,	FALSE,	FALSE);
		C.r_Sampler_rtf		("s_position",		r2_RT_P);
		C.r_Sampler_rtf		("s_normal",		r2_RT_N);
		C.r_Sampler_clf		("s_image",			r2_RT_generic0);
		C.r_Sampler_clf		("s_bloom",			r2_RT_bloom1);
		C.r_Sampler_clf		("s_distort",		r2_RT_generic1);
		C.r_End				();
		break;
	case 4:	// non-AA + DISTORTION
		C.r_Pass			("null",			"combine_2_NAA_D",	FALSE,	FALSE,	FALSE);
		C.r_Sampler_rtf		("s_position",		r2_RT_P);
		C.r_Sampler_rtf		("s_normal",		r2_RT_N);
		C.r_Sampler_clf		("s_image",			r2_RT_generic0);
		C.r_Sampler_clf		("s_bloom",			r2_RT_bloom1);
		C.r_Sampler_clf		("s_distort",		r2_RT_generic1);
		C.r_End				();
		break;
	case 5:	// post-processing
		break;
	}
}