|
|
Re: Glow Shader (From Wiki)
[Re: broozar]
#65819
03/09/06 03:58
03/09/06 03:58
|
Joined: Mar 2003
Posts: 4,427 Japan
A.Russell
OP
Expert
|
OP
Expert
Joined: Mar 2003
Posts: 4,427
Japan
|
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?
|
|
|
Re: Glow Shader (From Wiki)
[Re: broozar]
#65821
03/10/06 11:45
03/10/06 11:45
|
Joined: Mar 2003
Posts: 4,427 Japan
A.Russell
OP
Expert
|
OP
Expert
Joined: Mar 2003
Posts: 4,427
Japan
|
Shouldn't be. Let me check...
...No, it wasn't that.
Could someone zip up a working example for me?
Last edited by A.Russell; 03/10/06 11:48.
|
|
|
Re: Glow Shader (From Wiki)
[Re: A.Russell]
#65822
03/11/06 09:22
03/11/06 09:22
|
Joined: Jun 2005
Posts: 4,875
broozar
Expert
|
Expert
Joined: Jun 2005
Posts: 4,875
|
sure. that´s my test level, you will need a ps/vs 2.0 graphics board for it. hope you don´t mind the stuff that´s in the level additionally, just have a look at the cone next to the furry lion. you can alter the stength of the glow by fiddling with the alpha channel. http://i.1asphost.com/gaardenier/test.cabit´s a *.cab, you need winRAR or filzip or equivalent.
|
|
|
|