Jump to content

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


Recommended Posts

Posted (edited)

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 :)

Edited by Psyrius
Posted

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.

Posted (edited)

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]"

 

Edited by Psyrius
Posted

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?

Posted

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.

Posted (edited)

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

Edited by Psyrius
Posted (edited)

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 :)

Edited by Pivac
Posted (edited)

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 :)

Edited by Psyrius
Posted (edited)

$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.

Edited by Psyrius
Posted

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

 

$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.

Posted (edited)
 

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

Edited by Psyrius
Posted (edited)

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:

EcaqbL9.jpg

yicBNLK.jpg 

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

Edited by Pivac

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...