Gamestudio Links
Zorro Links
Newest Posts
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
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, AndrewAMD), 822 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 1 of 14 1 2 3 13 14
Bump Mapping Shader #22140
01/16/04 22:22
01/16/04 22:22
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Ich habe mich mal daran versucht das Dot3 Bump Mapping aus "Shader Studio" in 3DGS zu übersetzten. Hat auch wunderbar geklappt und sieht toll aus.


(URL EDITED by Rhuarc)

hier ist der Code. Das Modell mit dem Bump Mapping muss als ersten Skin eine normale Textur haben und als zweiten Skin eine Normal Map.

Code:
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
};
}
}





Last edited by [Rhuarc]; 07/24/04 00:06.
Re: Bump Mapping Shader [Re: oliver2s] #22141
01/16/04 22:28
01/16/04 22:28
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
suppi!
ich denke mal du musst mit nem pixelshader die originaltextur nehmen und mit dem vertexshader-output "multiplizieren?" vielleicht mul_x2 oder so

tex t0;
mul_x2 r0,t0,v0 // bin kein crack, aber das würd ich als erstes versuchen..

Last edited by ello; 01/16/04 22:29.

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.
Re: Bump Mapping Shader [Re: ello] #22142
01/16/04 22:29
01/16/04 22:29
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Danke ello. Hab den Fehler schon gefunden und den Post Editiert, jetzt funzt es. Ich hab bei der 2ten Textur-Stage zweimal hintereinander Colorarg1 geschrieben.

Re: Bump Mapping Shader [Re: oliver2s] #22143
01/16/04 23:00
01/16/04 23:00
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
[Edited by Rhuarc] Code updated in first post.

Last edited by [Rhuarc]; 01/17/04 10:06.
Re: Bump Mapping Shader [Re: oliver2s] #22144
01/16/04 23:35
01/16/04 23:35
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
btw. this looks extremely near like what was shown here .
maybe you place a shot with texture?


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.
Re: Bump Mapping Shader [Re: ello] #22145
01/17/04 01:33
01/17/04 01:33
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Here's the same Texture with another model:


(URL EDITED by Rhuarc)

btw: the texture and the normal map is from ATI's Render Monkey.

Last edited by [Rhuarc]; 07/24/04 00:07.
Re: Bump Mapping Shader [Re: oliver2s] #22146
01/17/04 01:39
01/17/04 01:39
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
da fällt mir grade ne frage ein die mir schon lange aufm herzen liegt. sind normalmaps immer rot,grün und blau gefärbt?


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.
Re: Bump Mapping Shader [Re: ello] #22147
01/17/04 01:51
01/17/04 01:51
Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Captain_Kiyaku Offline

Dichotomic
Captain_Kiyaku  Offline

Dichotomic

Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
hi,

ich glaub ich bin einfach zu blöd das dingen einzufügen


Also was genau ist ne normal map? und muss ich den code einfach in die wdl kopieren oder mit
material blabla
{
effect=
"
//und hier dann den code einfügen=???


so hatte ich das vorhin gemacht, dann kam aber nen error mit video device blabla.

irgendwas mache ich falsch ^^


Sayonara!


My Blog

"Tag und Nacht schrei ich mich heiser,
Wind weht alle Worte fort,
Tag und Nacht schrei ich mein Krähenwort!"

Subway To Sally - Krähenkönig
Re: Bump Mapping Shader [Re: ello] #22148
01/17/04 01:54
01/17/04 01:54
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Ja, ich mach meine Normal Maps imemr mit ATI's "TGAtoDOT3" Programm. Es gibt auch noch so ein Tool für NVidia Karten, aber ich muss das ersten benutzten weil das andere mit meiner Readon 9600 Pro nicht funktioniert.

[EDIT]: Du musst ein neues Material machen:
Code:
MATERIAL dot3bump

{
effect
"
hier den oberen Code einfügen
";
}



Vielleicht unterstüzt auch deine Grafikkarte keinen VertexShader 1.0.

PS: das hier ist eine Normalmap (in der mitte):
http://www.stonehill-online.de/gfx/wip3.jpg

Last edited by oliver2s; 01/17/04 01:58.
Re: Bump Mapping Shader [Re: oliver2s] #22149
01/17/04 02:16
01/17/04 02:16
Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Captain_Kiyaku Offline

Dichotomic
Captain_Kiyaku  Offline

Dichotomic

Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
HI, ok vielen dank, werde das ganze gleich mal ausprobieren


Sayonara


My Blog

"Tag und Nacht schrei ich mich heiser,
Wind weht alle Worte fort,
Tag und Nacht schrei ich mein Krähenwort!"

Subway To Sally - Krähenkönig
Page 1 of 14 1 2 3 13 14

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