Huh, that's an effect. It's just setting those shaders to the material.

MATERIAL* road_shader = {}


function shader_static()
{
my.material = static_shader;

if(lightmap_level == 1){static_shader.effect = "multitex4_ps1_0sha.fx";}
if(lightmap_level != 1){static_shader.effect = "detail_staticmesh.fx";}

static_shader.ambient_red = static_ambient.x;
static_shader.ambient_blue = static_ambient.y;
static_shader.ambient_green = static_ambient.z;

static_shader.diffuse_red = static_diffuse.x;
static_shader.diffuse_blue =static_diffuse.y;
static_shader.diffuse_green = static_diffuse.z;
}

This works the same as effect_load(), with the difference of it being more flexible. Although, I don't see what this has to do with the decal material not working properly, and this code is just for the ground anyways.

Here is the decal code:


vec_set(trace_height.x,vector(0,0,0)); vec_add(trace_height.x,my.x); //initial trace detects for walls/terrain
//target = 0; vec_set(temp_vec, you.x); temp_vec.z -= 4000;
trace_height.z += 20;// effect_local(exhuast2, 12*time_step+1, trace_height.x, nullvector);

vec_set(temp_vec.x,vector(0,0,-35000)); vec_add(temp_vec.x,my.x); //initial trace detects for walls/terrain

result = c_trace(trace_height.x, temp_vec.x, IGNORE_ME+IGNORE_SPRITES+IGNORE_PASSABLE+USE_POLYGON+IGNORE_PASSENTS+ SCAN_TEXTURE);
//result -= 20;

if(you != NULL)
{
PARTICLE *par;
par = ent_decal(you, d_shadow, 0, my.pan - you.pan);

par.material = mat_model;
set(par, TRANSLUCENT);
par.alpha = 70;
par.lifespan = 0.001;
}


Check out Silas. www.kartsilas.com

Hear my band Finding Fire - www.myspace.com/findingfire

Daily dev updates - http://kartsilas.blogspot.com/