shading on level geomerty

Posted By: kasimir

shading on level geomerty - 04/15/08 18:23

hi - i have bought A7 commercial and i just want to try out shaders, but i do not get shaders on level geomertry working... (on models it works fine)
the textures are very darken but no shader effect, also if i try soem example-levels nothing happend...

is there any build-option - i forgotten???

i added following in my main-code:
 Quote:
bmap tile1_normal_bmap = <tile1.tga>;

material tile1 //<---This has to be the Textures Name
{
skin1 = tile1_normal_bmap;

flags = tangent;
effect = "spec_bump_world.fx";

and i added:
 Quote:
d3d_automaterial = on;

but the texture "tile1" is neary black (very dark)
i tried some differend fx -> but no change

so please help me
thx Kasimir
Posted By: Slin

Re: shading on level geomerty - 04/15/08 18:48

Is "tile1.tga" a normalmap? If not, there are a cuple of textures to convert it to one (the results will probably not be the best, but you can play around with the different ways when it basicly works). Even GS can make your texture a normalmap.
Just call this somewhere:
bmap_to_normals(tile1_normal_bmap,1);

If that still does not work, show us a screenshot of what it looks like.
Posted By: kasimir

Re: shading on level geomerty - 04/15/08 20:26

thx - but no effect!
i am using the NM_genarator (ts games)


Posted By: Slin

Re: shading on level geomerty - 04/15/08 20:27

do you have a dynamic light somewhere?
Posted By: kasimir

Re: shading on level geomerty - 04/15/08 20:32

yes its righ above the floor -> the walls are bright, but not the both textures i want to shade normalmapping on...

there is also no effect if i open a template-shader, but then all surfaces are brighten...
Posted By: Slin

Re: shading on level geomerty - 04/15/08 20:46

Do you use a shaded block or a flat one?
Posted By: kasimir

Re: shading on level geomerty - 04/16/08 07:20

I use shaded blocks...
but if i run a template-shader-level there is also no effect (and i think them still works) (massive 3DGS shadercollection)
-> is there some special run-option ???
Posted By: Slin

Re: shading on level geomerty - 04/16/08 07:28

no there is no special run option.
The templateshaders don't work with blocks.
You should first try flat ones
Posted By: kasimir

Re: shading on level geomerty - 04/16/08 07:37

sry - no change... with templateshaders i mean "massive 3DGS shadercollection"
compiled them work fine... but not if i open source-code!

also if i select "mirror" to a block nothing happens... (but i think that should quite work...)

i am totaly confused...
Posted By: kasimir

Re: shading on level geomerty - 04/16/08 08:51

i am much more confused - but suddenly it works fine \:D


but if i include a static light (without dyn light) - i get this effect:


how to get this work, so the textures are normaly in "real" light???
Posted By: Slin

Re: shading on level geomerty - 04/16/08 10:13

It does not work with static lights, but you can combine the static lightmap with the shader for dynamic lights. You can see that the texcoords are wrong on the last picture. Thats what happens when the shader is made for flat blocks and you are using shaded blocks, or the other way around.
Posted By: kasimir

Re: shading on level geomerty - 04/16/08 10:43

Yes, Thanks - flat helps...
just one problem left: how do i create mirror-surfaces???
Posted By: Arcaine

Re: shading on level geomerty - 04/16/08 11:27

i even got the bumpmap problem if i set the flat flag ....always dark or just normal texture...

for mirror surfaces, place an (invisible)entity with the fxa_mirror script somewhere and set the mirror flag on ur texture/surface...but the reflections are really buggy
Posted By: Slin

Re: shading on level geomerty - 04/16/08 11:35

Just don´t use the mirror flag it is outdated, but a fixed function or shader effect. There should be something in the templates.
Posted By: Arcaine

Re: shading on level geomerty - 04/16/08 11:40

well,
i dont need to use mirrors i think ...i just wanted my ground get affected by lights like the one screenshot he took where it works ...but it seems this doesnt work ... dont know how and dont know why ^^...it was the first try to get my ground bumpmapped, and i tried it with kasimirs code^^
Posted By: kasimir

Re: shading on level geomerty - 04/16/08 12:14

so i created a faked mirror with "bmap_for_entity"
but where i can find a mirror-script, i found nothing in wiki or on the ressouce-site...
Posted By: Arcaine

Re: shading on level geomerty - 04/16/08 12:16

in the fxa.wdl script is a predefined mirror (FXA_Mirror), can be found in the template_6/code/ afaik
Posted By: Arcaine

Re: shading on level geomerty - 04/16/08 12:40

but it seems that your normalmapping shader works...maybe can u help me with mine ....there is something missing but i dont know what ...the level starts normal...no errors nothin....my bloom shader works fine ...but the normalmapping wont work...dunno why is there something is have to include especially for this ?
my code is the same you posted...just a different skin/normalmap...the writing is right...but i dont know where my problem lies....
Posted By: kasimir

Re: shading on level geomerty - 04/16/08 13:02

The first normalmap code i used doesn*t work... (massive 3DGS shader collection)
but another works fine, perhaps try another normalmap-shader...
(don't forget dynamic light)
Posted By: Arcaine

Re: shading on level geomerty - 04/16/08 13:06

mhmm i tried the one you have in your code snippet, after this one doesnt work i tried the one from the wiki ... okay...now ill try the one from the collection xD
Posted By: Arcaine

Re: shading on level geomerty - 04/16/08 13:35

Mhmm, i tried now 3 other shaders from the collection but it wont work...

i have the following lines as code :

bmap Asphalt256_normal_bmap = <Asphalt256_normal.tga>;

material Asphalt256 //Selber Name wie die Textur
{
skin1 = Asphalt256_normal_bmap;

flags = tangent;
effect = "parallax_world.fx";
}


and i use the normal light from wes with flag Dynamic on AND a model with an Dynamic Light Action :

action DynLight()
{
my.invisible = on;
my.passable = on;

my.red = 255;
my.green = 255;
my.blue = 255;
my.lightrange = 1000;
}


and my ground is the same like the without shader and i dont know where the problem is^^
Posted By: kasimir

Re: shading on level geomerty - 04/16/08 13:45

if i tried the example levels of the collection (source) - i had no effect, but when i include the code in my project it works...
Posted By: Arcaine

Re: shading on level geomerty - 04/16/08 13:51

ha ..i love it ...if i try the level of the collection then it works...if i implement it into my project nothing happens ^^
Posted By: Arcaine

Re: shading on level geomerty - 04/16/08 15:53

Okay now i got some changes on my screen...but... theres something wrong ...i used the stoneblock texture like in the example from the shadercollection and this is my result ^^

http://img386.imageshack.us/my.php?image=shot0ds0.jpg

anyone got an idea wheres my problem now ? ^^
Posted By: James_Burke

Re: shading on level geomerty - 04/16/08 16:23

Now folks, I am completely new to these shaders but I'm trying the same thing with the same results - either no shader or completely black. I have one block using d3d_automated and one with setting the material. I'm using the same shader as I do for models which work BUT when I use the models I set the variables for the shader in the action:
ie:
my.skill41 = floatv(50);
my.skill42 = floatv(100);
my.skill43 = floatv(100);
my.skill44 = floatv(100);

Now, when I didn't set these in the action, the shader didn't work so my thoughts would be that these need to be set for the texture, but how is that done? Like I said, shaders are new to me and I don't like them (implimenting them that is, lovely to look at!).
Posted By: kasimir

Re: shading on level geomerty - 04/16/08 16:45

@ Arcaine - i got this result when i used static light - this shader does not work with it
Posted By: Slin

Re: shading on level geomerty - 04/16/08 16:51

@Arcaine: Set the blocktexture to flat and you are done.
@James_Burke: You will need a special shader for blocks. The settings are then done through materialskills or within the shadercode. When creating the massive shader collection, I also created a block version for a cuple of the shaders. You can find that collection on acknex unlimited or somewhere between my files at filefront...
Posted By: Arcaine

Re: shading on level geomerty - 04/16/08 17:03

gah ...thats bad -.- bloom shader only works with shaded blocks and the normalmapping only with flat ...is there a way to combine those anyway ??^^

mhmm okay...now both are working together....thanks xD
Posted By: Arcaine

Re: shading on level geomerty - 04/16/08 17:41

Okay another problem dissapeared .... the works only if i use the stoneblocks texture....if i use other textures + normalmap it ahows only the standart texture ... but my writing in the shader is correct, i tried it with 6 several texture...but none, except the soneblocks texture is working



why ?
Posted By: kasimir

Re: shading on level geomerty - 04/16/08 18:02

you have to change thsi name - don't forget:
 Quote:

material Asphalt256 //<-- hier namen entsprechen ändern
{
skin1 = Asphalt256_normal_bmap;

flags = tangent;
effect = "parallax_world.fx";
}

Posted By: Arcaine

Re: shading on level geomerty - 04/16/08 18:11

i did, ^^ i changed the bot lines all the time ...with correct writing and the case sensitive aspect...but it happened nothing^^

bmap World_normal_bmap = <floorstone_norm.tga>;

material floorstone //Same Name like the Texture
{
skin1 = World_normal_bmap;

effect = "spec_bump_world.fx";
flags = tangent;
}

function WorldMaterial_Init_startup()
{
d3d_automaterial = 1;
}

my specbumpshader, i created the normalmap with the NMC from TSGames, and renamed the xxx_normal.tga to xxx_norm.tga and if i try to use them with the original texture it happens nothing, it looks like theres is no normalmap, i deleted all my static light and just have ambient lighting and sun in my lvl and yes...the shader is included ^^
Posted By: James_Burke

Re: shading on level geomerty - 04/17/08 14:17

Thanks Slin, following your advice I downloaded that huge collection. Now I have the same problem as everybody else (more or less). Running the shader from the .exe you provide it works - looks great! If I open the source and run that in WED it doesn't, I don't build the level at all (use the existing wmb) and still nothing. Same thing if I add it to my own project.
Any ideas on this, it has me stumped \:\)
Thanks,
James
Posted By: Sandster

Re: shading on level geomerty - 05/01/08 09:26

I have the same problem with running level with A7.07 Pro. But if I run it with A7.05 Pro version, it works. I tried to compile level with "Create mesh" option for A7.07 version, but it rendered stones wrong too (moreover they are too bright).

Do you know anything about what changes must be done for succesful results?

Thanks,
Sandster
© 2024 lite-C Forums