Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by dr_panther. 05/18/24 11:01
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
2 registered members (7th_zorro, dr_panther), 724 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 7 1 2 3 4 5 6 7
Re: dot3 bumpmapping example [Re: ello] #16953
09/24/03 18:16
09/24/03 18:16
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
have you tried any other effect like environment mapping?

try this:
Code:
bmap cubemap=<skycube2.tga>;

material mat_cubemap
{
skin1=cubemap;
effect=
"
texture mtlSkin1;
texture texSkin1;
technique cubic_environment
{
pass p0
{
Texture[0]=<texSkin1>;
Texture[1]=<mtlSkin1>;

ColorArg1[0]=Texture;
ColorOp[0]=Modulate2x;
ColorArg2[0]=Diffuse;

ColorArg1[1]=Texture;
ColorOp[1]=AddSigned;
ColorArg2[1]=Current;

AddressU[1]=Clamp;
AddressV[1]=Clamp;
AddressW[1]=Clamp;
TexCoordIndex[1]=CameraSpaceReflectionVector;
TextureTransformFlags[1]=Count3;
}
}
";
}


...there is no function to convert a bitmap to a cubemap yet. your model will reflect skycube2.tga but the reflection won't look correct...

Re: dot3 bumpmapping example [Re: ventilator] #16954
09/24/03 18:24
09/24/03 18:24
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
thx, i'll give it a try when i'm back home and then i'll tell you what happens.


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: dot3 bumpmapping example [Re: ventilator] #16955
09/25/03 02:44
09/25/03 02:44
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
yes, now it works(strange look, as you mentioned, but it works). i dont know why, but after i tried your code the bumpmapping works,too. only thing i changed was that i now use .bmp files. could it be that my radeon card does not like tga-files?





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: dot3 bumpmapping example [Re: ello] #16956
09/25/03 02:46
09/25/03 02:46
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
it should also work with tgas! maybe it's a bug?

Re: dot3 bumpmapping example [Re: ventilator] #16957
09/25/03 03:59
09/25/03 03:59
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
24 bit TGAs are ok for bumpmapping. The image file format does not depend on the 3D card.

Re: dot3 bumpmapping example [Re: jcl] #16958
09/25/03 08:12
09/25/03 08:12
Joined: Jul 2003
Posts: 82
Southern California
lucidman Offline
Junior Member
lucidman  Offline
Junior Member

Joined: Jul 2003
Posts: 82
Southern California
The image shows Beta V6.11.3. Is this the latest beta? Where can I get It?

Thanks...


Vision is mind
Mind is emptiness
Empty is clear light
Clear light is union
Union is great bliss
Re: dot3 bumpmapping example [Re: lucidman] #16959
10/24/03 18:03
10/24/03 18:03
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
JCL- How did you get both textures to show?
When I use the beta bump code, only the bump shows up...plus the effect doesn't ssem to work, looks like a bump map looking texture apllied normally...no change in lighting across the raised areas...
Thanks


Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Re: dot3 bumpmapping example [Re: Drew] #16960
10/24/03 18:08
10/24/03 18:08
Joined: Aug 2003
Posts: 183
BionicHero Offline
Member
BionicHero  Offline
Member

Joined: Aug 2003
Posts: 183
Bump mapping (and maybe other effects too) don't work in the latest beta how they are supposed to because of a bug that inverts model normals.

Last edited by BionicHero; 10/24/03 18:08.
Re: dot3 bumpmapping example [Re: BionicHero] #16961
10/24/03 18:20
10/24/03 18:20
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
bummer..thanks for the info


Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Re: dot3 bumpmapping example [Re: Drew] #16962
10/25/03 07:14
10/25/03 07:14
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
you could try this diffuse per pixel lighting shader.

the first texture of the model has to be the color map, the second one the bumpmap. instead of converting the bumpmap to a normalmap within the engine you could also use a normalmap directly. then you don't need the bmap_to_normals line. there are plugins for photoshop and the gimp at the nvidia website which can convert bumpmaps to normalmaps. you could also generate normalmaps out of a high poly version of the model. ati provides a tool for that...

i think because of the normal vector bug in the current beta, the light (from the sun) seems to come from strange directions. but that could also be caused by a faulty shader, it's hard to say. i think i will wait for the next beta with correct normals before i do more shader experiments...

Code:

action myentity
{
bmap_to_normals(bmap_for_entity(my,1),16); // convert the bumpmap to a normalmap with scale factor 16
my.material=mat_diffuseperpixel;
...
}

material mat_diffuseperpixel
{
flags=tangent;
effect=
"
texture texSkin1;
texture texSkin2;
matrix matWorldViewProj;
matrix matWorld;
matrix matWorldView;
vector vecSunDir;
vector vecFog;

technique diffuseperpixel
{
pass p0
{
Texture[0]=<texSkin1>;
Texture[1]=<texSkin2>;

VertexShaderConstant[0]=<matWorldViewProj>;
VertexShaderConstant[4]=<matWorld>;
VertexShaderConstant[8]=<matWorldView>;
VertexShaderConstant[16]=<vecSunDir>;
VertexShaderConstant[17]=<vecFog>;
VertexShaderConstant[95]=(0.5f,0.0f,0.0f,0.0f);

VertexShader=
decl
{
stream 0;
float v0[3]; //position
float v3[3]; //normal
float v7[3]; //uv
float v8[3]; //tangent
}
asm
{
vs.1.1

m4x4 oPos,v0,c0
mov oT0,v7
mov oT1,v7

m3x3 r5,v8,c4 // transform tangent to world space
m3x3 r7,v3,c4 // transform normal to world space

mul r0,r5.zxyw,-r7.yzxw // tangent x normal -> binormal
mad r6,r5.yzxw,-r7.zxyw,-r0

dp3 r8.x,r5,-c16 // transform light vector to texture space
dp3 r8.y,r6,-c16
dp3 r8.z,r7,-c16
mad oD0.xyz,r8.xyz,c95.x,c95.x

mov r1.w,c17.w // r1.w=1
dp4 r0,v0,c10 // distance to camera position
add r0,r0,-c17.x // distance-fog_start
mad r0.x,-r0.x,c17.z,r1.w // 1-(distance-fog_start)*(1/(fog_end-fog_start))
max oFog.x,r0.x,c95.w // clamp with custom max value
};

PixelShader=
asm
{
ps.1.3
tex t0 // sample colormap
tex t1 // sample normalmap
dp3 r1,t1_bx2,v0_bx2 // normal . light
mul r0,t0,r1 // modulate against base color
};
}
}
";
}



Page 2 of 7 1 2 3 4 5 6 7

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