OpenArena Message Boards

OpenArena Contributions => Models => Topic started by: bbmario on March 09, 2014, 05:44:21 PM



Title: Weapon model shaders
Post by: bbmario on March 09, 2014, 05:44:21 PM
I just created a new weapon model and exported to MD3 using Misfit Model 3D. The tags are OK and everything works, just the material that is not applied. It appears perfectly on Misfit Model 3D. My texture is called mg_DIF.tga and is stored in the same folder as the model, machinegun.md3. I have created a shader with the following contents:

Code:
models/weapons2/machinegun/mg_DIF
{
sort additive
cull disable
{
map models/weapons2/machinegun/mg_DIF.tga
blendfunc GL_ONE GL_ONE
}
}

However, the model still has no texture. Anyone has any ideas of what might be wrong?


Title: Re: Weapon model shaders
Post by: fromhell on March 09, 2014, 08:49:04 PM
If you're on Linux, case sensitivity with the filename may matter.


Title: Re: Weapon model shaders
Post by: bbmario on March 10, 2014, 07:13:10 PM
Nope, i'm on Windows. Any other ideas of what might be the cause? Should i try Blender instead of the MM3D exporter? Is there any tool i can use to inspect the MD3 model?


Title: Re: Weapon model shaders
Post by: bbmario on March 10, 2014, 08:46:32 PM
Using a hex editor, the MD3 file has the correct texture name: mg_DIF.tga. But it does not have the full path (models/weapons2/machinegun/)... is this correct? Does the group name have anything to do with the texture?


Title: Re: Weapon model shaders
Post by: bbmario on March 13, 2014, 02:41:06 PM
No one? :(


Title: Re: Weapon model shaders
Post by: Suicizer on March 13, 2014, 03:19:17 PM
No one? :(

If you've specified an the groupname or skin incorrectly, then it certainly won't do the desired result.


Title: Re: Weapon model shaders
Post by: fromhell on March 13, 2014, 03:27:44 PM
You will need the full absolute path to the texture there.  MD3s never load textures with relative paths.


Title: Re: Weapon model shaders
Post by: bbmario on March 13, 2014, 05:07:14 PM
If you've specified an the groupname or skin incorrectly, then it certainly won't do the desired result.

Why? Does the shader name has to be the group name or the MD3 name?

You will need the full absolute path to the texture there.  MD3s never load textures with relative paths.

An absolute path inside the shader or inside the MD3? This doesn't make sense, after all, the texture is loaded on the shader, not on the MD3!


Title: Re: Weapon model shaders
Post by: fromhell on March 13, 2014, 05:21:22 PM
The MD3.

The surface name shouldn't matter much since weapons cannot dynamically load .skin files.   (and before anyone asks, no i'm not interested in the CSGO-ish weapon skin feature)


Title: Re: Weapon model shaders
Post by: bbmario on March 13, 2014, 05:58:13 PM
So, what's the purpose of mentioning the texture path in the shader?


Title: Re: Weapon model shaders
Post by: fromhell on March 13, 2014, 07:26:45 PM
Organization doesn't hurt.


You can type "shaderlist" in the console to get a list of loaded shaders.  It would be odd to see a "MG_skin.tga" in the middle of loaded "models/weapons2/machinegun/flash.tga" and the like for eample