level textures with bump mapping

Posted By: Stelynn

level textures with bump mapping - 10/06/04 05:21

In the new update I read that level textures can now be assigned materials. I am trying to create bump mapping for walls with normal textures. Is this possible right now and how do I go about it.
Posted By: sriram

Re: level textures with bump mapping - 10/08/04 17:43

I would like to know how to apply a shader material to the entire level too...I've searched for this before and found out that we should set d3dautomaterial to 1 and use a shader with the same name as the material in WED..didnt understand it...I hope someone writes a small tutorial for this..
Posted By: Josh_Arldt

Re: level textures with bump mapping - 10/09/04 06:45

I don't think shaders on level geometry is fully supported by the engine yet. When it is fully supported all you have to do is set the var d3d_automaterial = 1; and rename your texture to the name of your material.

Shaders that work with the models skins will need to be modified for it to work.
In your shader.wdl or .fx there should be a place that says material bumpmap(or whatever you named your material). Open up wed and go to the textures. Change the name of your texture to bumpmap(or the name of your material).
Posted By: Rhuarc

Re: level textures with bump mapping - 10/10/04 07:34

I don't know how many times I've had to say this... but bumpmapping isn't a problem on level geometry

Load this as your shader effect, setting the name of the material to match your texture name, setting d3d_automaterial = on, and setting the skin1 of the material to be a bmap defined above for the normal map. It's as simple as that...

Code:
 

matrix matWorldViewProj;
matrix matWorld;

texture mtlSkin1;
texture entSkin1;
texture entSkin2;
vector vecLight;

technique dot3map
{
pass p0
{
Texture[0] = <mtlSkin1>;//1te Skin im Model ist die Textur
Texture[1] = <entSkin2>;//1te Skin im Model ist die Textur
Texture[2] = <entSkin1>;//1te Skin im Model ist die Textur
TextureFactor = 0xFFFFFFFF;

COLOROP[0] = DotProduct3;
COLORARG1[0] = Texture;
COLORARG2[0] = TFactor;
TexCoordIndex[0] = 1;

COLOROP[1] = Modulate;
COLORARG1[1] = Texture;
COLORARG2[1] = Current;
TexCoordIndex[1] = 0;

magFilter[2]=Linear;
minFilter[2]=Linear;
mipFilter[2]=Linear;
COLOROP[2] = AddSigned;
COLORARG1[2] = Texture;
COLORARG2[2] = Current;
TexCoordIndex[2] = 1;
}
}



-Rhuarc
Posted By: Red Ocktober

Re: level textures with bump mapping - 10/10/04 08:11

hey Rhu... got any shots...

also... how does the lights affect the shaded geometry areas?

seeing as i'm primarily gonna be using bumpmapping, and i couldn't get the dx9 shaders working real well, i went back to 6.22...

what other shaders you got for dx9?

THANKS


--Mike
Posted By: Josh_Arldt

Re: level textures with bump mapping - 10/10/04 08:22

bumpmapping isn't a problem on level geometry ?
Every time I have tried my geometry has looked the same as the others or turned completely black or white. And it isn't my graphics card either. My card supports the right versions of pixel shader and vertex shader. I have also tried it on my other comp. with an ATI card.
I dunno, maybe I just suck at shaders.

BTW how can I properly load this .fx file into gstudio?
And don't you have to define the normalmap in the shader?
Posted By: Rhuarc

Re: level textures with bump mapping - 10/10/04 08:32


Posted By: Josh_Arldt

Re: level textures with bump mapping - 10/10/04 08:46

Nice screen Rhuarc.
Does the lighting come from a lighting shader like in drews tutorial or wed lights?
Posted By: Red Ocktober

Re: level textures with bump mapping - 10/10/04 08:50

ok... i'm convinced!!!

seriously, that looks nice...

yeah, i forgot you showed some shots of shaders on level geometry before...

6.31, right ?

also, yeah, what 'sandy asked above...

--Mike
Posted By: Josh_Arldt

Re: level textures with bump mapping - 10/10/04 11:39

WOOT!!!
I finally got this working for me.
AND IT REACTS TO WED LIGHTS, AND SUN!!!(sorry for yelling but i am excited.)lol
Stupid me, the reason it wasn't working for me is 'cause I put var d3d_automaterial =1; instead of just d3d_automaterial = 1; lol

Posted By: Red Ocktober

Re: level textures with bump mapping - 10/10/04 12:19

cooool....

--Mike
Posted By: snake67

Re: level textures with bump mapping - 10/10/04 13:15

It does not work for me. I use this wdl script. The level texture in WED is named "floor1.bmp":

bmap detail_floor1, <floor1.tga>;

function init_detail_mapping
{
bmap_to_mipmap(mtl.skin1);
}

material floor1
{
event=init_detail_mapping;
skin1=detail_floor1;
effect=
"
matrix matWorldViewProj;
matrix matWorld;

texture mtlSkin1;
texture entSkin1;
texture entSkin2;
vector vecLight;

technique dot3map
{
pass p0
{
Texture[0] = <mtlSkin1>;
Texture[1] = <entSkin2>;
Texture[2] = <entSkin1>;
TextureFactor = 0xFFFFFFFF;

COLOROP[0] = DotProduct3;
COLORARG1[0] = Texture;
COLORARG2[0] = TFactor;
TexCoordIndex[0] = 1;

COLOROP[1] = Modulate;
COLORARG1[1] = Texture;
COLORARG2[1] = Current;
TexCoordIndex[1] = 0;

magFilter[2]=Linear;
minFilter[2]=Linear;
mipFilter[2]=Linear;
COLOROP[2] = AddSigned;
COLORARG1[2] = Texture;
COLORARG2[2] = Current;
TexCoordIndex[2] = 1;
}
}
";
}

Could someone give a link to a example detail or bumpmap tga file? I think mine is wrong...
Posted By: Josh_Arldt

Re: level textures with bump mapping - 10/10/04 13:22

What version of gstudio do you have?
For level geometry bump-mapping to work you need to have A6.31.0, and dx9c installed.
Posted By: snake67

Re: level textures with bump mapping - 10/10/04 16:47

Hi

Yes i have A6.31.0 and DX9.0c installed. My PC:
P4 2.4GHz 512RAM
GeF Ti4200
I think this should work...
Posted By: snake67

Re: level textures with bump mapping - 10/10/04 19:00

I played around a bit and now it works! The mistake was:

since I use the new WED feature, giving a path for textures to compile a wad file automatically. The texture in that path is called "bumptest.bmp"

"material bumptest_bmp" instead of "material bumptest".

So for the dot we must give an underscore to work properly (is this not yet documented, conitec?).
Posted By: Optigon

Re: level textures with bump mapping - 10/10/04 23:31

So let me get this straight, the texture itself doesn't have a greyscale bump channel? If not, then does the shader create the illusion of depth based on color values in the texture?

I've only used bump maps in pre-rendered work before. So I'm just trying to understand how this all works.

Jim
Posted By: Red Ocktober

Re: level textures with bump mapping - 10/11/04 02:21

skin0 is the regular texture, and skin1 holds the normal map...

i think...

at least that's the way it works in 6.22 on models... gonna try 6.31 this evening (fingers crossed)

--Mike
Posted By: Rhuarc

Re: level textures with bump mapping - 10/11/04 02:53

Here's some info for those that want to know a little more about the shader.

entSkin1 - Level Texture (no lighting in this texture)
entSkin2 - Level Lighting (this gets rendered over the texture using AddSigned)
mtlSkin1 - The normal map. You define this in the material as skin1

The normal map has to be created beforehand, the shader won't generate its own. If you want it to generate its own, you need to add the following function above the material:

Code:
function init_textureNormals()

{
bmap_to_normals(mtl.skin1,2);//convert the skin to a normal map
}


And add this into your material definition:
Code:
event = init_textureNormals;



In this case you MUST still define skin1, but doing it this way- you can simply set a bmap to the texture image, rather than a normal map for it. Keep in mind it is processed faster to use your own normal map than to create it in the engine.

EDIT: @Snake67- all you need to do is replace bmap_to_mipmap with the bmap_to_normals statement here and it should work .

-Rhuarc
Posted By: Otsego

Re: level textures with bump mapping - 10/11/04 03:25

Wow, this works fine .
But how can i use it on models? The old bumpmapping shader doesn't work anymore and i don't know how to get this new one to work on models. Can you tell me what i have to do?
Thank you
Posted By: TimeOut

Re: level textures with bump mapping - 10/11/04 04:05

Look here :

link
Posted By: Otsego

Re: level textures with bump mapping - 10/11/04 04:22

Thanks, this should help .
Posted By: sriram

Re: level textures with bump mapping - 10/12/04 13:38

Hey thats a cool screenshot there [Rhuarc] Colud you plz give us the that sample scene ? It would be much easier to figure out the whole 'bumpmapping for entire level' thing I'm sure it must be less than 2MB...plz plz plz
Posted By: Stansmedia

Re: level textures with bump mapping - 10/13/04 04:41

anyway to have a seprate normal/heightmap per texture?
Posted By: Nadester

Re: level textures with bump mapping - 10/13/04 05:01

Don't get too excited guys. That effect really isn't bumpmapping (well technically it is..) but it's not anything that can't be achieved via texturing. It doesn't actually react to level lighting, the same light maps would be used no matter what. When we made that effect, the engine did not support tangents on level geometry, thus true lighting could not be calculated. Now they are implemented in the latest beta with DirectX9, so the shader will need to be revised in order to get a real effect.

sriram - I plan on releasing a much better version of that scene as soon as a better shader pulls through.

bloodred - of course, you have to make a different material for every texture, then load the core effect via an .FX file. That would allow you to use seperate bumpmap images for each texture.
Posted By: DARKLORD

Re: level textures with bump mapping - 10/13/04 05:53

Hey great work but is it possible to get an effect like in this demo?

Download here
Informations here

Reacts this shader to dynamic lights?

Sorry for my bad English
Posted By: Rhuarc

Re: level textures with bump mapping - 10/13/04 07:12

Well, the screenshot is more detailed and much better than that Cell Splinter deno or whatever it was called that was posted on these forums . Nade designed the level and the original shader (had some issues, sorry to say it Nade ), I got the shader up and working properly . I'm actually working on a pixel shader right now to make it directly react to level lighting (started on it yesterday) . Also, SMEE2 is being updated soon to support level geometry shaders- one of these days we'll actually finish that program .

-Rhuarc

EDIT: Lol, I really overused the

Just for good measure:
Posted By: Elfi

Re: level textures with bump mapping - 10/13/04 07:28

Hi

bei mir funktioniert es wunderbar hatte lange danach gesucht um mit bumpmapping zu arbeiten. eine frage hätte ich noch dazu. meine levelbeleutung ist zwar vorhanden aber ich seh trotzdem die texturen dort wo es eigendlich dunkel sein sollte. wie kann ich dies ändern?

gruetzbeutel@gmx.de
info@electronikfunk.de
Posted By: Matt_Aufderheide

Re: level textures with bump mapping - 10/13/04 08:45

you cant make world geometry react to level lighting yet.. not until we have light vectors passed into the materials. all you can do is use a fixed light position , like vecSunDir.. basically you can get only a glorified version of your previous shader.
Posted By: Red Ocktober

Re: level textures with bump mapping - 10/15/04 14:35

ahhh yes, i finally got up enough nerve and took the plunge to dx9 based shaders...

... and, with a lil help from information generously shared in the previous posts i managed to get the level geometry working with the normal map shader that Rhuarc detailed...



this is startin to look like what i'm after...

Thanks people for the help...

--Mike
Posted By: DARKLORD

Re: level textures with bump mapping - 10/15/04 20:24

Hey that looks very cool
Posted By: mk_1

Re: level textures with bump mapping - 10/15/04 20:42

I'd really like to see a small video with moving lights (or moving entities).
Posted By: Red Ocktober

Re: level textures with bump mapping - 10/15/04 23:01

thanks Darklord... i'm just reliving the experience that H'sandbag had a few weeks ago when his code started working

i almost flipped the caps lock key on myself

by the way, him posting his problems and code helped make it a lil easier for me... i was planning on staying with the dx8 shader interface, but some stuff i've done in darkbasic kinda lead me to believe that model cenetered scenery, although feasible, is gonna be a pain to construct, with each part needing separate shading considerations...

... anyway, i decided to see what a level capable solution would be like.
so far, i like it... although the screenshot is resized down and looses a lot, it kinda gives the idea that a Doom3 like level can't be very far off.

maybe...

Rhuarc's explanation of what was going on was the real key in understanding what was in the readme concerning the new shader implementation... i hope that a decent, easy to understand manual on this is forthcoming... else, i'm gonna have to put Rhu on the payrole


mk1... i don't think that moving lights are gonna have any affect on the level geometry just yet... like Matt said above, the lights you see are wed lights that are fixed and mapped during the compile... we're gonna need a means of giving the light position, color, and maybe intensity to the shader during runtime in order to get that flashlight effect on the level structures...

me think that's on it's way...

--Mike
Posted By: Masterchiefk

Re: level textures with bump mapping - 10/29/04 01:40

can someone make a test map with this script and a little level ... that a noob can understand it too. ^^ please load this up thx!
Posted By: BrainGamble

Re: level textures with bump mapping - 02/10/05 07:32

hi,

well I tried to get this shader to work but I get one error.:
First of all; i get no Bumpmap or normalmap in my level, it goes not work
Error in effect:
Floor1(70) : Syntax error

put the engine get started!!

here is my code:
____________________

bmap detail_floor1, <16tile12.tga>;


function init_textureNormals()
{
bmap_to_normals(mtl.skin1,2);
}
material Floor1
{
event=init_textureNormals;
skin1=detail_floor1;
effect=
"
matrix matWorldViewProj;

matrix matWorld;



texture mtlSkin1;

texture entSkin1;

texture entSkin2;

vector vecLight;



technique dot3map

{

pass p0

{

Texture[0] = <mtlSkin1>;//1te Skin im Model ist die Textur

Texture[1] = <entSkin2>;//1te Skin im Model ist die Textur

Texture[2] = <entSkin1>;//1te Skin im Model ist die Textur

TextureFactor = 0xFFFFFFFF;



COLOROP[0] = DotProduct3;

COLORARG1[0] = Texture;

COLORARG2[0] = TFactor;

TexCoordIndex[0] = 1;



COLOROP[1] = Modulate;

COLORARG1[1] = Texture;

COLORARG2[1] = Current;

TexCoordIndex[1] = 0;



magFilter[2]=Linear;

minFilter[2]=Linear;

mipFilter[2]=Linear;

COLOROP[2] = AddSigned;

COLORARG1[2] = Texture;

COLORARG2[2] = Current;

TexCoordIndex[2] = 1;

};

}
";
}

____________________

Info: The 16tile12.tga is my Bumpmap !!!
what else shoud i have to do

hope you can help me
Posted By: Nadester

Re: level textures with bump mapping - 02/10/05 11:41

It's a directx 8.1 shader. Need's to be updated to 9 format. But once again, there are better shaders out there for this.
Posted By: Salva

Re: level textures with bump mapping - 02/10/05 18:43

Hi!

If you need a dot3 shader, try this:
is a DX9 shader!


code:
_______________________________________________________________________¥

Material dot3
{
effect
"
matrix matWorldViewProj;
matrix matWorld;

texture entSkin1;
texture entSkin2;
vector vecLight;



technique dot3map
{
pass p0
{
Texture[0] = <entSkin2>;
Texture[1] = <entSkin1>;

TextureFactor = 0xFFFFFFFF;

COLOROP[0] = DotProduct3;
COLORARG1[0] = Texture;
COLORARG2[0] = TFactor;
TexCoordIndex[0] = 1;

COLOROP[1] = Modulate;
COLORARG1[1] = Texture;
COLORARG2[1] = Current;
TexCoordIndex[1] = 0;

magFilter[2]=Linear;
minFilter[2]=Linear;
mipFilter[2]=Linear;
COLOROP[2] = Modulate;
COLORARG1[2] = Texture;
COLORARG2[2] = Current;
TexCoordIndex[2] = 1;

}

}

";
}
action bumpas
{
my.material = dot3;
wait(1);
}


Greetings
salva.
Posted By: BrainGamble

Re: level textures with bump mapping - 02/11/05 07:27

i use this code for bumpmapping on geometry textures !!!

My texture in Wed is named: 16tile12.bmp
the pumpmap texture is 16tile12.tga
------------------
bmap detail_16tile12, <16tile12.tga>;

function init_detail_mapping
{
bmap_to_mipmap(mtl.skin1);
}

material 16tile12
{
event=init_detail_mapping;
skin1=detail_16tile12;
effect=
"
matrix matWorldViewProj;
matrix matWorld;

texture mtlSkin1;
texture entSkin1;
texture entSkin2;
vector vecLight;

technique dot3map
{
pass p0
{
Texture[0] = <mtlSkin1>;//1te Skin im Model ist die Textur
Texture[1] = <entSkin2>;//1te Skin im Model ist die Textur
Texture[2] = <entSkin1>;//1te Skin im Model ist die Textur
TextureFactor = 0xFFFFFFFF;

COLOROP[0] = DotProduct3;
COLORARG1[0] = Texture;
COLORARG2[0] = TFactor;
TexCoordIndex[0] = 1;

COLOROP[1] = Modulate;
COLORARG1[1] = Texture;
COLORARG2[1] = Current;
TexCoordIndex[1] = 0;

magFilter[2]=Linear;
minFilter[2]=Linear;
mipFilter[2]=Linear;
COLOROP[2] = AddSigned;
COLORARG1[2] = Texture;
COLORARG2[2] = Current;
TexCoordIndex[2] = 1;
}
}
}
";
}

-------------------
ok, when the engine start i get no errors, but
my floor is just very bright and no effect ...

what could be the problem ???????
Posted By: Salva

Re: level textures with bump mapping - 02/12/05 05:53

Hi!

Is your bumpmap with alpha channel?


Greet


Salva
Posted By: BrainGamble

Re: level textures with bump mapping - 02/12/05 06:06

oh, i see now.

Perhaps thats the problem, because my normal map is , well how could I explane : most blue / pink.
You now???

How could I make alpha textures?

thx
Posted By: Salva

Re: level textures with bump mapping - 02/13/05 01:29

Hi!

Then does your shader work?
Otherwise you use this code from me it works very well!
Please note the comments!

bmap detail_floor1, <brickdark1.tga>;// this is your normalmap!(the blue-pink)

function init_detail_mapping
{
bmap_to_mipmap(mtl.skin1);
}

material brickdark // this is your wad texture in wed you use this for the block
{
event=init_detail_mapping;
skin1=detail_floor1;
effect=
"
matrix matWorldViewProj;
matrix matWorld;

texture mtlSkin1;
texture entSkin1;
texture entSkin2;
vector vecLight;

technique dot3map
{
pass p0
{
Texture[0] = <mtlSkin1>;
Texture[1] = <entSkin2>;
Texture[2] = <entSkin1>;
TextureFactor = 0xFFFFFFFF;

COLOROP[0] = DotProduct3;
COLORARG1[0] = Texture;
COLORARG2[0] = TFactor;
TexCoordIndex[0] = 1;

COLOROP[1] = Modulate;
COLORARG1[1] = Texture;
COLORARG2[1] = Current;
TexCoordIndex[1] = 0;

magFilter[2]=Linear;
minFilter[2]=Linear;
mipFilter[2]=Linear;
COLOROP[2] = AddSigned;
COLORARG1[2] = Texture;
COLORARG2[2] = Current;
TexCoordIndex[2] = 1;
}
}
";
}

Hope This help!


Greetings

Salva

PS: Could you tell me how you have done the normalmap?
Posted By: BrainGamble

Re: level textures with bump mapping - 02/13/05 03:09

ok, thanks now its work.

I just paste your code.

thanks again

but how could I make the floor more dark?
Posted By: Matt_Coles

Re: level textures with bump mapping - 02/13/05 14:20

Change the ambient colour value of the level in WED (where the sun option is), that should work

Matt Coles
© 2024 lite-C Forums