Source Filmmaker

Source Filmmaker

TF.541 Dec 25, 2016 @ 5:24pm
Having Trouble with Custom Model's AO [Solved]
Update: Solved thanks to "Velikhi Maikeru [Blinn Practice]" I forgot to type $bumpmap when adding it to VMT.

Hello.
I'm currently having trouble with my model's Ambient Occlusion. I made some Voxel models in Cinema 4D for a video and ported them to SFM, but they oddly don't have Ambient Occlusion unless you enable the "Show Ambient Occlusion" button. I've had many suspicions on what's wrong with it, including materials and my qc file, but have had no luck.

At first I thought it was because it was in Cinema 4D, but I remembered I ported a model from Cinema 4D with working AO.

What really gets me is that a model I ported for a friend has working AO. I reused the qc as a template because, honestly, I can't remember as well.

I'd just like to find out why this is happening, and I hope to fix it soon.

My .qc file
$ModelName "tf/fnaf4bullies/foxy_bully.mdl" $SurfaceProp "flesh" $Contents "solid" $MaxEyeDeflection 90 $MostlyOpaque $CBox 0 0 0 0 0 0 $BBox -9.819 -30.182 -0.209 32 30.88 113.99 $sequence idle FoxyBully_Head.smd $CDMaterials "models\tf\fnaf4bullies\foxy_bully" $body FoxyBully_Body FoxyBully_Body $body FoxyBully_Head FoxyBully_Head $body FoxyBully_LArm1 FoxyBully_LArm1 $body FoxyBully_LArm2 FoxyBully_LArm2 $body FoxyBully_LEye FoxyBully_LEye $body FoxyBully_LEyebrow FoxyBully_LEyebrow $body FoxyBully_LFoot FoxyBully_LFoot $body FoxyBully_LHand FoxyBully_LHand $body FoxyBully_LLeg1 FoxyBully_LLeg1 $body FoxyBully_LLeg2 FoxyBully_LLeg2 $body FoxyBully_Mouth1 FoxyBully_Mouth1 $body FoxyBully_Mouth2 FoxyBully_Mouth2 $body FoxyBully_Mouth3 FoxyBully_Mouth3 $body FoxyBully_Neck FoxyBully_Neck $body FoxyBully_Pelvis FoxyBully_Pelvis $body FoxyBully_RArm1 FoxyBully_RArm1 $body FoxyBully_RArm2 FoxyBully_RArm2 $body FoxyBully_REye FoxyBully_REye $body FoxyBully_REyebrow FoxyBully_REyebrow $body FoxyBully_RFoot FoxyBully_RFoot $body FoxyBully_RHand FoxyBully_RHand $body FoxyBully_RLeg1 FoxyBully_RLeg1 $body FoxyBully_RLeg2 FoxyBully_RLeg2 $body Foxy_Head Foxy_Head $body Foxy_Jaw Foxy_Jaw $body Foxy_LEar Foxy_LEar $body Foxy_REar Foxy_REar $body Foxy_Snout Foxy_Snout $body FoxyEyeHoleL FoxyEyeHoleL $body FoxyEyeHoleR FoxyEyeHoleR $body FoxyEyeL FoxyEyeL $body FoxyEyeR FoxyEyeR

My VMT Example:

"VertexLitGeneric" { "$basetexture" "models/tf/fnaf4bullies/foxy_bully/Red" "$surfaceprop" "Metal" "$nolod" 1 "$model" 1 "$basetexture" "models/tf/fnaf4bullies/foxy_bully/bumptexture" $nodecal 1 $nocull 1 $halflambert 0 $diffuseexp 1 "$phong" "1" "$phongexponent" "45" "$phongboost" "1" "$phongfresnelranges" "[1.5 9 1]" "$rimlight" "1" "$rimlightexponent" "0.5" "$rimlightboost" "1.5" "$rimmask" 1 }

Edit: Viewport images

Normal Viewport [i.gyazo.com]

Showing Ambient Occlusion [i.gyazo.com]

Any help would be appreciated
Last edited by TF.541; Dec 25, 2016 @ 5:50pm
< >
Showing 1-7 of 7 comments
Marco Skoll Dec 25, 2016 @ 5:36pm 
$ambientocclusion is used to control AO settings in VMTs.

Otherwise, Source makes a guess as to whether it should be on or off. (I'm not sure what all the criteria are that it uses. Normally things like $translucent will cause Source to default to having it off, but I think there are others).

Although listed as boolean on the Valve Developer Wiki, it's actually a float as far as I can tell, so can use values between 0 and 1 to decide the intensity of the AO effect.
Last edited by Marco Skoll; Dec 25, 2016 @ 5:39pm
TF.541 Dec 25, 2016 @ 5:41pm 
Originally posted by Marco Skoll:
$ambientocclusion is used to enable AO in VMTs. Otherwise, Source makes a guess as to whether it should be on or off. (I'm not sure what criteria it uses).

Although listed as boolean on the Valve Developer Wiki, it's actually a float as far as I can tell, so can use values between 0 and 1 to decide the intensity of the AO effect.
Thank you for the suggestion, but sadly it didn't work. I added it to the VMT, restarted my SFM session, and even included it into the Element Viewer, but to no avail.
Kumquat [Velbud] Dec 25, 2016 @ 5:43pm 
A few things to note:
1) There are a few ways to fix (force) your model to have ambient occlusion. The two easiest ways are to add the codeline $ambientocclusion to either the qc or the VMT (may want to write "$ambientocclusion" "1" in the VMT).

2) Are you sure you know what you are doing in terms of your qc? If so, try removing things you definitely don't need and try to compile the model with the basic requirements for a qc prior to adding back the rest of the components.

3) You have two $basetextures on one VMT. Yes, Source will read the first and ignore the other, but I think that could also be the cause of your problem. Fix that line to be $normalmap or $bumpmap. Same deal as number 2, though. You have a lot of parts that are not needed and may want to remove. Play around with the components without removing the texture lines and I think you should be good. You should also removes the lines with a 0 on them, because that means you turned them off and they may have been turned off by default.

Merry Christmas.

Last edited by Kumquat [Velbud]; Dec 25, 2016 @ 5:44pm
TF.541 Dec 25, 2016 @ 5:48pm 
Originally posted by Velikhi Maikeru Blinn Practice:
A few things to note:

3) You have two $basetextures on one VMT. Yes, Source will read the first and ignore the other, but I think that could also be the cause of your problem. Fix that line to be $normalmap or $bumpmap. Same deal as number 2, though. You have a lot of parts that are not needed and may want to remove. Play around with the components without removing the texture lines and I think you should be good.

My goodness. This is quite embarrassing, but that was the problem. Thank you for noticing something that I've overlooked. I suppose it's because I've done it a lot that you just don't pay attention. Once again, thank you, have a Merry Christmas and Happy New Year.
Marco Skoll Dec 25, 2016 @ 5:59pm 
Originally posted by Velikhi Maikeru Blinn Practice:
3) You have two $basetextures on one VMT.
Dang, didn't spot that - although I wouldn't usually get to the rubber-duck debugging stage until later!

A word of advice on that one is that errors/problems of any sort are usually a call to check SFM's console - something like that would probably throw up an error like "$basetexture is multiply defined in ***.vmt".
Kumquat [Velbud] Dec 25, 2016 @ 8:04pm 
Originally posted by Marco Skoll:
Originally posted by Velikhi Maikeru Blinn Practice:
3) You have two $basetextures on one VMT.
Dang, didn't spot that - although I wouldn't usually get to the rubber-duck debugging stage until later!

A word of advice on that one is that errors/problems of any sort are usually a call to check SFM's console - something like that would probably throw up an error like "$basetexture is multiply defined in ***.vmt".

Have you confirmed this? I'm not sure if SFM would technically report this error, or just ignore it by reading the first one and ignoring the other...
Marco Skoll Dec 25, 2016 @ 8:33pm 
Yeah, "$parameter is multiply defined in material.vmt" is fairly common for me to see on the console when I'm modifying/reloading materials.

I can't confirm that it happens for $basetexture (as that's not something I recall ever having managed to add to a material twice), but I've certainly seen it with a lot of other parameters.
< >
Showing 1-7 of 7 comments
Per page: 1530 50

Date Posted: Dec 25, 2016 @ 5:24pm
Posts: 7