Game Development Community

Detail Maps?

by Dave Young · in Torque Game Engine · 03/09/2006 (8:41 am) · 8 replies

In my \data\init.cs, I have:
addMaterialMapping("church_stone.jpg","detail:starter.fps/data/interiors/detail/stone_detail.png");

From the manual, it looks like that is how to do detail mapping with TLK. I read this as, wherever church_stone.jpg iss used as a texture, use stone_detail.png as a detail map.

However, I cannot seem to see any difference, the detail texture does not get applied.

Can someone give me a pointer?

#1
03/09/2006 (9:29 am)
Make sure your path to the file is correct. Make sure its also a power of 2. and, you should make an (exec) "detailmapping.cs"); that gets called, and then place that in there. Better for orgizination.

Screenshots?
#2
03/09/2006 (10:20 am)
Try removing the extensions, like this:

addMaterialMapping("church_stone" , "detail: starter.fps/data/interiors/detail/stone_detail");
#3
03/09/2006 (10:23 am)
To clarify; the detail map name probably can have the extension, but the material is looked up by name (in this case 'church_stone'), using the name with extension causes Torque to look for the material 'church_stone.jpg' instead of 'church_stone'.
#4
03/09/2006 (10:55 am)
Aha, I will try that out. Thanks you *very* much for the help.
#5
03/10/2006 (8:15 am)
It worked wonderfully.
I have the disadvantage of not knowing what some of the material names are in prebuilt models. However, in models I make myself I can see the material names.

So:

addMaterialMapping("HardwoodFloor","detail:starter.fps/data/interiors/detail/wood_detail");

when the material was named HardwoodFloor worked perfectly.

Bad lineup of detail, but working example, ignore the experimental flashgui hehe:

www.brooklawnstudios.com/images/wooddetail.png
#6
03/10/2006 (2:28 pm)
You can get rid of the 'light radius' effect by making sure the detail map intensity averages to half intensity (127 in PS, PSP, and Gimp - use the histogram to check the current value, then adjust the brightness/contrast accordingly).
#7
03/10/2006 (2:36 pm)
Woah, thanks! I had no idea how to fix that.
#8
03/10/2006 (3:05 pm)
Hey John, that did the trick, thanks for the tip!!

www.brooklawnstudios.com/images/FixedDetail.png