Physical Material Masks?

  1. Create a mask texture with no more than eight colors. The colors must be the 8 colors listed in the material editor (and also PhysicalMaterialMask.cpp): red, green, blue, cyan, magenta, yellow, white, and black. I was able to do this by creating an RGB (no alpha) PNG in Blender.

  2. Create a Physical Material Mask asset in the Content Browser. Then, right click on the asset and select Import Mask Texture. Choose the PNG you created in step 1.

  3. Open a Material (normal material, not physical material) in the Material Editor. Assign the Physical Material Mask asset to it, and then select a Physical Material asset for each of the colors used in your mask texture.

  1. Open the static mesh asset you’d like to use and enable Support Physical Material Masks.

Support Physical Material Masks.PNG

  1. Assign the material to the static mesh.

  2. Put the mesh into a level.

  3. In the console, run: ShowFlag.PhysicalMaterialMasks 1. You can also enable this from the viewports Show menu with Show > Advanced > Physical Material Masks. At this point, selected actors will display the physical material mask, if they have one.

  4. Select the asset you added in step (6) in the 3D viewport and confirm the physical material mask appears.

Once you’ve done all this, you can get the physical material from collision hit results, though this currently only works if Chaos physics is enabled.

9 Likes