Home Unreal Engine

Different materials on object instances

interpolator
Offline / Send Message
Axi5 interpolator
Hey guys quick question!

I'm relatively new to UDK and I'm attempting a modular scene in it for a university project. I've imported one of my meshes, it's just a simple 12 tri chamfer box with some polys trimmed off.

The idea is, I want to be able to re-use this mesh but with alternating materials in order to break up the repetition my scene a little bit. I've got some tiling textures and I was wondering if there was a more efficient way of applying different materials to the same instanced mesh through some voodoo.

Or, would it just be a case of duplicating my mesh in the content browser and applying the different materials there. I'll go this method if I have to, after a quick search I didn't turn up anything about what I was trying to do (presumably bad search terms but heyo). But it just seems a little inefficient. Or is it not?

Thanks for any help (:

Replies

  • Sinking
    Options
    Offline / Send Message
    If you are looking for an efficient engine, switch to Unity ^^

    Honestly though, UDK is great once you get into it a bit more. It's just not the most user-friendly engine by now (still better than Source ^^) Without images it is hard to understand how deep you want the change to go. If you, for example just want to have different tiles show up in different colors on a sort of mosaic wall, you could have one plain wall with tiles and use Alpha masks in combination with a Parameter Change node in UDK. This would make it easy to use one base texture and make several different looking materials from it. They would all be instances though and you'd have to apply every single one to the different meshes.

    If you want completely different materials and/or patterns, you have to make different diffuse, normal and spec maps and treat each material as its own; like what you said. I suggest looking a bit more into UDKs shader networks though, since it is amazing what can be done with materials in UDK.
  • Axi5
    Options
    Offline / Send Message
    Axi5 interpolator
    Sinking wrote: »
    If you are looking for an efficient engine, switch to Unity ^^

    Honestly though, UDK is great once you get into it a bit more. It's just not the most user-friendly engine by now (still better than Source ^^) Without images it is hard to understand how deep you want the change to go. If you, for example just want to have different tiles show up in different colors on a sort of mosaic wall, you could have one plain wall with tiles and use Alpha masks in combination with a Parameter Change node in UDK. This would make it easy to use one base texture and make several different looking materials from it. They would all be instances though and you'd have to apply every single one to the different meshes.

    If you want completely different materials and/or patterns, you have to make different diffuse, normal and spec maps and treat each material as its own; like what you said. I suggest looking a bit more into UDKs shader networks though, since it is amazing what can be done with materials in UDK.

    Thanks for the help!
    I assumed as much, I've yet to delve into UDK's vast material editor and I've seen people do such amazing things with it that it's a little daunting at first.

    My materials are for wood planks, the normals, specular and diffuse would switch completely. It's really not as complicated as using layered alpha textures, so I hoped there was some kind of easy way of doing this. I found a "Used for Instancing" check box in the static mesh editor and thought that might allow me to do what I want but it could be for something completely different.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Actually you can simply drag-drop a material from a content browser to the object in the viewport. So lets say you have your chamfered box two times next to each other in the viewport. You select the material in the content browser that you want to use, and grab-drop it to the first box. Then you choose an another material and you do the same thing just to the another box. Now you have the two (same) meshes with two different materials. Material instance can be also useful in the case that you are in. If you make a material, and you use "texture sample parameter2D" instead of "texture sample", then life is much easier if you want to reuse. If you used this in your material, then if you instance this material, you can switch the texture with two clicks, and you dont have to make new materials. I used this many times. Then you can have only one material that you actually made with connecting the expressions, and when you dont want "effect" changing, just to change the texture, instance it, and change it :)
  • Axi5
    Options
    Offline / Send Message
    Axi5 interpolator
    Obscura wrote: »
    Actually you can simply drag-drop a material from a content browser to the object in the viewport. So lets say you have your chamfered box two times next to each other in the viewport. You select the material in the content browser that you want to use, and grab-drop it to the first box. Then you choose an another material and you do the same thing just to the another box. Now you have the two (same) meshes with two different materials. Material instance can be also useful in the case that you are in. If you make a material, and you use "texture sample parameter2D" instead of "texture sample", then life is much easier if you want to reuse. If you used this in your material, then if you instance this material, you can switch the texture with two clicks, and you dont have to make new materials. I used this many times. Then you can have only one material that you actually made with connecting the expressions, and when you dont want "effect" changing, just to change the texture, instance it, and change it :)


    Oh wow that's fantastic thank you!
    How do you set up the paramater2D correctly to switch between the textures? I've set it up with the group but I can only choose one texture and I'm not sure how to work it.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    When you are in the instance of the material, there is a checkbox next to the texture slot. You need to check this in. Then the parameter is enabled in this instance. Then you can assign a selected texture from the content browser, with the assign button.
  • wes.sau
    Options
    Offline / Send Message
    BTW to answer the last sentence in post#3: "Used For Instancing" in the static mesh editor is intended for meshes used in the foliage system.
  • Axi5
    Options
    Offline / Send Message
    Axi5 interpolator
    Thanks a bunch both of you :D
  • chrisradsby
    Options
    Offline / Send Message
    chrisradsby polycounter lvl 14
    Btw, if you're using a static mesh with several material applied. you can right-click on an instance of that mesh and go: Materials -> NAMEOFMATERIAL -> Assign from assetbrowser.

    For example: if you want to switch out your concrete on a building for bricks but keep the rest.
Sign In or Register to comment.