Missing shader in .3ds, or getting MD3 in linux


(trb7) #1

Hi
I’ve been doing some mapping for a while, i use linux exclusively, and i’ve been having a bit of a problem regarding models.
I did a couple of models in alias maya, linux as i mentioned before, exported to obj, and radiant sig11’s when importing the obj. So, i built wings3d, and a couple of importer/exporter plugins, managed to import the obj, everything was ok, renamed the material name (the shading group name in maya), to the shader name, and exported as .3ds. Radiant imports it correctly, but i get a missing shader. I placed the .3ds in models/mapobjects/modelname/ , as well as the (baked) texture map that the .3ds uses. I opened to .3ds in a hex editor to make sure the filename was ok, filename is ok, the shading group name is ok, and i get a missing shader. So, i created a modelname.shader in scripts/ , something like this:

textures/columnba/columnba
{
surfaceparm nosteps
surfaceparm playerclip
{
map $lightmap
rgbGen identity
}
{
map models/mapobjects/columnba/columnba.tga
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
}

Still, missing shader. Any clues about this? Particularly, when radiant loads a 3d model, like a .3ds, or .obj, where is the shader name declared? In the material name? Should i create a .shader with the material name in scripts/ ? What is the normal procedure to import 3d models+textures, static, in non-md3 format, into radiant?
Anyone knows a way to get md3’s out of any format?

P.S.: i already tried the blender script (python script error), ac3d (md2, no md3), maya md3 exporter source (visual studio sources, even after some tweaking, they still don’t build), etc…, and i’m running out of options and mental sanity. Thanks in advance for any reply.


(carnage) #2

well when i fidled with md3 on windows i got somehting like this…

you need your texture to be inside the ET directory stuff so textures/youmapname or something

then for the models texture set it to textures/yourmapname/columba.tga

i get this feeling cos u say baked in texture? there are not textures saved within a md3 file


(trb7) #3

Hi
I solved part of the problem only to get another one, i’ll explain. I just exported the obj from maya, imported to wings, i have the material name, and the texture filename there. I renamed the material name to columnba. Since i have to export as 3ds, i’m limited to 8.3 format, so i reference the texture file to columnba.tga, so far so good.
I then create a scripts/columnba.shader, which i pasted in the previous post. I edited to have a qer_editorimage entry, just in case (which isn’t the case, since the texture that shows is shader_not_found).
So, i have a models/mapobjects/columnba/columnba.3ds, a models/mapobjects/columnba/columnba.tga, a scripts/columnba.shader, i added the entry in scripts/shaderlist.txt, just in case.
And i get the shader not found. I opened the 3ds in a hex editor, and the material name is referenced as columnba only. So, i tried to put the columnba.shader in the etmain, instead of etmain/scrips, and problem solved, but that is no place to have a .shader, so, since maya starts whining about / in shading group names, i went to wings3d, and renamed the material to scripts/columnba. I checked the 3ds in a hex editor, the entry is correct, scripts/columnba, but now i have missing shader again.
Anyone knows what the 3ds entries regarding shaders should be, before the actual vertex data ? Altough it works with the .shader in etmain/, i really want to avoid that. Thanks in advance.


(trb7) #4

P.S.: forgot 1 thing, by baking textures, i mean, i already have the lighting+texturing of the map preset, and did some shaders, that use baked texture maps (multiplied by ambient occlusion), to improve realism a bit.


(trb7) #5

Hmm, ok, i think i solved it, after a couple of days of torture. I’ll post the solution here, just in case someone is interested. Basically, you have to import the obj into wings3d, rename the material entry to scripts/objectname.shader. Copy the object to models/mapobjects/modelname/, copy the texture file to textures/modelname/
and make a texture that references
textures/modelname/modelname
{
map models/mapobjects/modelname/texturefile

If you use models/mapobjects/modelname/ instead of textures/modelname/ then you’ll have problems.
Ok, i know it’s not a good thing to reply to your own posts, but this was taking me a lot of time to solve, mostly due to my choice of platform and limited availability of tools for the job (md3 issues mostly), in any case, perhaps this is of interest to someone in the same circustances :wink: