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
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,534 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Shaders not showing #39820
01/20/05 03:12
01/20/05 03:12
Joined: Dec 2004
Posts: 306
Planet Earth
Wiz Offline OP
Senior Member
Wiz  Offline OP
Senior Member

Joined: Dec 2004
Posts: 306
Planet Earth
I've been trying out a lot of shaders recently and some of the ones with demos works perfectly, but when I try to put them in myself almost everyone turns out completely black. I've tried multiple cartoon shaders and the only effect it has to my models when I attach them is to turn them to a complete black color. Is there something I miss in my code maybe?

I have a ATI x800 PRO with the newest drivers and A6 Commercial v.6.31.4

Re: Shaders not showing [Re: Wiz] #39821
01/21/05 05:47
01/21/05 05:47
Joined: Dec 2004
Posts: 306
Planet Earth
Wiz Offline OP
Senior Member
Wiz  Offline OP
Senior Member

Joined: Dec 2004
Posts: 306
Planet Earth
No one have a clue? Anybody that have had a similar problem?

Re: Shaders not showing [Re: Wiz] #39822
01/21/05 05:53
01/21/05 05:53
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
do you have the right skins for your models?

Re: Shaders not showing [Re: Joey] #39823
01/24/05 02:50
01/24/05 02:50
Joined: Dec 2004
Posts: 306
Planet Earth
Wiz Offline OP
Senior Member
Wiz  Offline OP
Senior Member

Joined: Dec 2004
Posts: 306
Planet Earth
I have used the models that came with the shaders, and in other cases like with the toon shader it is said that could use the c_babe model, but all turns out black.

Re: Shaders not showing [Re: Wiz] #39824
01/24/05 02:59
01/24/05 02:59
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
could you show the complete code for shader & model?

Re: Shaders not showing [Re: Joey] #39825
01/24/05 03:16
01/24/05 03:16
Joined: Dec 2004
Posts: 306
Planet Earth
Wiz Offline OP
Senior Member
Wiz  Offline OP
Senior Member

Joined: Dec 2004
Posts: 306
Planet Earth


This is what I get with and without material. And here comes the code:

toonshaderdx9.wdl:

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=<ts2tone.tga>; // <<< CHANGE THIS TO CHANGE PAINT SHADING



// Ink and paint toon shader - Takes light direction from sun direction vector
material mat_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,1 // 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
}

// 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.
starter mtl_toon_init()
{
bmap_to_cubemap(mat_ToonShader.skin1);
}



Re: Shaders not showing [Re: Wiz] #39826
01/28/05 16:08
01/28/05 16:08
Joined: Dec 2004
Posts: 306
Planet Earth
Wiz Offline OP
Senior Member
Wiz  Offline OP
Senior Member

Joined: Dec 2004
Posts: 306
Planet Earth
Should I take this as nobody has found any errors in the code?


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