Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, SBGuy, Petra), 801 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 5 of 14 1 2 3 4 5 6 7 13 14
Re: Bump Mapping Shader [Re: RAFU] #22180
01/23/04 07:52
01/23/04 07:52
Joined: Oct 2000
Posts: 1,543
Germany
A
Alexander Esslinger Offline
Senior Developer
Alexander Esslinger  Offline
Senior Developer
A

Joined: Oct 2000
Posts: 1,543
Germany
DirectX 8 supports bumpmapping even in the fixed function pipeline. This technique uses interpolated data from the vertices and does not look as specular as per-pixel bumpmapping does.

Re: Bump Mapping Shader [Re: jcl] #22181
01/24/04 08:42
01/24/04 08:42
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
Quote:

This is the default render setting used by the engine:

Models, sprites, and flat textures:

SetTexture(0,Skin);
SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_MODULATE2X);
SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_TEXTURE); // entity texture
SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_DIFFUSE); // lighting




but how does the engine calculate the diffuse value? ...in case i want to do that myself in the vertex shader...

Re: Bump Mapping Shader [Re: Alexander Esslinger] #22182
01/24/04 18:44
01/24/04 18:44
Joined: Nov 2003
Posts: 698
England, UK
A
Aaron_H Offline
User
Aaron_H  Offline
User
A

Joined: Nov 2003
Posts: 698
England, UK
Thanks Alexander, I understand now.
So this is just a better looking more enhanced Bump Mapping technique...


Re: Bump Mapping Shader [Re: Aaron_H] #22183
01/25/04 09:55
01/25/04 09:55
Joined: Mar 2003
Posts: 1,524
Canada
Stansmedia Offline
Serious User
Stansmedia  Offline
Serious User

Joined: Mar 2003
Posts: 1,524
Canada
I tried that bump mapping code. But it gave me an error message when I looked at it: BUMP MAPPING: NOT SUPPORTED BY HARDWARE...
Not supported my ass, ive got a geforce 4 128 mb of vram. Like, my max has bump mapping and stuff, so why is 3dgs complaining? Can somebody help? I want shaders

(im a total shader noob btw... so, help is good )


Decessus - 80% done. 100% abandoned.
GET MY ANDROID GAME! https://play.google.com/store/apps/details?id=com.lasertrain.zspinballfree&hl=en
Re: Bump Mapping Shader [Re: Drew] #22184
01/29/04 06:07
01/29/04 06:07
Joined: Oct 2003
Posts: 88
Ultra Offline
Junior Member
Ultra  Offline
Junior Member

Joined: Oct 2003
Posts: 88
Quote:

works great! even has proper lighting in shadows...

here is the code, with action and material (for shader newbies like me)

Code:
 

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






Hi, I copied this code and apparently can't get it to work.



any idea why i get this error? (and yes, if you haven't guessed, I'm quite the noob)

Re: Bump Mapping Shader [Re: Ultra] #22185
01/29/04 07:17
01/29/04 07:17
Joined: Oct 2003
Posts: 1,258
Virginia, USA
qwerty823 Offline
Senior Developer
qwerty823  Offline
Senior Developer

Joined: Oct 2003
Posts: 1,258
Virginia, USA
Its missing an '=' for starters. (In red)

Code:

MATERIAL bumpmap
{
effect=
"
matrix matWorldViewProj;




Never argue with an idiot. They drag you down to their level then beat you with experience
Re: Bump Mapping Shader [Re: qwerty823] #22186
01/29/04 10:25
01/29/04 10:25
Joined: Oct 2003
Posts: 88
Ultra Offline
Junior Member
Ultra  Offline
Junior Member

Joined: Oct 2003
Posts: 88
Unfortunately, adding '=' did nothing different

Re: Bump Mapping Shader [Re: Ultra] #22187
01/29/04 12:34
01/29/04 12:34
Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
Drew Offline
Serious User
Drew  Offline
Serious User

Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
thats exactly my code and it works, so it must be something different... ill look at it.
can you post your code if its different from above?
or pm it to me...


Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Re: Bump Mapping Shader [Re: Ultra] #22188
01/29/04 14:23
01/29/04 14:23
Joined: Oct 2003
Posts: 1,258
Virginia, USA
qwerty823 Offline
Senior Developer
qwerty823  Offline
Senior Developer

Joined: Oct 2003
Posts: 1,258
Virginia, USA
I noticed from your profile you have 6.11. Is it Commercial or Pro? Only Commercial and Pro support shaders.

You might want to grab 6.20 upgrade, since 6.11 might not support shaders.


Never argue with an idiot. They drag you down to their level then beat you with experience
Re: Bump Mapping Shader [Re: qwerty823] #22189
01/29/04 14:42
01/29/04 14:42
Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
Drew Offline
Serious User
Drew  Offline
Serious User

Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
I use 6.2 commercial, just never updated my profile... thanks


Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Page 5 of 14 1 2 3 4 5 6 7 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