Problems with textures
-
Basically, i’m having a problem that i’ve never encountered before, and quite frankly, am at a loss on how to deal with it.
I was asked by a discovery community member to texture the ships for the hellfire legion (one of the factions there) which he modelled, and after finding a bit of spare time, managed to get them done.
he wanted me to modify the textures so they would fit in with the theme of the faction, so i took some vanilla textures, gave them some filters and color adjustments in photoshop, and saved them using the nvidia plugin as .dds textures, and using the old version of UTF editor, built the mat file from scratch.
the models, both VHF and gunboat, i textured in 3ds max, and hitboxed in milkshape. exported everything fine, etc.
everything is fine and dandy, and when i open the models via hardCMP and link the correct mat file to the models, you can see the textures on the meshes. everything is all good uptil now.
now, i handed the cmp+sur and mat to the relevent person to hardpoint and do the ini work to include into the mod. the person did it and handed it to the system modder, who wanted to add custom npc patrols using those ships, and this is the problem that was encountered:
[16/03/2010 15:45:17] Ryan (Edran Vayrn) says: I don’t know texturing much, so I’m not sure what this means, but take a look here.
[16/03/2010 15:45:19] Ryan (Edran Vayrn) says: http://i65.photobucket.com/albums/h236/Taneru/screen411.jpg
[16/03/2010 15:46:01] Ryan (Edran Vayrn) says: As you can see, the ships do show up in game, but the textures are all black except for the windows of the gunship.
[16/03/2010 16:38:32] Ryan (Edran Vayrn) says: http://i65.photobucket.com/albums/h236/Taneru/screen412.jpg
http://i65.photobucket.com/albums/h236/Taneru/screen413.jpg
http://i65.photobucket.com/albums/h236/Taneru/screen414.jpgthis is what the models should look like (large pictures):
VHF-
http://i84.photobucket.com/albums/k13/gurjiv/3-2.png
GB-
http://i84.photobucket.com/albums/k13/gurjiv/HF_GB1.jpgas you can see, the models are not displaying the textures, except for the windows texture used, and the model is just… black.
this poses an obvious problem, and i cannot figure out what exactly is going wrong here. ive tried everything i could possibly think of, and from what i figure, there is a problem with the textures somewhere, not the mesh or mat file.
anyone have any experience with this and would be willing to help, it will be much appreciated.
here is the cmps, mat file, surs, and the relevant inis as well, incase anyone wishes to have a look at it.
-
noticed the textures were DXT3 with an empty alpha channel, saved all files as DXT1 and rebuilt the .mat file, give it a try.
edit:
just noticed when i import the new files they have an empty alpha channel as well, so maybe i was wrong.
in any case, the old files did not show thumbnails in windows explorer, the new ones do. -
No luck mate, doesnt seem to make any difference at all ingame.
perhaps i have exported the textures from photoshop itself in the wrong manner? in that case, i have the .psds still available…
-
ok, after inspecting the .mat file, some things you could try.
remove the Dc nodes, or adjust them. (all are set to zeros)
add a material count node, standard .mat files have it.
change the texture library nodes to .tga extension, standard .mat files have it even when they are dds.edit:
also have a look at the Dt_flags nodes. -
@frozen:
First: kudos for lane hacker bomber, the one of the bests i ever seen in the Freelancer universe.
Second: I use DDS converter 2.1 with DXT3 formats to convert tga into dds, so i think your DXT3 is in right form.
Sometimes ive got black “skin” when i played with mats by hand and i lost myself in Dc nodes, and sometimes just retyped a char in the Dt names, so i rather using mat exporter from ms3d, but if you make the texturing process in 3dsmax, i dont know if you can use mat exp or not.
To rule out the textures i advise to try them on different already exsisted ship(s) you made, and we will see whats happening, if you got black again, then the textures got problem, if dont, then mesh problem.
Tomorow i will take a look at your ship. -
Ok, here’s the fixed files…
The Dc node being set to 0’s (colours off!) and the Dt_flags (and Et_flags) being set to 0’s caused the problem. Not sure which is the chicken and which is the egg!! lol
1. The Dc node is only needed for Diffuse materials, in plain FL these are identified with a ‘D’ at the end of the material name - see the Borderworld bw_ships.mat file for an example, and import one of the Borderworld ships into MilkShape to see where it’s used. I removed all the un-needed ones. They were all set to 0 so this means no Red, no Green, no Blue and no Alpha.
2. The Dt_flags (and Et_flags where used) should be set to 64, 0 (edit as Int, 1st value is the top line, 2nd value is the second line). Fixed.
3. The HF_VHF.cmp calls for a material named “glass” which did not exist int he HF_Ships.mat file. I renamed this material to HF_glass in the HF_VHF.cmp file to fit in with your naming scheme, and added it to your HF_Ships.mat file - I copied it from the bw_glass material in the standard bw_ships.mat. It’s used for your VHF’s cockpit glass only.
4. I added a “material count” node and gave it the value 23 (Hex 17).
5. I renamed all the .dds extensions to .tga - it doesn’t matter what each node is named in fact as long as the Dt_name is the same as the texture node name. As there is a standard of .tga in FL let’s keep to it even if nobody else (including DA at times) does!
So don’t forget to use the new HF_VHF.cmp I made for your ship, because your own one will still be looking for “glass” in the mat file and not HF_glass.
Tip for future work - When you make a new model try exporting a new .mat file from MilkShape, this mostly works for me. There is one exception - any materials that don’t use external texture files, like glass, and what I call “solid” colours that I used to make in MilkShape, will sometimes not be exported into the .mat file because the exporter can’t find the external file, so it’s best to use external files for all materials including glass and solids, and adjust the opacity manually in the .mat file to fix it.
Hope you see what I see!
-
That works perfectly now, thanks alot mate.
1. the reason the VHF had the glass texture was i was planning on embedding the glass textures into the CMP of the VHF itself(ive always done that in the past), but i guess theres no need for it now
2. about the mat file and Dc nodes, the guy who told me about building mat files in utf editor explained that i have to include the Dc nodes for each texture, guess that was one of the big reasons why there was problems being caused
3. i thought i changed the Dt_Flags to 64, 0 values via the int array, guess notwhat’s the significance of the material count node? ive never used it before, so im not exactly sure about that.
tis how they look ingame btw:
http://i65.photobucket.com/albums/h236/Taneru/screen422.jpg
http://i65.photobucket.com/albums/h236/Taneru/screen421.jpg
http://i65.photobucket.com/albums/h236/Taneru/screen420.jpg -
The material count node in the Material Library is just the count of how many material entries there are.
In your case there are 23 materials, and this is the 17 in hex.
So yeah it works without it - so?
Standard .mat files have it, and although FL is very resilient and can use defaults or ignores some omissions, I hate it when people don’t follow even whatever few standards do exist. And I hate it more when they say “it works for me so there’s no need!”. Grrrrrrr!!!
-
Aye, it works perfectly now
well, im going to be doing the count node from now, and make sure its part of the standard method i use to making textures from now