grass problem?

Posted By: not_me

grass problem? - 06/13/09 11:56

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 

Posted By: not_me

Re: grass problem? - 06/16/09 20:37

*bump* anyone? it looks like its clipping off the alpha channel...
Posted By: not_me

Re: grass problem? - 06/29/09 06:33

*BUMP* is ther no one who can help me figure this out? I need a knight in shining armor...I've been trying for weeks to fix this. I cant wrap my brain around it...
Posted By: not_me

Re: grass problem? - 07/05/09 05:57

Is there no one that can help me solve this problem..??
Posted By: bart_the_13th

Re: grass problem? - 07/05/09 06:50

Add mip map will help I guess... Use bmap_to_mipmap, sorry I forgot the whole code, but you can find it in the manual.
Posted By: not_me

Re: grass problem? - 08/13/09 04:35

okay so i did some experimenting and found that its not the code for the grass. It has something to do wither with the multi terrain texturing script or the textures used....i dont know yet. still looking into it.
© 2024 lite-C Forums