1 registered members (AndrewAMD),
636
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Ulitimate lighting shader pack v1.0
[Re: Drew]
#36803
11/26/04 00:00
11/26/04 00:00
|
Joined: Oct 2003
Posts: 4,131
Matt_Aufderheide
OP
Expert
|
OP
Expert
Joined: Oct 2003
Posts: 4,131
|
Quote:
Evrything I try produces ertors.
Drew.. what kind of errors do you get.. i cant help unless i know what isnt working .. whether its a scripting problem or a shder problem. As said the shader requires ps v3.0 to work right now.
|
|
|
Re: Ulitimate lighting shader pack v1.0
[Re: Drew]
#36804
11/26/04 03:47
11/26/04 03:47
|
Joined: Jun 2004
Posts: 241
muralist
Member
|
Member
Joined: Jun 2004
Posts: 241
|
Drew,
1. Make the two fx files
2. Save the light script as DynLight.wdl and set the behavior of a ball model with the light action. Set skill 1,2,3, to rgb -- I used 200 50 100 for example
Change player.x to camera.x
//DYNLIGHT.WDL:
var light_dist=2000; //this is how far away form a light it will be visible.
action light_pos_object
{
wait(5);
my.invisible=on;
my.passable=on;
while(1)
{
if vec_dist(my.x,camera.x)<light_dist
{
my.light=on;
my.lightrange=1000; //could be set also to a skill
my.red=my.skill1; //just put in the r,g,b values
my.green=my.skill2;
my.blue=my.skill3;
my.cast=on; //casts a shadow when on
}
else
{
my.lightrange=0; //if too far away turn it off
my.light=off;
my.cast=off;
}
wait(1);
}
}
3. Paste the material code at the end of main script. (didnt even put it inside main function, just tacked it onto the end) -- note my addition of VAR before d3dautomaterial like so:
//TACK ONTO END OF MAIN SCRIPT:
material spec_bump_model //assaign all models this material in script
{
flags = tangent;
}
var d3d_automaterial=1;
bmap your_world_texture_normalmap = <your_world_texture_normalmap.tga>;
material your_world_texture_normalmap_tga
{
skin1 = your_world_texture_normalmap;
flags = tangent;
}
//then call this function in main():
function load_shaders()
{
effect_load(spec_bump_model,"spec_bump_model.fx");
effect_load(your_world_texture_normalmap_tga,"spec_bump_world.fx");
wait(5);
}
Then I put in a couple of normal mapped models (which I used to use with your pointspeclight demo -- thanks for that by the way) and a couple of your crates -- one of which showed up partly transparent in the level... but I think the normal mapping works -- also add an image called yournormalmap.tga
Thats it.
I am only sure that this produces colored lights but it sure looks like the normalmap effect smooths the models ( I made low res versions of hires models, norrmal mapped them per your instructions...) I dont know how to apply textures to level blocks so I only use models.
Can someone tell me how to assign a normalmapped material to a model or object -- I usually use modified terrain multishaders for models -- is the "yournormalmap" texture applied from a WAD? How do I get the textures into the wads?
|
|
|
Re: Ulitimate lighting shader pack v1.0
[Re: Nadester]
#36810
11/26/04 11:58
11/26/04 11:58
|
Joined: Sep 2004
Posts: 1,214 Austin, Texas
Josh_Arldt
Senior Developer
|
Senior Developer
Joined: Sep 2004
Posts: 1,214
Austin, Texas
|
Wierd, mine doesn't seem to react to any light at all. I placed two light_pos_object in the level. One behind the model and one infront of him.
He is almost completely black.
Last edited by humansandbag; 11/26/04 11:59.
|
|
|
Re: Ulitimate lighting shader pack v1.0
[Re: Josh_Arldt]
#36811
11/26/04 13:46
11/26/04 13:46
|
Joined: Jul 2003
Posts: 893 Melbourne, Australia
Matt_Coles
User
|
User
Joined: Jul 2003
Posts: 893
Melbourne, Australia
|
Muralist: to assign this code to your models paste this at the end of the normal mapping script action Shader_NormalMap { my.material = spec_bump_model; } then assign it to an entity in WED. Also you'll have to have a bump map in skin2 of whatever entity you put in there Matt
|
|
|
Re: Ulitimate lighting shader pack v1.0
[Re: Matt_Coles]
#36812
11/26/04 15:40
11/26/04 15:40
|
Joined: Jun 2004
Posts: 241
muralist
Member
|
Member
Joined: Jun 2004
Posts: 241
|
thanks.
Well, now the entities with the action assigned turn black and white.
Back to the drawing board...
Last edited by muralist; 11/26/04 16:04.
|
|
|
|