Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 900 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Toon shader advice needed, pls help! #219583
08/03/08 12:39
08/03/08 12:39
Joined: Nov 2003
Posts: 1,659
San Francisco
JetpackMonkey Offline OP
Serious User
JetpackMonkey  Offline OP
Serious User

Joined: Nov 2003
Posts: 1,659
San Francisco
Hi there,

I need to use a toon shader in a night scene-- but everything I've managed with it looks simply bright and daytime, regardless of the brightness I set in the sun (e.g. 0 or -100).

Can someone please tell me a good way to get a night effect with a toon shader? Here's what I'm using..

Quote:

material mtl_toon
{
skin1=toonlookup_bmp;
effect =
"
matrix matWorldViewProj;
matrix matWorld;vector vecSunDir;
texture entSkin1;texture mtlSkin1;
technique t0{
pass p0 // shade it
{
zwriteenable= true;
zenable = true;
Texture[0]=<mtlSkin1>;
ColorOp[0]=Modulate;
ColorArg1[0]=Texture;
ColorArg2[0]=Texture;
AddressU[0]=Clamp;
AddressV[0]=Clamp;
AddressW[0]=Clamp;
TexCoordIndex[0]=0;
Texture[1]=<entSkin1>;
ColorOp[1]=Modulate;
ColorArg1[1]=Texture;
ColorArg2[1]=Current;
TexCoordIndex[1]=1;
VertexShaderConstant[0] = <matWorldViewProj>;
VertexShaderConstant[4] = <matWorld>;
VertexShaderConstant[7] = <vecSunDir>;

VertexShader = asm
{
vs_1_0
dcl_position v0
dcl_normal v3
dcl_texcoord0 v7
dcl_texcoord1 v8
mov oT2.xy, v7
dp4 oPos.x, c0, v0
dp4 oPos.y , c1, v0
dp4 oPos.z, c2, v0
dp4 oPos.w, c3, v0
dp3 r0.x, c4.xyz, v3.xyz
dp3 r0.y, c5.xyz, v3.xyz
dp3 r0.z, c6.xyz, v3.xyz
dp3 oT0.x, r0.xyz, -c7.xyz
mov oT1.xyz, v8
};
}

pass p1 // ink it
{
CULLMODE=CW;
vertexShaderConstant[0]=<matWorldViewProj>;
vertexShaderConstant[16]=0;//0.2; // outline thickness
vertexShader = asm
{
vs_1_0
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
m4x4 oPos,r0,c0
// Transorm position to clip space
mov oD0, c0
mov r0,c0
};
}
}
";
}


Re: Toon shader advice needed, pls help! [Re: JetpackMonkey] #219589
08/03/08 14:28
08/03/08 14:28
Joined: May 2006
Posts: 90
England
TigerTao Offline
Junior Member
TigerTao  Offline
Junior Member

Joined: May 2006
Posts: 90
England
Have you tried darkening down the toonlookup.bmp? So white is a darkish blue and then all others periodically darker until completely black.

Re: Toon shader advice needed, pls help! [Re: TigerTao] #219593
08/03/08 15:19
08/03/08 15:19
Joined: Nov 2003
Posts: 1,659
San Francisco
JetpackMonkey Offline OP
Serious User
JetpackMonkey  Offline OP
Serious User

Joined: Nov 2003
Posts: 1,659
San Francisco
Thanks Tiger, that worked great!

Re: Toon shader advice needed, pls help! [Re: TigerTao] #219594
08/03/08 15:21
08/03/08 15:21
Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
cro_games Offline
User
cro_games  Offline
User

Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
The best way is to dark down the toonlookup_bmp..I have create cartoon night scene once..

Last edited by cro_games; 08/03/08 15:22.

Hello everyone my name is Ivan Mandic from "Frozen pixel studio". wink
-----------------------------------
Homepage: www.fpx-studio.com
e-mail: emu_hunter_1990@hotmail.com
(working on a game engine)
Re: Toon shader advice needed, pls help! [Re: cro_games] #220133
08/06/08 02:37
08/06/08 02:37
Joined: Jul 2008
Posts: 223
Pittsburgh
The_Clyde Offline
Member
The_Clyde  Offline
Member

Joined: Jul 2008
Posts: 223
Pittsburgh
What if there were dark AND light places in a scene?

Is there a way to make the toonshader respond to level lighting the way the default shading does?

Re: Toon shader advice needed, pls help! [Re: The_Clyde] #220141
08/06/08 03:21
08/06/08 03:21
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
not with the wiki shader, but it is possible. one way is to use a ppe.

Re: Toon shader advice needed, pls help! [Re: lostclimate] #220236
08/06/08 14:53
08/06/08 14:53
Joined: Jul 2008
Posts: 223
Pittsburgh
The_Clyde Offline
Member
The_Clyde  Offline
Member

Joined: Jul 2008
Posts: 223
Pittsburgh
is it possible to add the black-outlining pass from the toon shader to the built-in shading used when no shader is specified?

Re: Toon shader advice needed, pls help! [Re: The_Clyde] #220240
08/06/08 15:11
08/06/08 15:11
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
well it is possible to do the built in shading in a shader, and add the line.

Re: Toon shader advice needed, pls help! [Re: lostclimate] #220348
08/07/08 05:16
08/07/08 05:16
Joined: Jul 2008
Posts: 223
Pittsburgh
The_Clyde Offline
Member
The_Clyde  Offline
Member

Joined: Jul 2008
Posts: 223
Pittsburgh
...what's the line? Where do I put it?

BTW, this is very helpful and I'm glad I didnt have to open up a new post on the same thing! laugh

Thanks!

Re: Toon shader advice needed, pls help! [Re: The_Clyde] #220389
08/07/08 06:20
08/07/08 06:20
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
well it wouldnt be up to you to add the line, you'd have to prolly beg a shader programmer to do it for you. I would but I have tons of work to do currently.

Page 1 of 2 1 2

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