save the above shader as grass.fx and use this script:


material mat_grass{}

starter update_grass
{
effect_load(mat_grass,"grass.fx");
}

on_m=update_grass;

i did it this way because then it's possible to edit the parameters of the shader while the engine is running and update the effect with the m key.