Custom portal 2 model is blank [SOLVED]

Avatar
Tinarg
10 Posts
Posted Aug 30, 2015

This is my first time making a custom model for Portal 2, or any Source game for that matter. I've exported the model and I've gotten everything working except the model is white with no shading or anything.

http://i.imgur.com/8zEkvD9.png

There aren't any errors in the console, so I don't think its a missing texture. The model's VMT file is a barebones basic

LightmappedGeneric
{
$baseTexture "models/npcs/hover_turret/hover_turret"
}

I was gonna start refining things like the vmt file after I got it working. What's wrong here? Am I doing something wrong that's embarrassingly obvious?

Advertisement
Registered users don't see ads! Register now!
Avatar
Arachnaphob
412 Posts
Posted Aug 31, 2015
Replied 4 hours later

Don't really know much about modeling, but you may want to try out:

VertexLitGeneric
{
$baseTexture "models/npcs/hover_turret/hover_turret"
}
Avatar
Tinarg
10 Posts
Posted Aug 31, 2015
Replied 13 hours later
I just tried it. It's still blank.
Avatar
josepezdj
2,386 Posts
Posted Sep 01, 2015
Replied 17 hours later
I think your model must be looking for a different material location. I use to check out the .MDL file with a Hex Editor and look at the bottom part of the code, where the path and materials that the model is looking for are readable.

Could you post a screenshot once you open it with the hex editor and scroll down to the bottom part?

Avatar
Tinarg
10 Posts
Posted Sep 01, 2015
Replied 18 minutes later
Okay, I'll try looking at it when I get home.
I remember that the SMD file had "Texture.png" listed every other line, which was the name of the texture when the model was being made in Blender. I used a find and replace to replace them all with the path to the actual textures, but it still didn't work. Maybe that's why it's not working to begin with.
Avatar
Tinarg
10 Posts
Posted Sep 01, 2015
Replied 6 hours later

K, checked it out, and this is what it looks like:

http://i.imgur.com/PIVKKrK.png

The directory looks right. The model files are in models/npcs, and the texture files are in materials/models/npcs/hover_turret.

Avatar
Tinarg
10 Posts
Posted Sep 01, 2015
Replied 5 minutes later
I should also mention that the texture file is 2048x1024. Would it being twice as long as it is tall make a difference?
Avatar
josepezdj
2,386 Posts
Posted Sep 01, 2015
Replied 2 hours later
OK, you need the following 2 files inside your folder "materials/models/npcs/hover_turret":

  • hover_turret.VMT
  • hover_turret.VTF

Inside the VMT file of course you must use the shader VertexLitGeneric as Arachnaphob already said, and the path already mentioned for the texture:

VertexLitGeneric
{
$baseTexture "models/npcs/hover_turret/hover_turret"
}

You mentioned you replaced the "texture.PNG" inside the .SMD reference file.... by "hover_turret.VMT"? this is important to check out before compiling the model...

Check these things out and confirm if all is ok.

About the texture size, as long as it is proportional to the one used in Blender, it is fine. I use to make textures double the original size when I need more detail in any model that I reskin

Avatar
Tinarg
10 Posts
Posted Sep 01, 2015
Replied 1 hour later
Both the VMT file and the VTF file are in place. VMT's code is exactly that. In the SMD file, I replaced Texture.png with models\npcs\hover_turret\hover_turret before compiling the model.
Avatar
josepezdj
2,386 Posts
Posted Sep 02, 2015
Replied 5 hours later
Hmmm... you shouldn't have replaced the part 'Texture.png' with the whole 'models\npcs\hover_turret\hover_turret' part, but only with 'hover_turret' and you can also add the extension in the way, so: 'hover_turret.vmt'. The reason is that in your .QC file you already added the path for the model's materials.

Can you post the content of your .QC file and also say the folders where you have the files before compiling the model please?

Avatar
Tinarg
10 Posts
Posted Sep 02, 2015
Replied 16 hours later
Heey, I replaced the "models\npcs\hover_turret\hover_turret" with just hover_turret and it worked!
Advertisement
Registered users don't see ads! Register now!
Avatar
josepezdj
2,386 Posts
Posted Sep 03, 2015
Replied 6 hours later
Glad to hear that.