Okay, here's what I've got.
In the .fx file, a copy and paste of the shader script:
Code:
//////////////////////////////////////////////
//multipass shader for volumetric glow for models
/////////////////////////////////////////////////
//by matt_aufderheide
//ps 1.1 vs 1.1
texture entSkin1; //model skin
texture entSkin2;//entskin2 is the glow map.. make it a very dark solid color
matrix matWorldViewProj;
matrix matWorld;
matrix matWorldView;
vector vecSkill1;
vector vecSkill41;
vector vecFog;
vector vecSunDir;
technique glow
{
pass p0
{
texture[0]=<entSkin1>;
zWriteEnable=false;
alphaBlendEnable=false;
vertexShaderConstant[0]=<matWorldViewProj>;
vertexShaderConstant[4]=<matWorld>;
vertexShaderConstant[8]=<matWorldView>;
vertexShaderConstant[16]=<vecSkill41>; // shell_distance, 0, fur_u_scale, fur_v_scale
vertexShaderConstant[17]={0.0,0.0,0.0,0.0}; // shell_number
vertexShaderConstant[19]=<vecSunDir>;
vertexShaderConstant[20]=<vecFog>;
vertexShaderConstant[94]=<vecSkill1>; // first_shell_brightness, brightness_increment, 0, 0
vertexShaderConstant[95]={0.5,1.0,2.0,0.0};
.......
Shortened
.......
mov r0,t0
};
}
pass p21 //this pass renders the model without the glow, so only the edgdes will glow..
{
texture[0]=<entSkin2>;
zWriteEnable=true;
alphaBlendEnable=false;
zenable=true;
Texture[0]=<entSkin1>;
ColorArg1[0]=Texture;
ColorOp[0]=Modulate;
ColorArg2[0]=Diffuse;
}
}
//in your main script
//material glowmodel
//{
// effect="glow.fx";
//}
//action anymodel{
// my.material=glowmodel;
// my.skill41 = float(0.3); // adjust the stength of the glow
//}
// the glow model needs two skins, the first is the diffuse map,
// the second can be very small (e.g. 16x16) and must be very dark, almost black
Then in my main script:
Code:
material glowmodel
{
effect="glow.fx";
}
function main()
{
time_smooth = 0.666;
randomize();
.....
And in the entity function:
Code:
function player_fighter()
{
player=my;
my.alive=1;
// my.bright = on;
breakpoint();
my.material = glowmodel;
my.skill41 = float(0.6); // adjust the stength of the glow
...
What's wrong with that?