Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,549 guests, and 14 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Two shader questions (Easy ones I'm sure) #30944
07/22/04 18:02
07/22/04 18:02
Joined: Oct 2002
Posts: 955
danthaman015 Offline OP
Developer
danthaman015  Offline OP
Developer

Joined: Oct 2002
Posts: 955
I'm still a noob to shaders. Mostly because I hate having to create small test levels and set up all those scripts and stuff. Too much hassle for me. Never goes right. Anywho, I need two questions answered:

1) Is there anyway to create a normal map, (I think that's what it's called) or if not then the image that is used for the second skin in a model that looks weird that shows how high and deep the model needs to be bumpmapped, or whatever, from an image? Everywhere I see how to do it, you need a high poly model and a low poly model. How come I can't just make it from an image, because a lot of image programs have a button called "Bumpmap" where it raises the surfaces on the picture like a bumpmap was applied. So then why can't I do that with a model's skin?

2) How do I go about making a model look shiny with a shader? With a little bit of reflectiveness in it, or do I just use environment mapping for that? And if so, then how do I do that?


Sorry for the questions. Just a shader noob...


-Dan


**On break**

Re: Two shader questions (Easy ones I'm sure) [Re: danthaman015] #30945
07/22/04 20:20
07/22/04 20:20
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
1) Yes, you can create normalmaps from height-maps.
2) Depends on what you want to do. Normally for reflecting the environment it's environment mapping, but maybe simple specular-lighting will be enough.

Re: Two shader questions (Easy ones I'm sure) [Re: Alexander Esslinger] #30946
07/23/04 06:37
07/23/04 06:37
Joined: Oct 2002
Posts: 955
danthaman015 Offline OP
Developer
danthaman015  Offline OP
Developer

Joined: Oct 2002
Posts: 955
1) So then how do I do that?

2) So how do I do this too lol?


**On break**

Re: Two shader questions (Easy ones I'm sure) [Re: danthaman015] #30947
07/24/04 09:51
07/24/04 09:51
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
1). You can convert your bmap to a normalmap with a converter. For instance,
ATI Normalmap gen , or a plugin from NVIDIA for Photoshop. Then just either load it as is in a mtlSkin or as an entSkin

If you don't want to use a third-party utility to convert to the normalmap, you can just load your greyscale bmap as a mtlSkin and pass it through this command in your script:
bmap_to_normals(mtl.skin1,2);

2). As Alexander said, it depends on the effect you are trying to achive as to what one you want to use.

Here is an effect file that does simply a little specular type thing with a lightmap. Nothing fancy but it does something.

Code:
 ///////////////////////////////////////////////////////////////////////////
// Steempipes cheesy attempt at a very basic specular lightmap
//
//


material mtl_simpleshine
{


effect = "

texture entSkin1; // The Specular Light Map in a greyscale 24bpp format
texture entSkin2; // The Base Skin Color Map in RGB 24bpp format

technique simpleshine
{

pass p0
{


magFilter[0]=linear;
minFilter[0]=linear;
mipFilter[0]=linear;

magFilter[1]=linear;
minFilter[1]=linear;
mipFilter[1]=linear;


Texture[0]=<entSkin2>;

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

TextureTransformFlags[0] =count3;
TexCoordIndex[0]= CameraSpaceReflectionVector|0;



Texture[1]=<entSkin1>;


Colorarg1[1] = Texture;
ColorArg2[1] = Current;
ColorOp[1] = Add;

TextureTransformFlags[1] =count2;
TexCoordIndex[1]=1;



} //End of pass

} // End of Technique

"; // End of Effect

} // End of Material


/////////////////////////////////////////
// Action to Assign Our Entity
//
//
Action Simple_Shine
{

//my.unlit=on;
my.metal=on;
my.material=mtl_simpleshine;

}


///////////////////////////////////////////////////////////////////////////////
// End
//
//



The base skin:


The Specular Light Map:

Here is just the skin:


Here is with some speclight:



Because of the "CameraSpaceReflectionVector" the speclights will move with the view.

Re: Two shader questions (Easy ones I'm sure) [Re: Steempipe] #30948
07/24/04 14:28
07/24/04 14:28
Joined: Oct 2002
Posts: 955
danthaman015 Offline OP
Developer
danthaman015  Offline OP
Developer

Joined: Oct 2002
Posts: 955
Ahh thank you Steempipe, all works well. Now I can get started on shaders...


Once again, thanks

-Dan


**On break**

Re: Two shader questions (Easy ones I'm sure) [Re: danthaman015] #30949
09/01/04 15:17
09/01/04 15:17
Joined: Jul 2004
Posts: 1,710
MMike Offline
Serious User
MMike  Offline
Serious User

Joined: Jul 2004
Posts: 1,710
Just one thing.. Can someone give the specular map, cause i can't get mine working.. Cause of the wrap... i tryed it on a shpere to see if the light map was fine..but... it doesn't

Re: Two shader questions (Easy ones I'm sure) [Re: MMike] #30950
09/02/04 04:35
09/02/04 04:35
Joined: Jul 2002
Posts: 2,813
U.S.
Nadester Offline

Expert
Nadester  Offline

Expert

Joined: Jul 2002
Posts: 2,813
U.S.
Hmmm.. Here's an easier script, does basically the same thing (From what I can tell from the shot)

Code:
material mat_Specular{
emissive_red = 0;
emissive_green = 0;
emissive_blue = 0;

ambient_red = 201.875;
ambient_green = 201.875;
ambient_blue = 201.875;

diffuse_red = 0;
diffuse_green = 0;
diffuse_blue = 0;

specular_red = 255;
specular_green = 255;
specular_blue = 255;

alpha = 100;
albedo = 100;
power = 25;
}



Nice, huh?


--Eric
Re: Two shader questions (Easy ones I'm sure) [Re: Nadester] #30951
09/02/04 04:54
09/02/04 04:54
Joined: Oct 2002
Posts: 815
NY USA
R
Red Ocktober Offline
Developer
Red Ocktober  Offline
Developer
R

Joined: Oct 2002
Posts: 815
NY USA
... i found both to be quite interesting.

THANKS GUYS, for posting...

i be a shader noob as well, and appreciate the help you guys
generously give out...

a question or two...

(1) how did you get the specular map that you applied to the car...

(2) this example is 6.2 and higher specific code, right?


thx again

--Mike


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