Wall Worm Forums

Design Tools => Wall Worm Model Tools => WWMT Questions => Topic started by: Mospheric on December 04, 2012, 02:32:47 PM

Title: Getting Spec to work in models
Post by: Mospheric on December 04, 2012, 02:32:47 PM
So I'm an artist working with a mod team on a Left 4 Dead 2 mod. I've never used the Source engine before, and I sure have a lot to complain about (coming from UDK and Unity). So it's been absolutely wonderful to have WWMT to help automate a lot of the details that would have taken me a while to wrap my head around.

So I'm currently working on several props. We've had a few issues getting them working, but the biggest issue is getting the spec map to work. No matter what I try, I can't seem to preview it in the Model Viewer found in the L4D2 Authoring Tools. I'm using Tgas. I put the spec into the alpha of the normal and saved it as a 32bit alpha uncompressed Tga.

When I export from Max, I get the VMT that has the $normalmapalphaenvmapmask "1" I don't see why this shouldn't work after looking over different forums. Any suggestions as to what I could try?

Here's one of the assets from Max that has spec on it.

(https://www.wallworm.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FlyYIo.jpg&hash=64b093e7b3f423e594824e1617b59914bbe4cdd7)
Title: Re: Getting Spec to work in models
Post by: wallworm on December 04, 2012, 04:19:29 PM
A couple of ideas:

First, if you want to see Specular that is in the normal map, you must make sure that in the Model Viewer both Normal Mapping AND Specular are checked in the Render Tab.

Second, even if you have specular maps in a material, they will not display in a compiled level automatically. You must run buildcubemaps for them to appear (in mods I'm familiar with).

Moreover, in most circumstances, you have to do things like this:

sv_cheats 1
buildcubemaps
mat_hdr_level 0
map mymapname
buildcubemaps
mat_hdr_level 2
map mymapname

This is, I presume, for levels compiled in HDR and LDR. I am not certain yet what it means for some mods like CS:GO where there may not even be LDR.

Hopefully that helps.
Title: Re: Getting Spec to work in models
Post by: Mospheric on December 05, 2012, 12:19:10 AM
Thanks for your quick reply Shawn! I spent the evening trying to figure out my spec issue. I dismantled some of Valve's vmts to check out what they did. Most use a phong shader to create the feel of a spec map while not directly using a spec map. I added a phong shader to mine and got something that looks way better. I'll have to keep tweaking it and hopefully get something decent.
Title: Re: Getting Spec to work in models
Post by: wallworm on December 05, 2012, 09:47:38 AM
Glad you are getting good results. Feel free to share your progress here. Share any tips for others.
Title: Re: Getting Spec to work in models
Post by: wallworm on December 05, 2012, 01:30:21 PM
Just for reference, I've updated WW today that had some material fixes. 1) the compression setting in WWMT got fixed. 2) I added new logic for exporting $phong. If you change your Shader Type to Phong (instead of the default Blinn) and your Material's Specular Color (in Maps rollout) is on (checked) the VMT will use phong. Previously it also required a bitmap in spec color.