|
Re: dot3 bumpmapping example
[Re: Drew]
#16998
10/27/03 10:56
10/27/03 10:56
|
Joined: Oct 2003
Posts: 4,131
Matt_Aufderheide
Expert
|
Expert
Joined: Oct 2003
Posts: 4,131
|
how do you actually ind a dynamic light?my nearest light function only seems to respond to statics.. Code:
function find_nearest_light()
{ temp.pan =360; temp.tilt=360; temp.z=3000; you=scan_entity(my.x,temp); if your.light==ON { temp.x = your.x; temp.y = your.y; temp.z = your.z; my.skill41=float(temp.x); my.skill42=float(temp.y); my.skill43=float(temp.z); my.skill44=float(1); return ; } } does this seem right? i am supposing that you cant find a dynamic light with scan_entity..but then how?
|
|
|
Re: dot3 bumpmapping example
[Re: Drew]
#16999
10/27/03 11:01
10/27/03 11:01
|
Joined: May 2002
Posts: 7,441
ventilator
Senior Expert
|
Senior Expert
Joined: May 2002
Posts: 7,441
|
hmmmm.... i tried but didn't work due to my limited knowledge of shaders...
pass p0
{
Texture[0]=<texSkin1>;
Texture[1]=<texSkin2>;
ZWriteEnable=true; // add these three lines
AlphaTestEnable=true;
CullMode=none;
...
PixelShader=
asm
{
ps.1.3
def c0,1,1,1,1
def c1,0,0,0,0
tex t0 // sample colormap
tex t1 // sample normalmap
mov r0,t0
cnd r0.a,r0.a,c0,c1
dp3 r1,t1_bx2,v0_bx2 // normal . light
mul r0.rgb,t0,r1
};
the transparency gets controlled with the alpha channel of the colormap. all alpha values less then 0.5 will be completely transparent and all values above 0.5 will be completely opaque. you have to experiment a little with the alphachannel to get the hang of it, but it works much better than normal overlays!
|
|
|
Re: dot3 bumpmapping example *DELETED*
[Re: Matt_Aufderheide]
#17002
10/27/03 11:20
10/27/03 11:20
|
Joined: May 2002
Posts: 7,441
ventilator
Senior Expert
|
Senior Expert
Joined: May 2002
Posts: 7,441
|
|
|
|
|