Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 1,395 guests, and 12 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Toonshader on level blocks? #60570
12/15/05 14:41
12/15/05 14:41
Joined: Apr 2005
Posts: 64
Italy - Rome
_
_Tommo_ Offline OP
Junior Member
_Tommo_  Offline OP
Junior Member
_

Joined: Apr 2005
Posts: 64
Italy - Rome
I have a toonshader in assembly that works on models (if i remember well i downloaded it from the wiki), but i want to convert it to work on level blocks:
Code:
 texture entSkin1;
texture entskin2;
texture mtlSkin1;
texture mtlSkin2;

matrix matWorldViewProj;
matrix matWorld;
vector vecSkill1;
vector vecSkill5;
vector vecSunDir;

technique toon
{
//---------------------------------------------------------------------------paint
pass p0
{
// texture[0]=<mtlSkin1>;
// texture[1]=<mtlSkin2>;
// texture[2]=<entSkin1>;
// texture[3]=<entskin2>;

texture[0]=<entSkin1>; //colormap
texture[1]=<entskin2>; //shadowmap
texture[2]=<mtlSkin1>; //normalizationcube
texture[3]=<mtlSkin2>; //toonlookup


AlphaBlendEnable = false;

addressU[3]=clamp;

// magFilter[1]=point;
// minFilter[1]=point;
// mipFilter[1]=point;
magFilter[0]=linear;
minFilter[0]=linear;
mipFilter[0]=linear;

vertexShaderConstant[0]=<matWorldViewProj>;
vertexShaderConstant[4]=<matWorld>;

//vertexShaderConstant[16]=<vecSunDir>;
vertexShaderConstant[16]=<vecSkill1>;

vertexShader=
asm
{
vs.1.1

dcl_position v0
dcl_normal v3
dcl_texcoord1 v7 //color uv

m4x4 oPos,v0,c0 // transform position to clip space

m3x3 r0,v3,c4 // transform normal to world space
dp3 r0.w,r0,r0 // renormalize it
rsq r0.w,r0.w
mul r0,r0,r0.w
mov oT0.xyz,r0.xyz // output normal to oT0
mov oT1.xyz,-c16 // output light direction to oT1
mov oT2.xy,v7.xy // output uvs to oT2
};
pixelShader=
asm
{
ps.1.3

tex t0 // sample color map
tex t1 //shadow
tex t2 // fetch normalized normal
texdp3tex t3,t2_bx2 // light.normal=u -> use u to lookup in t1 // _bx2 -> 0..1 of normcube will be -1..1

//
mul r0, t0, t1 //mul shadow with colormap
mul r0, t3, r0 // modulate with shading

};
}
//---------------------------------------------------------------------------ink
pass p1
{
cullMode=cw;
vertexShaderConstant[0]=<matWorldViewProj>;
vertexShaderConstant[16]=<vecSkill1>; // outline_thickness, 0, 0, 0

AlphaBlendEnable = false;

vertexShader=
asm
{
vs.1.1

dcl_position v0
dcl_normal v3
dcl_texcoord1 v7 //color uv

mov r0,v0
mul r1,c16.x,v3 // scale normal
add r0.xyz,r0.xyz,r1.xyz // shell offset (vertex position + scaled normal)
m4x4 oPos,r0,c0 // transform position to clip space
};
pixelShaderConstant[0] = <vecSkill5>;
pixelShader=
asm
{
ps.1.3
mov r0,c0
};
}
}



I use it for all the mat_shaded blocks with effect_load, it hasn't sintax errors, but i can't see the shadows, the shadowmap and the black outlines.
It doesn't work because of blocks? And (maybe this is an offtopic) are there tools to export a .map to .mdl? This way i could use on the map the normal shader. Thanks, Tommaso.

Re: Toonshader on level blocks? [Re: _Tommo_] #60571
12/15/05 14:48
12/15/05 14:48
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
better dont do this. simply use the right texture there.
blocks and shaders are fps-killaz


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1