Gamestudio Links
Zorro Links
Newest Posts
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
2 registered members (Ayumi, 1 invisible), 584 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
bumpmapping /geforce2ultra #20950
12/09/03 01:35
12/09/03 01:35
Joined: Dec 2003
Posts: 8
C
ChristianL Offline OP
Newbie
ChristianL  Offline OP
Newbie
C

Joined: Dec 2003
Posts: 8
Hallo
Ist es möglich bumpmapping(oder ein ähnlicher effect) mit einer geforce2ultra darzustellen?
wenn ja, hat jemand ein script oder tutorials wo das erklährt ist?

mfG
Christian

english:
Hello
Is it possible to have bumpmapping(or another effect like bumpmapping) with a geforce2ultra ?
if it is, has somebody a script or a tutorial, where it is explained?

sorry for my bad english!

mfG
Christian

Re: bumpmapping /geforce2ultra [Re: ChristianL] #20951
12/09/03 01:47
12/09/03 01:47
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
i believe G3Force 2 supports fixed-function Dot 3 bump mapping.. this isnt as impressive as perpixel normal mapping but is still reasonable.. in this case you can use the use the dot 3 technnique included with the 6.2


Sphere Engine--the premier A6 graphics plugin.
Re: bumpmapping /geforce2ultra [Re: Matt_Aufderheide] #20952
12/09/03 23:21
12/09/03 23:21
Joined: Dec 2003
Posts: 8
C
ChristianL Offline OP
Newbie
ChristianL  Offline OP
Newbie
C

Joined: Dec 2003
Posts: 8
Thank you for your help, but I didn't get it to work!
here is my script:

bmap reptile = <scales.bmp>;

material mat_bump
{
skin2 = reptile; // set a reptile skin
scale1 = 0.2; // factor for the skin scale at stage 0

// define a material effect string
effect = "

// declare the used textures and variables
texture entSkin1; // the entity skin
texture mtlSkin2; // the bump map
dword mtlSkill1; // the light vector

// default technique
technique bump_dot3
{
pass P0
{
// set texture stage states
Texture[0] = <mtlSkin2>;
Texture[1] = <entSkin1>;
TextureFactor = <mtlSkill1>;

ColorArg1[0] = Texture; // stage 0 = bumpmap
ColorOp[0] = DotProduct3;
ColorArg2[0] = TFactor;

ColorArg1[1] = Texture; // stage 1 - skin texture
ColorOp[1] = AddSigned;
ColorArg2[1] = Current;

ColorArg1[2] = Diffuse; // stage 2 - lighting
ColorOp[2] = Modulate2x;
ColorArg2[2] = Current;
}
}

// fallback technique for devices that do not support bumpmapping
// technique fallback
//{
// pass P0
//{
// set texture stage states
// Texture[0] = <entSkin1>;

// ColorArg1[0] = Texture; // stage 0 = skin texture
// ColorOp[0] = Modulate2x;
// ColorArg2[0] = Diffuse; // modulate by lighting
//}
//}
"; // end of the effect string
}

starter mat_bump_init {
// initialize the material properties
vec_set(mat_bump.ambient_blue,mat_model.ambient_blue);
vec_set(mat_bump.diffuse_blue,mat_model.diffuse_blue);
vec_set(mat_bump.specular_blue,mat_model.specular_blue);
mat_bump.power = mat_model.power;
// create the normals map for DOT3 bumpmapping
bmap_to_normals(mat_bump.skin2,2);
// set a lighting vector for DOT3 bumpmapping
mat_bump.skill1 = pixel_for_vec(vector(200,200,200),100,8888);
}


action dot3bumpmapping
{
my.material = mat_bump;
}

Is there something wrong in it?

mfG
Christian

Re: bumpmapping /geforce2ultra [Re: ChristianL] #20953
12/19/03 02:12
12/19/03 02:12
Joined: Aug 2003
Posts: 145
Beorn Offline
Member
Beorn  Offline
Member

Joined: Aug 2003
Posts: 145
Christiani,
I have a GF2mobile and i cant use three texturestages on this, maybe this is your problem.

Try commenting out this part:

ColorArg1[2] = Diffuse; // stage 2 - lighting
ColorOp[2] = Modulate2x;
ColorArg2[2] = Current;

And see if that works. If it does youll have to find a workaround which i am to lousy to help you with. But maybe Matt, Vent, or some other shader superstar might be able to give some hints.


Re: bumpmapping /geforce2ultra [Re: Matt_Aufderheide] #20954
12/19/03 11:25
12/19/03 11:25
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
Quote:

i believe G3Force 2 supports fixed-function Dot 3 bump mapping.. this isnt as impressive as perpixel normal mapping but is still reasonable.. in this case you can use the use the dot 3 technnique included with the 6.2




How does per pixel normal mapping differ from regular dot3 bumpmaps ?

Re: bumpmapping /geforce2ultra [Re: Marco_Grubert] #20955
12/19/03 11:36
12/19/03 11:36
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
i think with fixed function dot3 bumpmapping it isn't possible to transform the light vector to texture space at every vertex. it doesn't look right on non-planar models with different surface normals.

Re: bumpmapping /geforce2ultra [Re: ventilator] #20956
12/19/03 12:30
12/19/03 12:30
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
Yes thats correct.. dot3 is simply an instruction that has been implemented in the fixed function pipeline.. the dot product is the basis for the bump mapping effect..i dont quite understand the maths but it manipulates the matrices to approximate lighting effects from a normal map. GeForce 2 has the dot3 instruction..but since it doesnt have pixel shader support, you cant do as Ventilator has said.. so.. the standard bump mapping looks fine as long as you use a constant light vector.. as soon as you change it it will get messed up. Also it doesnt allow for the per-pixel lighting.. without which bump mapping is underwhelming anyway.


Sphere Engine--the premier A6 graphics plugin.
Re: bumpmapping /geforce2ultra [Re: ventilator] #20957
12/20/03 06:34
12/20/03 06:34
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
Quote:

i think with fixed function dot3 bumpmapping it isn't possible to transform the light vector to texture space at every vertex. it doesn't look right on non-planar models with different surface normals.



Ah..that makes sense. So you do have per-pixel bumpmapping, but the light vector is only approximated per triangle rather than per vertex.

Re: bumpmapping /geforce2ultra [Re: Marco_Grubert] #20958
12/20/03 07:12
12/20/03 07:12
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
if i understand this correctly it isn't approximated at all. it's simply in the wrong space for the lighting calculation.

maybe it would be possible to use a normal map with world space normals somehow but i guess such a normal map would be trickier to generate? then transforming the light vector wouldn't be needed.

Re: bumpmapping /geforce2ultra [Re: ventilator] #20959
12/20/03 09:13
12/20/03 09:13
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
Yes you could transform your normal map into worldspace but for animated objects that would be too slow since you effectively had to create tons of new textures every frame.
The DOT3 operator for a texture stage is often used in conjunction with a vector constant. So you would take your light vector (world space), convert it into UV space for the triangle at hand and then use this vector constant for rendering the triangle. There used to be a whitepaper on nvidia's site outlining all this and how to extend it to point lightsources.


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