• Multiple effects for models?
    9 replies, posted
Is it possible to have a single prop use two different VMTs? I'm currently trying to get two different phong effects for the grip and the blade parts of the sword so that the blade has more shine while the grip stays less shiny. Is this possible in GMod? And how would I set it up and map it in Blender and VTFs/VMTs. I already have a standard vmt for the weapon in case I can't do this, but I was wondering if it would be possible in Source to do this. I think you can do it for ragdolls, but I'm unsure of how to do it for props as I'm still relatively new to importing and compiling models.
Two different smd's, I guess. Or two different groups in one smd. But I'm new to the whole thing, so I'm guessing.
All you really need to do is apply a different texture to whatever parts you want to have different parameters. I say different texture as in any image with a different filename as it doesn't really matter all that much provided you use the correct texture later. When compiled it will search of a new material file of the same name as the texture you applied earlier on top of the existing material file on portions you left alone. If you want to use the exact same texture as before feel free to just copy and paste the existing material file and rename it to match your new one. From there you can freely edit the parameters for that portion independent of the original material.
Hmm... I'll give it a go tomorrow and see what I end up with. Thanks for the help. By the way, how would I export it? Do I just do it all as one model?
Just as one model works fine. The SMD keeps texture IDs correctly.
[QUOTE=wraithcat;43980428]Just as one model works fine. The SMD keeps texture IDs correctly.[/QUOTE] alright thanks! :)
Unless you plan on using envmaps for reflections, you can also use the normal map's alpha mask phong uses (specular mask) and phong exponent textures to control the phong's intensity. In other words, using these two masks, you could tell the material what should have a very minor broad shine for leather and what should have a sharp bright highlight for hard metals and such without needing to split the material. You can find additional info [url="https://developer.valvesoftware.com/wiki/$phong"]here[/url] and [url="https://developer.valvesoftware.com/wiki/Phong"]here.[/url]
[QUOTE=CaptainBigButt;43980988]Unless you plan on using envmaps for reflections, you can also use the normal map's alpha mask phong uses (specular mask) and phong exponent textures to control the phong's intensity. In other words, using these two masks, you could tell the material what should have a very minor broad shine for leather and what should have a sharp bright highlight for hard metals and such without needing to split the material. You can find additional info [url="https://developer.valvesoftware.com/wiki/$phong"]here[/url] and [url="https://developer.valvesoftware.com/wiki/Phong"]here.[/url][/QUOTE] I've looked through those, and it leaves me rather clueless on what I should do for it. Playing around in GMod, I was only able to get it to reflect one way. That's why I wanted to do two different textures. Could you provide an example of a vmt that would do this?
I'll see if I can break it down for you. First of all, you have phong. Phong is one of the shaders you'll use pretty much everywhere. Phong is responsible for creating a nice shine on models, such as the shine on a polished desk or the shine you'll see on someone who is wet. Secondly, you have envmaps. Envmaps are responsible for actual "reflections" which can be done with a cubemap you make or by pulling the nearest cubemap in the map. Envmaps are responsible for reflective surfaces such as basic mirrors or polished metal. Your material can either be shiny, reflective, both, or neither. The only problem is that by default, both of these try to use the same mask which is really only a bad thing if you want part of the material to be shiny, but not reflective or vice-verse. Other than that it can reduce the amount of materials you need. Essentially both of these materials use the normal map's alpha channel by default (though envmap needs to list it). This is a monochrome channel which allows you to control where the phong or reflection should exist and by how much. [URL="https://developer.valvesoftware.com/w/images/thumb/d/da/Scanner_mask.jpg/250px-Scanner_mask.jpg"]here's[/URL] and example specular mask on the HL2 scanner. Essentially white areas have shine based on the values in the material while black areas do not. Any grays in between will have the shine (or reflection) at a reduced intensity. For phong in particular, you can also use a mask to control the phong exponent which is how sharp or broad a shine is. White areas have tighter shines while black areas have broader shines and gray is anything in between. To explain this a little more; harder, shinier objects tend to have sharper highlights. A polished wooden desk may be have a relatively broad shine as opposed to the shiny metal legs supporting your chair. Anyway, I hope my rambling made any sense. If you have to split the material, you're still welcome to. Using an additional material isn't a bad thing at all but sometimes it's not hard to avoid. Edit: I forgot to mention this but you can use "mat_diffuse 0" to turn off diffuse maps and experiment with how phong works on models. Keep in mind that this also turns your console and menus black for some reason. Just make sure you spawn the models you want first and don't be alarmed if you can't see the console -- it'll still register "mat_diffuse 1" when you want to restore it.
[QUOTE=CaptainBigButt;43988353]I'll see if I can break it down for you. First of all, you have phong. Phong is one of the shaders you'll use pretty much everywhere. Phong is responsible for creating a nice shine on models, such as the shine on a polished desk or the shine you'll see on someone who is wet. Secondly, you have envmaps. Envmaps are responsible for actual "reflections" which can be done with a cubemap you make or by pulling the nearest cubemap in the map. Envmaps are responsible for reflective surfaces such as basic mirrors or polished metal. Your material can either be shiny, reflective, both, or neither. The only problem is that by default, both of these try to use the same mask which is really only a bad thing if you want part of the material to be shiny, but not reflective or vice-verse. Other than that it can reduce the amount of materials you need. Essentially both of these materials use the normal map's alpha channel by default (though envmap needs to list it). This is a monochrome channel which allows you to control where the phong or reflection should exist and by how much. [URL="https://developer.valvesoftware.com/w/images/thumb/d/da/Scanner_mask.jpg/250px-Scanner_mask.jpg"]here's[/URL] and example specular mask on the HL2 scanner. Essentially white areas have shine based on the values in the material while black areas do not. Any grays in between will have the shine (or reflection) at a reduced intensity. For phong in particular, you can also use a mask to control the phong exponent which is how sharp or broad a shine is. White areas have tighter shines while black areas have broader shines and gray is anything in between. To explain this a little more; harder, shinier objects tend to have sharper highlights. A polished wooden desk may be have a relatively broad shine as opposed to the shiny metal legs supporting your chair. Anyway, I hope my rambling made any sense. If you have to split the material, you're still welcome to. Using an additional material isn't a bad thing at all but sometimes it's not hard to avoid. Edit: I forgot to mention this but you can use "mat_diffuse 0" to turn off diffuse maps and experiment with how phong works on models. Keep in mind that this also turns your console and menus black for some reason. Just make sure you spawn the models you want first and don't be alarmed if you can't see the console -- it'll still register "mat_diffuse 1" when you want to restore it.[/QUOTE] Could you explain a little more on how the what you talked about correlates to the phong commands specifcally? I kinda understand it, but I don't really know how to apply it as I don't know how to relate what you said to the phong commands and vice versa. For now I'm trying to use two different textures until I can get a hang of the phong manipulations....
Sorry, you need to Log In to post a reply to this thread.