1. Forums
  2. Discord
  3. About Mapcore
  4. Patreon Supporters
  • Login
  • Register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • More Options
  1. Mapcore
  2. Discussions
  3. Level Design

Need help with 3ds Max, Wall Worm and exporting a model with $phong

  • Psyrius
  • December 1, 2015 at 1:22 PM
  • Psyrius
    • December 1, 2015 at 1:22 PM
    • #1

    I've created a very simple model in 3Ds Max which I want to use $phong on. I've been trying my best to follow the tutorials that's available, but I can't get it to work. The model gets exported, but the textures turn up black.

    I got it working yesterday, but that was without the $phong.

    I'd be very happy If someone have the time to have a chat with me and maybe guide me through each step.

    A simple floor model which I want a slight touch of $phong on: https://gyazo.com/ebd515527318d5d2e64bc85b65f35c49 :)

  • Squad
    • December 1, 2015 at 2:50 PM
    • #2

    I believe @shawnolson is the man you're looking for :)

  • shawnolson
    • December 1, 2015 at 6:40 PM
    • #3

    Phong settings from Max are controlled in the Material settings. Here is a basic overview of Phong settings you can control . I don't have time today to go into it deeply at the moment. But essentially, set the Standard Material's shader type to Phong. Then select your model and click Wall Worm > Wall Worm Materials > Give Obj Mats WW Materials. Now open your material in Slate and click the For Model checkbox and change the Source shader menu to VertexLitGeneric. Now there are some extra phong settings below. Re-export the material.

    At this time, the Phongexponent texture is exported via the Specular Color map. The following video is about exporting a normal map with specular level, but some of the happenings might help you understand the process. Exporting a material with Phong is already lined up as the sequel to this video. But for the moment you'll have to take what you can from this video to understand the principles.

    External Content www.youtube.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

  • Psyrius
    • December 1, 2015 at 6:55 PM
    • #4

    Thanks for the reply. I'll see if I can get it to work!

    "set the Standard Material's shader type to Phong."

    Is this what you mean? Under "Shader Basic Parameters" to Phong? https://gyazo.com/89b660acae99390832b2fedf12371428

    I found these settings: https://gyazo.com/002782dd085ad7724258702a378e6247

    But is it possible to add these parameters some how?

    $phongexponent 150 (I could only choose a maximum of 32 in the settings)

    $phongAmount "[0.3 0.3 0.3 1.0]"

    $phongMaskContrastBrightness "[4 0.5]"

  • Psyrius
    • December 2, 2015 at 3:02 PM
    • #5

    Do someone know if I can edit the .VMT file for the model, tweak the phong parameters there, save and it will work fine? Or is there something else I need to do to get it to work?

  • Pivac
    • December 2, 2015 at 3:24 PM
    • #6
    Quote from Psyrius

    Do someone know if I can edit the .VMT file for the model, tweak the phong parameters there, save and it will work fine? Or is there something else I need to do to get it to work?

    Yes, you can edit visual material properties later on. I model in Blender, but process should be similar. After you export and compile your model, you can change textures and materials and even update live while viewing the model in Hammer (not sure about model viewer). Simply edit the .vmt file, save it, compile your map (I use small map for fast compiles), see the model in-game, exit game, tweak the settings as you wish and repeat until you're happy with it.

  • Psyrius
    • December 2, 2015 at 3:25 PM
    • #7
    Quote from Pivac

    Yes, you can edit visual material properties later on. I model in Blender, but process should be similar. After you export and compile your model, you can change textures and materials and even update live while viewing the model in Hammer (not sure about model viewer). Simply edit the .vmt file, save it, compile your map (I use small map for fast compiles), see the model in-game, exit game, tweak the settings as you wish and repeat until you're happy with it.

    I just tried this, but my phong on my model didn't change anything. I'm trying it out more time after closing SDK and opening it again and changing a setting even drastically to see if it's changing. I'll tell you soon if it works...

    Okay, it seems to be working. I don't really get the effect I'm looking for yet though. But I'll guess I just gotta keep tweaking it until it feels right.

    I had some nice settings which looked super nice before, but that was with exposing the texture to the sunlight. I'm using this floor model inside however and it seems I need to tweak the settings even more to get the same nice effect :)

    This is how it looks like atm:

    "VertexLitGeneric"
    {

    $basetexture "psyrius/wall01b"
    $bumpmap "psyrius/wall01b_normal"


    $phong 1
    $phongexponenttexture "psyrius/concrete/wall01b_normal"
    $phongexponent 40
    $phongAmount "[0.2 0.2 0.2 1.0]"
    $phongMaskContrastBrightness "[5 0.2]"
    $phongboost 1
    $phongfresnelranges "[0.05 0.5 1]"
    "$surfaceprop" "concrete"

    }

    I've also placed 2 strong orange lights close to the ground to see the effect better. But those will be removed later.

    https://gyazo.com/d9625404a1d871e9a7aed5b3438f5d1c

  • Pivac
    • December 2, 2015 at 3:38 PM
    • #8

    Actually now I took a quick look at the tutorial posted above and my process is not really similar to this, so maybe something went wrong there with your model.

    EDIT: Missed half of your post above xD Yes, it looked better before because of the sunlight, phong effect is very noticable when exposed to sunlight, little less when small lights are used :)

  • Psyrius
    • December 2, 2015 at 5:05 PM
    • #9

    I think there's a command in game to reload materials. "mat_reloadallmaterials" is it? Does this work for the phong parameters too? Or do I have to recompile every time to see how it looks like?

    Edit: "mat_reloadallmaterials" works. What a huge time saver! Finally I can make it look nice

  • Psyrius
    • December 2, 2015 at 5:41 PM
    • #10

    $phongMaskContrastBrightness

    $phongAmount

    These doesn't seem to work for models? What a shame... Because I think it was those parameters that helped me get a nice result before without the model. A normal brush surface being hit by the env_light.

  • Pivac
    • December 2, 2015 at 6:13 PM
    • #11
    Quote from Psyrius

    I think there's a command in game to reload materials. "mat_reloadallmaterials" is it? Does this work for the phong parameters too? Or do I have to recompile every time to see how it looks like?

    Edit: "mat_reloadallmaterials" works. What a huge time saver! Finally I can make it look nice

    And I was recompiling every single time... FailFish

    Quote

    $phongMaskContrastBrightness

    $phongAmount

    These doesn't seem to work for models? What a shame... Because I think it was those parameters that helped me get a nice result before without the model. A normal brush surface being hit by the env_light.

    I think these should work. If not, you can use specular map to control the amount of reflection. For this you have to either bake it in 3ds max or paint it manually in Photoshop. It is stored in normal map's alpha channel, a simple way to make reflections look better and it's easy to tweak.

  • Psyrius
    • December 2, 2015 at 6:23 PM
    • #12
    Quote from Pivac

    And I was recompiling every single time... FailFish

    I think these should work. If not, you can use specular map to control the amount of reflection. For this you have to either bake it in 3ds max or paint it manually in Photoshop. It is stored in normal map's alpha channel, a simple way to make reflections look better and it's easy to tweak.

    Does this mean I can just edit my bumpmap texture?

    Edit: Hmm, maybe not. I found this tutorial: https://www.youtube.com/watch?time_continue=97&v=Jdivyau7RlI Maybe that will help me... I'll try my best :P

  • Pivac
    • December 2, 2015 at 6:42 PM
    • #13

    You have to edit you bump map's alpha channel, which makes it a bit complicated, but once you understand how it works it will be easy.

    In Source bump (normal) maps consist of three channels: red, green and blue (more info here: https://en.wikipedia.org/wiki/Channel_(digital_image) ). For this to work we need one more: alpha channel (the one that controls transparency, but in CSGO it's used to control the amount of reflection). I use Gimp for this: I decompose channels and each one of them becomes a separate layer: red, green, blue, alpha. Then I edit only the alpha channel (basically you paint with black, white and gray - black is completely non-reflective, white completely reflective), recompose those layers back in one single layer (image), pack the image as .VMF and test in-game (similar to .VMT testing).

    Here's one example. If you look closely you'll see that the amount of reflection in screenshot corresponds to amount of black/white in texture's specular map (black and white part on the right). This is a brush texture, but it also works on model textures:

    Quote

    [Blocked Image: http://i.imgur.com/EcaqbL9.jpg]

    [Blocked Image: http://i.imgur.com/yicBNLK.jpg]

    EDIT: I think that video is pretty good, another method but works very well.

  • Psyrius
    • December 2, 2015 at 8:48 PM
    • #14

    Do I need to add something to my .VMT for the phong to use the specular map?

  • Pivac
    • December 2, 2015 at 9:09 PM
    • #15

    No, the game recognizes it automatically

  • Psyrius
    • December 2, 2015 at 11:24 PM
    • #16

    Any idea why this would be working on one side: https://gyazo.com/be75dba206c68afce52870e0f6b018a9

    But not on another: https://gyazo.com/077bc04e94acb3e26c490a0122f8788d

    The reflection kind of cuts off at certain points.

  • leplubodeslapin
    • December 2, 2015 at 11:24 PM
    • #17
    Quote from Pivac

    No, the game recognizes it automatically

    ?? Are you sure ?

    I'm pretty sure you have to add "$normalmapalphaenvmapmask" 1 to force the game to use the specular mask saved in the normalmap's alpha channel, or at least that's what i'm doing.

    If you don't set any custom exponent texture (i don't really know how to use it actually), it will automatically use the specular mask, that is also used for the cubemap reflections.

    Quote from Psyrius

    Any idea why this would be working on one side: https://gyazo.com/be75dba206c68afce52870e0f6b018a9

    But not on another: https://gyazo.com/077bc04e94acb3e26c490a0122f8788d

    The reflection kind of cuts off at certain points.

    That's because you have a limited amount of lights that can be taken into account for the phong shader. I remember one time where it only accepted 1 but it should work with 3 or 4 light entities.

  • Psyrius
    • December 2, 2015 at 11:41 PM
    • #18
    Quote from leplubodeslapin

    That's because you have a limited amount of lights that can be taken into account for the phong shader. I remember one time where it only accepted 1 but it should work with 3 or 4 light entities.

    I find it abit weird though, cause if you look on these, it kind of works from one side, but not if you face the other way.

    https://gyazo.com/d6e7eda3bad8d413ce4c6f569a50961f

    https://gyazo.com/f3640647d644d5b5ef10e5326e73b3db

    https://gyazo.com/c9a3f83c19f52ed8ece3c04a2aa7348f

    But you recon that has to do with the amount of lights?

  • Pivac
    • December 3, 2015 at 12:05 AM
    • #19
    Quote from leplubodeslapin

    ?? Are you sure ?

    I'm pretty sure you have to add "$normalmapalphaenvmapmask" 1 to force the game to use the specular mask saved in the normalmap's alpha channel, or at least that's what i'm doing.

    If you don't set any custom exponent texture (i don't really know how to use it actually), it will automatically use the specular mask, that is also used for the cubemap reflections.

    Actually you're right, I completely forgot about that line because I had used it right from the start and later on was just mindlessly copy/pasting and tweaking only the values.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!

Register Yourself Login
Discord

The Mapcore Discord is our lively IRC channel of the 2000s reborn. Chat about level design, gaming, and more.

Latest Posts

  1. How to Use a Free Kundali Maker for Accurate Future Predictions

    astr09
    July 23, 2026 at 6:35 AM
  2. Tangerine

    Harry Poster
    July 18, 2026 at 11:10 AM
  3. Any of the old guard still around? D:

    Warby
    July 12, 2026 at 8:23 PM
  4. About our archived forums

    Thrik
    June 30, 2026 at 2:12 PM
  5. Mapcore Discord

    mason_fan123
    June 24, 2026 at 8:52 PM
  6. [CS2] Valley

    Serialmapper
    June 22, 2026 at 11:56 AM
  7. Free Music / SFX Resource - Over 2500 Tracks

    Eric Matyas
    June 18, 2026 at 12:32 PM
  8. Pango [WIP]

    Elowen
    June 11, 2026 at 10:13 AM
  9. [CS2] Dvina

    Jeremy Rivera
    June 11, 2026 at 10:03 AM
  10. Bridges 2.0 by NEXSIDE, MAP SHOWCASE. ( Steam Workshop )

    MrTrane18
    June 1, 2026 at 7:46 PM
  1. Privacy Policy
  2. Contact
Powered by WoltLab Suite™