function normal_hq	(shader, t_base, t_second, t_detail)
	shader:begin	("model_def_hq","model_def_hq")
			: fog	(true)
	shader:sampler	("s_base")      :texture	(t_base)
	shader:sampler	("s_lmap")      :texture	(t_second) : clamp()
end

function normal		(shader, t_base, t_second, t_detail)
	shader:begin	("lmap","lmap")
			: fog	(true)
	shader:sampler	("s_base")    	:texture	(t_base)
	shader:sampler	("s_lmap")      :texture	(t_second)
end

function l_spot		(shader, t_base, t_second, t_detail)
	shader:begin	("lmap_spot","add_spot")
	  		: fog		(false)
			: zb 		(true,false)
			: blend		(true,blend.one,blend.one)
			: aref 		(true,0)
	shader:sampler	("s_base")    	:texture	(t_base)
	shader:sampler	("s_lmap")    	:texture	("internal\\internal_light_att")
			: clamp		()
			: f_linear 	()
			: project   	(true)
	shader:sampler	("s_att")    	:texture	("internal\\internal_light_attclip")
			: clamp		()
			: f_linear	()
end

function l_special	(shader, t_base, t_second, t_detail)
	shader:begin	("lmap_l","lmap_l")
	  		: fog		(false)
	shader:sampler	("s_base")      :texture	(t_base)
	shader:sampler	("s_lmap")      :texture	(t_second)
end

--[[
		LPCSTR	sname		= 0;
		LPCSTR	sname_ps	= 0;
		switch (C.iElement)
		{
		case SE_R1_NORMAL_HQ:	
			sname				= "model_def_hq"; 
			if (oBlend.value)	C.r_Pass	(sname,sname,TRUE,TRUE,TRUE,TRUE,D3DBLEND_SRCALPHA,	D3DBLEND_INVSRCALPHA,	TRUE,oAREF.value);
			else				C.r_Pass	(sname,sname,TRUE);
			C.r_Sampler			("s_base",	C.L_textures[0]);
			C.r_Sampler_clf		("s_lmap",	"$user$projector");
			C.r_End				();
			break;
		case SE_R1_NORMAL_LQ:
			sname				= "model_def_lq"; 
			if (oBlend.value)	C.r_Pass	(sname,sname,TRUE,TRUE,TRUE,TRUE,D3DBLEND_SRCALPHA,	D3DBLEND_INVSRCALPHA,	TRUE,oAREF.value);
			else				C.r_Pass	(sname,sname,TRUE);
			C.r_Sampler			("s_base",	C.L_textures[0]);
			C.r_End				();
			break;
		case SE_R1_LPOINT:
			break;
		case SE_R1_LSPOT:
			sname				= "model_def_spot";
			sname_ps			= "add_spot";
			if (oBlend.value)	C.r_Pass	(sname,sname_ps,FALSE,TRUE,FALSE,TRUE,D3DBLEND_ONE,	D3DBLEND_ONE,TRUE,oAREF.value);
			else				C.r_Pass	(sname,sname_ps,FALSE,TRUE,FALSE,TRUE,D3DBLEND_ONE, D3DBLEND_ONE,TRUE);
			C.r_Sampler			("s_base",	C.L_textures[0]);
			C.r_Sampler_clf		("s_lmap",	"internal\\internal_light_att",		true);
			C.r_Sampler_clf		("s_att",	"internal\\internal_light_attclip");
			C.r_End				();
			break;
		case SE_R1_LMODELS:
			break;
]]--