Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Quad, 1 invisible), 721 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 3
Page 2 of 4 1 2 3 4
Re: DX9 Toon shader [Re: Drew] #36509
11/21/04 00:37
11/21/04 00:37
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Quote:

wow, just tried it, fantastic...great addition thanks to both you and ventialator! I love the material_model, works like a charm.




Totally agree! Worked great for me!

Re: DX9 Toon shader [Re: Pappenheimer] #36510
11/21/04 07:41
11/21/04 07:41
Joined: Oct 2004
Posts: 1,856
TheExpert Offline
Senior Developer
TheExpert  Offline
Senior Developer

Joined: Oct 2004
Posts: 1,856
Sorry singleCell ;
that's my fault , the shading was here when i tested it , that just the sun doesn't move
it works great , it's a great cell shading shader , and yes your ressources files
(tga toon map and color map) are very helpull.
Great work and thanks again !

Re: DX9 Toon shader [Re: TheExpert] #36511
01/20/05 04:40
01/20/05 04:40
Joined: Dec 2004
Posts: 306
Planet Earth
Wiz Offline
Senior Member
Wiz  Offline
Senior Member

Joined: Dec 2004
Posts: 306
Planet Earth
I can't get this shader to work. All I get is black models. Anyone here that knows why?

I have an ATI x800 PRO and A6 Commercial v.6.31.4.

Re: DX9 Toon shader [Re: Wiz] #36512
01/21/05 12:38
01/21/05 12:38
Joined: Nov 2004
Posts: 832
United States, Utah
Braxton Offline
Developer
Braxton  Offline
Developer

Joined: Nov 2004
Posts: 832
United States, Utah
When I run it i get these errors:

< bmap_to_cubemap(mat_ToonShader.skin1)>
toonshaderdx9.wdl 22:0 Error(58): Parameter unknown mat_ToonShader keyword


and


< }>
toonshaderdx9.wdl 23:0 Error(96): Syntex error - nonexistent/empty function mtl_toon_int



BTW - I am using the A6 templates. And am using plBibed01.wdl as my movement script.


Can someone help me?!?!?!



Thanks in advanced,

Braxton


"The GREAT LAW: Life is and always will be justly ordered, and that all past experiences, good and bad, were the equitable out working of our evolving, yet unevolved selves" - As A Man Thinketh
Re: DX9 Toon shader [Re: Braxton] #36513
01/21/05 12:58
01/21/05 12:58
Joined: Nov 2004
Posts: 832
United States, Utah
Braxton Offline
Developer
Braxton  Offline
Developer

Joined: Nov 2004
Posts: 832
United States, Utah
Now I have a new problem. when i run the level my model is just black. Why is that???


Thanks in advanced,

Braxton

BTW - i fixed my last problems.




EDIT - Does this need Pro... cause i have commercial.

Last edited by Braxton; 01/21/05 13:16.

"The GREAT LAW: Life is and always will be justly ordered, and that all past experiences, good and bad, were the equitable out working of our evolving, yet unevolved selves" - As A Man Thinketh
Re: DX9 Toon shader [Re: Pappenheimer] #36514
01/21/05 13:29
01/21/05 13:29
Joined: Aug 2003
Posts: 448
Pluto
SlyBoots Offline
Senior Member
SlyBoots  Offline
Senior Member

Joined: Aug 2003
Posts: 448
Pluto
I'd give it more than two thumbs up, but I only have two.


3DSK Human Photo References for 3D Artists and Game Developers
Re: DX9 Toon shader [Re: SlyBoots] #36515
01/21/05 13:32
01/21/05 13:32
Joined: Nov 2004
Posts: 832
United States, Utah
Braxton Offline
Developer
Braxton  Offline
Developer

Joined: Nov 2004
Posts: 832
United States, Utah
My question is, why do I get this...


out of this code:

// Simple Toon Shader
// Works with vs1.1 and ps1.2 - so it will work on most cards
// Works with DX 9 so it works with the 6.30 and above
// This is a modified version of ventilators original Simple Toon shader.

// To make this work you copy this stuff or add ths script.
// You also need two image files:
// 1 - tsnormalise.tga - which will get made into a normalisation cube map
// 2 - A shade map that determines the level and numer of shade bands in the paint section
// By default this shader uses ts2tone.tga which gives two tone shading.

// Normaliser cubemap sprite
bmap bmp_normalizationcube=<tsnormalise.tga>;
// Paint shade map for toonshader
bmap bmp_tstonemap=<ts3tone.tga>; // <<< CHANGE THIS TO CHANGE PAINT SHADING

// This Starter function takes the normaliser sprite and convirts it to a D3D cubemap
// This function is started on game start and needs to occur before the toon shader will work
// It creates a cubemap and assigns it to the shaders skin1 texture.


entity* player;

// Ink and paint toon shader - Takes light direction from sun direction vector
material material_ToonShader
{
skin1=bmp_normalizationcube; // This is the normalisation cubemap created by the starter function
skin2=bmp_tstonemap; // This is the shademap that determines the "shading" of the paint part of the shader

effect
"
texture entSkin1; // The models skin texture
texture mtlSkin1; // The normalisation map
texture mtlSkin2; // The tone map
matrix matWorldViewProj;
matrix matWorld;
vector vecSunDir; // Sun direction vector

technique TwoToneToon
{
// -------------- Painter --------------------
pass p0
{
texture[0]=<mtlSkin1>; // The normalisation map
texture[1]=<mtlSkin2>; // The shade map
texture[2]=<entSkin1>; // The models skin texture

addressU[1]=clamp;
addressU[2]=wrap;
addressV[2]=wrap;
magFilter[2]=linear;
minFilter[2]=linear;
mipFilter[2]=linear;

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

vertexShader=asm
{
vs.1.1
dcl_position v0
dcl_normal v3
dcl_texcoord0 v7

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.xyz // output light direction to oT1
mov oT2.xy,v7.xy // output uvs to ot2
};
pixelShader=asm
{
ps.1.2
tex t0 // fetch normalized normal
texdp3tex t1,t0_bx2
tex t2 // sample color map
mul r0,t2,t1 // modulate with shading
};
}
// -------------- Outliner -------------------
pass p1
{
CULLMODE=CW;
vertexShaderConstant[0]=<matWorldViewProj>;
vertexShaderConstant[16]=0.8; // outline_thickness, def0.8 << CHANGE THIS TO CHANGE OUTLINE THICKNESS

vertexShader=asm
{
vs.1.1
dcl_position v0
dcl_normal v3
dcl_texcoord v7

mov r0,v0
mul r1,c16.x,v3 // Scale the normal
add r0.xyz,r0.xyz,r1.xyz // Shell offset (vertex pos + Scaled Normal)
m4x4 oPos,r0,c0 // Transorm position to clip space
};
pixelShader=asm
{
ps.1.1
def c0,0,0,0,5 // outline rgba << CHANGE THIS TO CHANGE OUTLINE COLOUR
mov r0,c0
};
}
} // End of technique

technique fallback // empty fallback causes normal rendering without outline
{
pass p0 { }
}
"; // end of effect
}


starter mtl_toon_init()
{
bmap_to_cubemap(material_ToonShader.skin1);
}


action Model_Me
{
player = me;

my.material = material_ToonShader;

while (1)
{
if (key_w == on)
{
c_move (my, nullvector, vector(5 * time,0,0), GLIDE);
}

if (key_a == on)
{
c_move (my, nullvector, vector(0,5 * time,0), GLIDE);
}

if (key_d == on)
{
c_move (my, nullvector, vector(0,-5 * time,0), GLIDE);
}

if (key_s == on)
{
c_move (my, nullvector, vector(-5 * time,0,0), GLIDE);
}

wait (1);
}
}



"The GREAT LAW: Life is and always will be justly ordered, and that all past experiences, good and bad, were the equitable out working of our evolving, yet unevolved selves" - As A Man Thinketh
Re: DX9 Toon shader [Re: Braxton] #36516
01/21/05 14:12
01/21/05 14:12
Joined: Jul 2004
Posts: 328
The Netherlands
JvsJGameDesign Offline
Senior Member - banned
JvsJGameDesign  Offline
Senior Member - banned

Joined: Jul 2004
Posts: 328
The Netherlands
Ehm.... Do you have a videocard that supports Pixelshader 1.1 or better?


Re: DX9 Toon shader [Re: JvsJGameDesign] #36517
01/21/05 14:25
01/21/05 14:25
Joined: Nov 2004
Posts: 832
United States, Utah
Braxton Offline
Developer
Braxton  Offline
Developer

Joined: Nov 2004
Posts: 832
United States, Utah
I don't know, how can I tell???


"The GREAT LAW: Life is and always will be justly ordered, and that all past experiences, good and bad, were the equitable out working of our evolving, yet unevolved selves" - As A Man Thinketh
Re: DX9 Toon shader [Re: Braxton] #36518
01/22/05 09:01
01/22/05 09:01
Joined: Nov 2004
Posts: 832
United States, Utah
Braxton Offline
Developer
Braxton  Offline
Developer

Joined: Nov 2004
Posts: 832
United States, Utah
I wish there was one for lower graphics cards!!!


"The GREAT LAW: Life is and always will be justly ordered, and that all past experiences, good and bad, were the equitable out working of our evolving, yet unevolved selves" - As A Man Thinketh
Page 2 of 4 1 2 3 4

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