Alright, been at this since 11am and i've had it. Cannot for the life of me figure out what i'm doing wrong here.
I've all my exported files, my model compiles fine using studiomdl.exe, I have a .mdl .vtf and a .vmt file, i can open up the .mdl fine in the viewer, but i have just a pink checkerboard texture
Here's the folder structure of where each file resides
C: \games\steam\steamapps\username\half-life 2\hl2\Models\pillar\pillar.mdl
C: \games\steam\steamapps\username\half-life 2\hl2\materials\pillar.vtf
C: \games\steam\steamapps\username\half-life 2\hl2\materials\Models\Pillar\pillar.vmt
Here is the .qc file i used to compile the model:
$modelname pillar\pillar.mdl
$cdmaterials models\pillar
$surfaceprop "Wood"
$staticprop
$scale 1
$body studio "Pillar.smd"
$sequence idle "Pillar_idle" fps 1
$collisionmodel "Pillar_phy.smd"
{
$Mass 1
$concave
}
$upaxis Y
and here is the .vmt file:
"VertexLitGeneric"
{
"$basetexture" "Pillar"
"model" 1
"$envmapmode" 1
}
everything i've read says it has to do with $cdmaterials line in the .qc file, but i just cant figure out what's wrong
Any help would be greatly appreciated, i love source engine, but this is rediculous
Replies
Still no luck tho, as far as i can tell the vmt is where it should be, but i'm unsure about the "texture name" section, is that speficied somewhere else that i'm missing.
Here's a printscreen
I'm assuming the "modfolder" prefix is dependant on what engine version and current game you have selected in the source SDK, but correct me if i'm wrong
Also use studiocompiler, great tool.
http://www.chaosincarnate.net/cannonfodder/cftools.htm
With your .qc, you need to smack your .vmt and .vtf in materials/models/pillar
Your .vmt is wrong, it should be (if you named the texture pillar_diffuse)
"VertexLitGeneric"
{
"$basetexture" "models\Pillar\pillar_diffuse"
"model" 1
"$envmapmode" 1
}
If that checks out try:
Try putting both the VMT and VTF files in:
C: \games\steam\steamapps\username\half-life 2\hl2\materials\Models\Pillar\
Then change your
"VertexLitGeneric"
{
"$basetexture" "model\Pillar"
"model" 1
"$envmapmode" 1
}
Starting to think its the maya exporter.... using 2008
What would you guys recommend, i've tried it with both pralls and valves
this is what i get in my output window using pralls
"
exporting vmt files:
phongE1SG
exporting shader
phongE1
*** The following shaders did not export correctly:
phongE1SG
"
Not sure if that has anything to do with my problem but its about the only thing i've got to go on rite now
sounds to me like maya is building up a vmt?
Also your .qc has the correct setup for the material folder. It must be definitely something wrong with the setup prior to exporting/during export.
The vmt looks good to me aswell.
Also take a look here:
http://developer.valvesoftware.com/wiki/Main_Page
but be sure.. I had numerous times overseen a very simple miss match in texture names .. :poly142:
Fun games, but the worst fucking toolset the planet has to offer in video game development for artists.:thumbdown:
that was it man, thanks so much! what a headache....
Turns out in the .smd my texture name was replaced with debug/debugempty for every vert. I manually replaced it this time, but i'm thinking this will only work for a simple model with straight diffuse. I'm certain now that its prall's exporter, guess it doesnt like anything newer than maya 8.... If anyone has a way of making it work with 2008, or a better exporter (valve's is just as messed up in its own ways i'm finding) speak up!
Thanks again for all the help everyone, those valve guys could really learn something from the unity pipeline hehe
I was talking to someone about it and they thought Valve might have some specific tools that help them get around these little things, stuff they haven't released. Which I guess could be the case, after all the community has come up with a lot of helper apps and stuff to smooth over some of these bumps. It's hard to think they wouldn't do the same thing. I sure would like to have some of those tools...
Well, yes. All models are exported with only a diffuse applied to them, any additional maps are defined in the vmt :poly121:
What is it exactly that you find so messed up with valve's exporter? The one time I used it I found it exceptionally easy to work with.
I heard they actually use these community tools at valve as well
But I've never played with them, but that would mean compiling a new prop wouldn't it?
If you can scale props I would love to know how.
Indeed, you can't. You need to recompile your .qc with the $ scale 1.0 parameter, and change that.
On the other hand I feel better when my model is scaled right in max and I export it correctly. But yea you should be able to scale it in hammer tbh.
Solution: import full scale human from source and adjust manually for reference, oh well.
after all this crap i'm starting to feel like a genius, i havnt done this much text edditing since highschool programming
Next source engine will be epic i hope.
And hopefully also decent tools
Don't get me started on the material browser.
I can not wait for the next source update if it includes tool upgrades.
As per usual though, don't hold your breath.
Trying to get specular to work properly
Here is the vtm i'm using to have spec, bump and diffuse. From what i've read to have bump and spec together, you must use the tag "$normalmapalphaenvmapmask" 1
"VertexLitGeneric"
{
"$basetexture" "PillarDiffuse"
"$bumpmap" "pillarNormals2"
"$envmap" "env_cubemap"
"$normalmapalphaenvmapmask" 1
"$bumpscale" 5
"$model" 1
"$nocull" 1
}
The Results i get with that when specular is turned on are seen in image B below, just a nasty cube map, even tho i've swaped the $envmap with several different images, it is still applied as a cube map
I've tried using a phong shader:
"VertexLitGeneric"
{
"$basetexture" "PillarDiffuse"
"$bumpmap" "pillarNormals2"
"$bumpscale" 5
"$model" 1
"$nocull" 1
"$phong" "1"
// "$phongexponent" 33
"$phongexponenttexture" "pillarNormals2"
"$phongboost" "6"
"$phongfresnelranges" "[0.05 0.5 1]"
}
And that results in no specular value, as seen in image A
As it is now, the specular is stored in the alpha channel of the normal map and it is clearly working as a mask (note the concrete below the missing tiles having no shine), however it still emmits the cubemap
EDIT: From the more i read, it seems as tho source doesnt actually support spec just fakes it with cube maps? if this is the case, then what is the phong shader used for and is there a better way to control the intensity of the cubemap?
About the cubemap you probably need to place a env_cubemap in the environment and then in the console type buildcubemap then reload the map. Maps that are just newly built don't have cubemaps created automatically.
http://developer.valvesoftware.com/wiki/Phong
from what i can understand after having read this over and over it is possible, but i cannot figure out a proper vmt
a way to control the enviroment map strength would be $envmaptint which adjusts the cubemaps color and thus by turning it more dark you get a less prominent environment texture.
In addition, $Enviromentfresnel is effective, too
Keep in mind, that if you own episode2 you can bring up the games inbuilt material editor by adding -tools to the launchparamters. With that tool you can load up a vmt and directly change it ingame and see the results. Comes in quite handy.
For dynamicaly lit stuff this vmt I created worked kinda well and gives readable details even in areas that are too dark for dynamical stuff in source normally.
$phongtint does the same for for the phong and enables you to add a little bit of color to the phong lighting. I also suggest to control the phong intesity buy adjusting that parameter instead of phongboost.
Note: Phongboost is required to be set to "1", without that paramter there wont be any phong at all.
The enviroment texture has to be declared BEFORE declaring the phong.
Environment and phong share the same spec mask.
I didnt figure out a workaround for that, as the given examples in the source dev wiki all rendered my phong ineffective.
This should get you the following look ingame:
I hope this helps a little bit.
I've got all my assets set up in hl2 using the hl2ep1 engine, would this screw with me if i were to just start things up using the OB engine?
Unfortunately all i have for the ob engine is tf2, no ep2 so do all the original hl2 assets still work fine?
I know I saved it somewhere but its probably been backed up by now I'll have to go digging through my archives and see if I can find it.
Just recompile them for the orange box engine. The only thing you'd miss with ep1 would be enviromentmapping while using phong.