Game Development Community

Bump mapping

by Matt Sanders · in Torque Game Engine · 09/13/2004 (6:55 pm) · 11 replies

I have been looking all over for anything that involves bump mapping with TGE on DIF files. I would love to add bump mapping to my buildings, bridges, ect. but have found no support on this topic. Could someone please let me know if they have gotten bump mapping to work and how to implament it in the engine. I saw in some older posts that they were working on support for bump mapping in TGE (I just hope that this is not only in TSE and I have to shell out some more $ to gain this feature :) ).

Any help is more then appreciated...

#1
09/14/2004 (6:59 am)
I got bump mapping happening of DIFs in TGE via CG. I basically hacked up the detail for dif resource to get material mapping working. www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5512 Then added the cg rendering code to interiorrender.cc, from this tutorial www.gamedev.net/reference/articles/article1903.asp I was thinking of releasing this as a resource, but i have just recently finished integrating it with the lighting pack and since most of the code was ripped from other resources I decided not to.

Here is a pic of the orc tower with bump mapping on the grey rock part
www.intersticesthegame.com/images/tgelpcg.jpg
#2
09/14/2004 (7:12 am)
Looks nice
#3
09/14/2004 (7:12 am)
Wow, I wonder if I could use this method to make normal maps
#4
09/14/2004 (8:03 am)
Banshee .. make normal maps? if you mean use normal maps for the dot 3 calculation thats what i'm doing. My shader is a little bit differnet from the one in the tut, since i already have a normal map. I took the original texture and created a normal map from it and load that through the material mapping part.
#5
09/14/2004 (8:34 am)
That does look impressive, how does it react to light? (does it cast real-time shadows or is this emboss bump mapping, I am very interested and will need to look for more info but I know I would love to use dot3 eventually.)

I looked at the articles that you were talking about and am now very interested to try and get this working in my project. I will dable with it a bit but If there is any way that you could let me know what files .h/.cpp/etc. you used from the cg tutorial and how you implamented it in torque would save me and I'm sure many others alot of time... TY and keep up the good work.
#6
09/14/2004 (9:08 am)
Quote:how does it react to light?

The shadow moves as the light moves. ATM it is hardcoded to light 0 .

So when the sun moves the shadows go along with it. But it really depends on your fragment shader.. mine takes a lightVector in the form of a color . and
then does the dot product stuff.

in CG i did something like:

float3  diffuse = dot(tex2D(normalMapTexture, normalMapCoords).rgb ,
 lightVector) 

float3 base = tex2D(baseTextureColor, baseTextureCoords).rgb,1.0);



return float4 (diffuse*base,1.0);
#7
09/14/2004 (12:46 pm)
Also where did you put the cg code in interiorRender.cc... :)
and how do you use it in torque ( any scripting involved to set up the bump on specific textures like in the detail texture tutorial)?
#8
09/14/2004 (12:55 pm)
Yeah... more info Kev... this is really neat!!!

would you reconsider releasing it as a resource... this is really pretty outstanding...

--Mike
#9
09/14/2004 (1:18 pm)
Kevin @ You should put that out. It looks real good.

Whats the framerate hit. If at all.

Matt
#10
09/14/2004 (5:58 pm)
awaiting approval

as for the frame rate..it does do a pass after the lightmap pass, i didn't notice a drop, but i have yet to try and profile this..
#11
09/15/2004 (5:10 am)
Great stuff...

THANKS, somehow doesn't seem to be enough...

but, since it's all i can give at the moment, THANKS again for sharing the knowledge so generously.

--Mike