Pages: [1]
  Print  
Author Topic: Weapon model shaders  (Read 20800 times)
bbmario
Nub


Cakes 0
Posts: 21


« 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?
Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #1 on: March 09, 2014, 08:49:04 PM »

If you're on Linux, case sensitivity with the filename may matter.
Logged

asking when OA3 will be done won't get OA3 done.
Progress of OA3 currently occurs behind closed doors alone

I do not provide technical support either.

new code development on github
bbmario
Nub


Cakes 0
Posts: 21


« Reply #2 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?
Logged
bbmario
Nub


Cakes 0
Posts: 21


« Reply #3 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?
Logged
bbmario
Nub


Cakes 0
Posts: 21


« Reply #4 on: March 13, 2014, 02:41:06 PM »

No one? Sad
Logged
Suicizer
Member
Member
*

Cakes 2
Posts: 402


WWW
« Reply #5 on: March 13, 2014, 03:19:17 PM »

No one? Sad

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

I'm good at everything but can't do anything...
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #6 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.
Logged

asking when OA3 will be done won't get OA3 done.
Progress of OA3 currently occurs behind closed doors alone

I do not provide technical support either.

new code development on github
bbmario
Nub


Cakes 0
Posts: 21


« Reply #7 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!
Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #8 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)
Logged

asking when OA3 will be done won't get OA3 done.
Progress of OA3 currently occurs behind closed doors alone

I do not provide technical support either.

new code development on github
bbmario
Nub


Cakes 0
Posts: 21


« Reply #9 on: March 13, 2014, 05:58:13 PM »

So, what's the purpose of mentioning the texture path in the shader?
Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #10 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
Logged

asking when OA3 will be done won't get OA3 done.
Progress of OA3 currently occurs behind closed doors alone

I do not provide technical support either.

new code development on github
Pages: [1]
  Print  
 
Jump to: