Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,633 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
DOT3 Problem #31038
07/23/04 19:54
07/23/04 19:54
Joined: Jan 2004
Posts: 620
Germany
TimeOut Offline OP
User
TimeOut  Offline OP
User

Joined: Jan 2004
Posts: 620
Germany
hab den Dot 3 Shader aus dem Forum genommen:


MATERIAL bumpmap
{
effect =
"
matrix matWorldViewProj;
matrix matWorld;

texture entSkin1;
texture entSkin2;

vector vecLight;

technique dot3map
{
pass p0
{
Texture[0] = <entSkin2>;//2te Skin im Model ist die Normal Map
Texture[1] = <entSkin1>;//1te Skin im Model ist die Textur

COLOROP[0] = dotproduct3;
COLORARG1[0] = texture;
COLORARG2[0] = diffuse;

COLOROP[1] = modulate;
COLORARG1[1] = texture;
COLORARG2[1] = current;

VertexShaderConstant[0]=<matWorldViewProj>;
VertexShaderConstant[4]=<matWorld>;
VertexShaderConstant[18]={1f,1f,1f,1f};
VertexShaderConstant[19]={0.5f,0.5f,0.5f,0.5f};
VertexShaderConstant[20]= <vecLight>;
VertexShaderConstant[30]={0f,1f,0f,0f};
VertexShaderConstant[31]={1f,0f,0f,0f};
VertexShaderConstant[32]={0f,0f,1f,0f};
VertexShaderConstant[90]={1f,0f,0f,0f}; //damit oFog gefüllt ist

VertexShader =
decl
{
stream 0;
float v0[3]; //Position
float v3[3]; //Normal
float v7[2]; //Textur Koordinaten 0
}
asm
{
vs.1.0
m4x4 oPos, v0, c0
m4x4 r10,v0,c4
m3x3 r8,v3,c4
mov oT0, v7
mov oT1, v7
mov oT2, v7
mov oT3, v7

//calculate texture space matrix from normal and up
mul r0,c31,v3.zxyw //-1,0,0
mul r1,c32,v3.yzxw //0,0,-1
sub r0,r1,r0

dp3 r0.w,r0,r0
rsq r0.w,r0.w
mul r0,r0,r0.w //normalized right vector

mov r1, c30 //0,-1,0
mov r2, r8

sub r9,c20,r10

dp3 r9.w,r9,r9
rsq r9.w,r9.w
mul r9,r9,r9.w //normalized light vector

m3x3 r3,r9,r0
mov r3.w,c30.w //transform light to texture space

add r3,r3,c18 //bias
mul r3,r3,c19//scale
mov oD0,r3
mov oFog,c90
};
}
}
";
}



action Shader_bumpmap
{
my.material=bumpmap;
}


Leider wird bei mir das Modell Transparent dargestellt. Obwohl der Transparent Flag deaktiviert ist.
Die 2 Skins hab ich ebenfalls drin, trotzdem klappts nich.


Athlon 64 3700+ 2048 MB DDR PC400 Dual Corsair XFX Geforce 7800 GT A6 Commercial 6.4
Re: DOT3 Problem [Re: TimeOut] #31039
07/23/04 20:32
07/23/04 20:32
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Die einzigste Ursache die mir einfällt ist das der Skin deines Modells *.tga Format hat und eine Alphakanal besitzt welcher das Modell transparent macht.

Re: DOT3 Problem [Re: TimeOut] #31040
07/23/04 20:40
07/23/04 20:40
Joined: Jan 2004
Posts: 620
Germany
TimeOut Offline OP
User
TimeOut  Offline OP
User

Joined: Jan 2004
Posts: 620
Germany
Danke, wahr tatsächlich eine Tga Datei. Hab ich glatt übersehen.


Athlon 64 3700+ 2048 MB DDR PC400 Dual Corsair XFX Geforce 7800 GT A6 Commercial 6.4
Re: DOT3 Problem [Re: TimeOut] #31041
07/25/04 20:33
07/25/04 20:33
Joined: Jan 2004
Posts: 620
Germany
TimeOut Offline OP
User
TimeOut  Offline OP
User

Joined: Jan 2004
Posts: 620
Germany
Nun noch ein Problem. Das Model mit der Bump Map ist an einem dunler wie am anderen:




Wie kann man das ändern. So viel ich weiß reagiert bump mapping nicht auf lichtquellen.


Athlon 64 3700+ 2048 MB DDR PC400 Dual Corsair XFX Geforce 7800 GT A6 Commercial 6.4
Re: DOT3 Problem [Re: TimeOut] #31042
07/26/04 00:46
07/26/04 00:46
Joined: Nov 2003
Posts: 1,267
ef
C
Christoph_B Offline
Serious User
Christoph_B  Offline
Serious User
C

Joined: Nov 2003
Posts: 1,267
ef
bumpmapping is gerade dazu da, um ein modell realistisch mit höhen und tiefen relativ zu lichtquellen darzustellen, da wäre es ja sinnlos, wenn es nicht auf lichtquellen reagieren würde.


sef
Re: DOT3 Problem [Re: TimeOut] #31043
07/27/04 09:29
07/27/04 09:29
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
Versuch mal hoehere Werte in der folgenden Zeile :
VertexShaderConstant[18]={1f,1f,1f,1f};
-> VertexShaderConstant[18]={2f,2f,2f,2f};


Moderated by  Blink, Hummel, Superku 

Gamestudio download | 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