Psyrius Posted December 1, 2015 Report Posted December 1, 2015 (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 December 1, 2015 by Psyrius Quote
Squad Posted December 1, 2015 Report Posted December 1, 2015 I believe @shawnolson is the man you're looking for Psyrius 1 Quote
shawnolson Posted December 1, 2015 Report Posted December 1, 2015 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. will2k and Psyrius 2 Quote
Psyrius Posted December 1, 2015 Author Report Posted December 1, 2015 (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/89b660acae99390832b2fedf12371428I found these settings: https://gyazo.com/002782dd085ad7724258702a378e6247But 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 December 1, 2015 by Psyrius Quote
Psyrius Posted December 2, 2015 Author Report Posted December 2, 2015 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? Quote
Pivac Posted December 2, 2015 Report Posted December 2, 2015 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. Quote
Psyrius Posted December 2, 2015 Author Report Posted December 2, 2015 (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 December 2, 2015 by Psyrius Quote
Pivac Posted December 2, 2015 Report Posted December 2, 2015 (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 December 2, 2015 by Pivac Quote
Psyrius Posted December 2, 2015 Author Report Posted December 2, 2015 (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 December 2, 2015 by Psyrius Quote
Psyrius Posted December 2, 2015 Author Report Posted December 2, 2015 (edited) $phongMaskContrastBrightness$phongAmountThese 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 December 2, 2015 by Psyrius Quote
Pivac Posted December 2, 2015 Report Posted December 2, 2015 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$phongAmountThese 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. Quote
Psyrius Posted December 2, 2015 Author Report Posted December 2, 2015 (edited) And I was recompiling every single time... FailFishI 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 Edited December 2, 2015 by Psyrius Quote
Pivac Posted December 2, 2015 Report Posted December 2, 2015 (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: EDIT: I think that video is pretty good, another method but works very well. Edited December 2, 2015 by Pivac Psyrius, leplubodeslapin and FMPONE 3 Quote
Psyrius Posted December 2, 2015 Author Report Posted December 2, 2015 (edited) Do I need to add something to my .VMT for the phong to use the specular map? Edited December 2, 2015 by Psyrius Quote
Pivac Posted December 2, 2015 Report Posted December 2, 2015 No, the game recognizes it automatically Quote
Recommended Posts
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.