okay i have a grass alpha transparency script. Only problem is it has a clip range on it or something.the shader works when grass models are within a certain range/distance from the camera...
the models outside are clipped(sorta) theyre still theyre but its like a LOD has been added...I have no LOD's setup...so i dont understand why this is happening...
heres a picture of what im talking about

Code:
 

function init_mat_obj()
{	
	vec_set(mtl.emissive_blue,mat_model.emissive_blue);
	vec_set(mtl.ambient_blue,vector((d3d_fogcolor1.blue/2)+(mat_model.ambient_blue),(d3d_fogcolor1.green/2)+(mat_model.ambient_green),(d3d_fogcolor1.red/2)+(mat_model.ambient_red)));
	vec_set(mtl.diffuse_blue,mat_model.diffuse_blue);
	vec_set(mtl.specular_blue,mat_model.specular_blue);
	mtl.power = 0.3;//mat_model.power;
	mtl.albedo = 200;//mat_model.albedo;   
}




MATERIAL* mat_alphatrans_obj =
{

	event = init_mat_obj;

	effect = 
	"
	extern texture entSkin1;

	technique alphaTestMaterial
	{
		//				pass p0{
			//						
			//						zEnable = true;
			//						zWriteEnable=true;
			//						AlphaBlendEnable=false;
			//						alphaTestEnable=true;
			//						AlphaFunc=greater;
			//						AlphaRef=150;///////////////transparency threshold!
			//						cullMode=ccw;
		//				}
		
		
		pass p0
		{
			alphaBlendEnable = false;
			alphaTestEnable = true;
			zWriteEnable = true;
			AlphaRef=140;
		}
		pass p1
		{
			alphaBlendEnable = true;
			alphaTestEnable = false;
			zWriteEnable = false;
			zFunc = less;
		}
	}

	technique fallback
	{
		pass p0{
		Texture[0]=<entSkin1>;}
	}
	";
}




LINK:
Html:
http://s176.photobucket.com/albums/w172/boberic/?action=view&current=huh.jpg 


Last edited by not_me; 06/13/09 12:00.

-Initiate Games
-Level designer

http://www.sckratchmagazine.com