Game Development Community

Bump maps on dts in tgea

by QSquid · in Torque Game Engine Advanced · 03/12/2007 (1:54 pm) · 7 replies

Hi folks,

I'm just getting going on TGEA and have had a lot of success creating some great interior textures using normal mapping, specularity, etc. But as I've begun trying to use these techniques with dts objects, I've decided that I must be missing something.

I've been trying to use these attributes just like I did with my dif models. I open the corresponding materials.cs file and create a new material for my object. here's an example of one I did for a cobblestone texture:

new Material(cobblestone)
{
mapTo = cobblestone;
baseTex[0] = "cobblestone";
bumpTex[0] = "cobblestone_bump";

pixelSpecular[0] = true;
specular[0] = "1.0 1.0 1.0 0.1";
specularPower[0] = 25.0;
};

This is the exact same one that I used for the floor on one of my rooms and it looks great. But upon applying this material to a dts object that has been mapped with the same image, I only get the object and base texture, no bump mapping or specularity. What am I doing wrong. As far as I can tell, I can change anything I want in that materials.cs file and it has no effect on my object. I've tried lighting it with a static light with affect dts turned on. Which leads me to another question (Sorry this is so long)

My dts models seem to be illumiated on both sides. I have read all the documentation for TGEA, and have an idea of being able to control this with the dts objects settings, but it didn't specify how to change those settings. My programmers here are working on another project, any help will be REAAAAALLy appreciated.

Thanks!

#1
11/16/2008 (5:52 pm)
I'm having the same problem and have no idea why basic diffuse with a spec and diffuse textures acts differently to DIF objects, I posted a similar "Cry for help" and I've not had any replies - so either No one using TGEA is using normal maps with their DTS shapes or that NO one knows the answer.
#2
11/16/2008 (6:39 pm)
I believe it has to do with how the mesh's normals are handled.
#3
11/16/2008 (6:44 pm)
If you exported from maya add the file extension :

mapTo = cobblestone.png.
#4
11/16/2008 (6:53 pm)
My list of things to check...

1. Check the console log for errors... if the script fails to compile you'll get the plain texture. This is extremely importaint... be absolutely sure your CS file is executing properly else nothing you try will work.

2. Do you have a second material object with the name 'cobblestone'? Depending on the order of execution you'll get different results. In general i suggest using more unique names for the material objects... it often can conflict with stuff.

3. Use "cobblestone" in quotes in the mapTo line... it might matter.

> My dts models seem to be illumiated on both sides

Check to be sure your model has normals... without good normals things are flat lit.
#5
11/17/2008 (3:43 am)
Well I do use maya so I added the file extension to the mapTo but it still doesnt seem to work :(

new Material(desk1)
{
mapTo = "desk_d.png";
baseTex[0] = "desk_d";
bumpTex[0] = "desk_bump";

pixelSpecular[0] = true;
specular[0] = "1.0 1.0 1.0 0.1";
specularPower[0] = 32.0;
};

Theres nothing wrong with the DTS's normals, once I crack this I can start throwing out the artwork.
#6
11/17/2008 (4:15 am)
I had some problems with speculars in jpg format, is your bump map png too? Is there a jpg file of the same name?
#7
11/17/2008 (6:47 am)
Nope its just a PNG format - it is a true mystery. I used to mess about with TSE and never had this problem before