Hi conitec,

I create a decal in a while (1) loop for visualising a mouse selection radius. I use this code:

Code:
			vec_set(temp_vec,camera.x);
		   vec_set(temp2_vec,mouse_dir3d);
         vec_scale(temp2_vec,5000);
         vec_add(temp_vec,temp2_vec);
         you = NULL;
			result = c_trace(camera.x,temp_vec,IGNORE_YOU|IGNORE_PASSABLE|USE_POLYGON | SCAN_TEXTURE);
			if (you != my || result == 0) { wait(1); continue; }
			my_pp = ent_decal(my,sel_rad,pencil_vars[0],0); my_pp.lifespan = 0.001;
			my_pp.material = decal_mat;
 

my_pp is a local PARTICLE* pointer.
decal_mat looks like this:
Code:
 MATERIAL* decal_mat = {
	ambient_red = 255;
	ambient_green = 255;
	ambient_blue = 255;
} 


I create the decals on a terrain that uses a multitexturing shader. At the beginning of my test the decal looks all right. Then I change the shader of the terrain (it's cloned by the way) using effect_load on the terrain's material (not on decal_mat of course). Once I do this the decals are always created with the terrain's shader settings applied (it even uses their mtlskins) altough every decal is given the decal_mat as material at the creation. I have particle_mode at 8.

Last edited by RedPhoenix; 08/12/08 20:00.