How do I assign my HDA with multiple material elements for Unreal to see?

   5228   26   4
User Avatar
Member
40 posts
Joined: Oct. 2018
Offline
this is exactly the answer to my question… but i'm busy with heightfields in stead of objects.

can someone tell me how to do this with heightfields? i can't just merge them together because then i have double the height maps etc ( i guess thats not good)

when i use a heightfield layer node to merge the 2 masks together, and assign a unreal material before the merge, the second one gets replaced by the first material input resulting in unreal texturing the complete terrain with 1 material instead of using the mask.

can someone help me out here.
User Avatar
Staff
322 posts
Joined: Sept. 2016
Offline
@pande Not sure what you're trying to do here, are you trying to use one landscape with two materials assigned to it?
User Avatar
Member
8 posts
Joined: Sept. 2018
Offline
Hi all! I also have a question regarding this problem and I'm wondering whether there is a way to solve this using material instancing workflow? If I have a mesh with two different groups, each of them with their own material, principledshader, and texture, it is possible to generate materials for each unique principledshader. Extending this, I would like to create multiple instances of one master unreal material and apply those instances to different parts of the generated static mesh. When I am trying to achieve that in Unreal, I get two separate materials generated, but only one of them is used to generate a master unreal material instance which is applied to the entire generated mesh. I hope that the pictures will make my problem easier to understand.

The only solution I can think of now is to generate separate static meshes based on different materials (glancing at the docs it seems like this is not even possible unless you're dealing with collisions/LODs), but regardless I probably cannot do that as I need my generated static mesh to stay seamless.

Attachments:
01_ue_multimatinst.PNG (1.8 MB)
02_ue_multimatinst.PNG (2.3 MB)

User Avatar
Member
40 posts
Joined: Oct. 2018
Offline
dpernuit
@pande Not sure what you're trying to do here, are you trying to use one landscape with two materials assigned to it?

hi and thanks for repplying.

what i'm trying to do eventually, is assign materials to a mask in houdini (a houdini material or a unreal asset with the unreal_material node.. doesn't really matter) so that unreal reads that out. is that even possible?

i got it so far that when i load the .hda file in unreal, the height map gets a material assigned (this was by using the unreal_material node assigning a unreal material, so this part works for me haha)

my problem is this.

when i have 1 heightfield, and make a simple mask. i then make a copy of that mask and invert it. so i have 2 masks nodes next to each other. then i assign a unreal material asset with the unreal_material node to the mask.

the moment i use a heightfield layer to merge those 2 layers (i learned this is the way to merge 2 heightfield layers) the first heightfield material input overrides the second heightfield material input. so i end up both masks having the first material assigned to, also the mask and height layer get the material assigned to. when i choose the mask itself in the unreal_material node to assign the material to, no material at all gets assigned to it. i hope this is clear since i'm not at my pc itself so i cant upload a example file. but its just 6 nodes, 1 heightfield, then 2 masks left and right, with 2 unreal_material nodes, then merge them with the heightfield layer node.

would be so awesome if u can help me figure this out
User Avatar
Staff
322 posts
Joined: Sept. 2016
Offline
@pande I see, so you're actually trying to assign two different unreal materials to a Landscape layer / HF mask ?
That's actually not possible, as unreal only allows you to use one material per Landscape.

Most of the discussion in this topic was for mesh materials, as meshes can be assigned multiple materials.

For Landscapes, they can only have two materials, a main one, and a second one for the holes that are created via the visibility mask. You should use a layer blend on your main material, to define what texture/values/colors to use for a given layer.

In your case, your HF has height, mask and mask2 (dont merge the two masks together, as unreal will then see them as one, and wont be able to texture them differently).
Your unreal landscape will have two layers, mask and mask2.
You need to setup your material with a layer blend that takes into account mask and mask2.

You should have a look at for more details on Landscape materials:
https://docs.unrealengine.com/en-us/Engine/Landscape/QuickStart/4 [docs.unrealengine.com]
User Avatar
Staff
322 posts
Joined: Sept. 2016
Offline
@went_procedural If I understand correctly what you're trying to do, the issue with your current setup is that you're only generating one material instance.

=> Your material node assign two different material for each group
=> The first attribute creates tells the UE4 plugin that everything should use a material instance created from your master material.
=> You override that material instance myTexture to the first principled shader's diffuse.
=> Then you ovveride that same myTexture paramater on the material instance to the second principled shader's diffuse.

End result, you've created a MI from your master material, and overrident its myTexture paramter to the second principled shader.

What you want is, to create two material instance of your master material, on with the first principledshader's diffuse, the other with the second's.

The issue could be that since you're setting the unreal material to the same values, the plugin thinks that you want to use the same material instance for both groups. So Unfortunately, you may have to duplicate your master material.
User Avatar
Member
8 posts
Joined: Sept. 2018
Offline
@dpernuit Thanks a lot for your response! I was thinking that this could be the case so it's good to have a confirmation.
  • Quick Links