Download

How to hide a material element from static mesh m.elements?

Hey guys,

Wondering if there is a way to hide a material element from static mesh material elements so you can see a mesh piece underneath, for instance, to hide a helmet so than I can see the face…?

I can see there is no way to hide mesh pieces by hiding their material elements like “with a button” so I have to create an empty material and than make it transparent, than assign it to the mesh piece I want to hide…

Do you mean such hide/reveal effect: Unreal Engine 4 "Infiltrator" Demo - YouTube ? You can download this demo (Infiltrator) as a Unreal Engine project from the Lean Tab in the UE Launcher.
The element you want to hide has to use “Transparent” or “Masked” blend node in your material (depends on a kind of a transition you’re looking for). Then you need to manipulate Opacity or Opacity mask Material input with a texture/parameter, so you can control “hide” effect. The best would be if such object has separate material.

Hey, thanks for the note. But its a bit different…

I was talking about simple “hide” function inside the StaticMesh editor. Just to hide a material element with mesh piece assigned to it, inside the viewport to check what is going one under helmet for instance…

I’ve just noticed “isolate” feature in 4.11. It isolates polygons per material id, and does the opposite to what you wanted, but it’s still helpful.

90f7b376d05e69bd80ed6725df51f06e2296781b.jpeg

Hi,

have you found a solution for this?
I would need something similar, a simple low performance cost “hide mesh part by material” function for skeletal meshes…
otherwise I need to use sockets and a separate static mesh components for weapons, which is a bit more work, and probably performance cost in case of many characters… (in another game engine it has been possible to easily hide mesh groups of a model)

2 sivan

Nope man, unfortunately not:(

2 m.orzelek
Thanks man, indeed a nice feature!

yea we need that to not to have opacity materials… it’s there in editor (isolate) but can’t find it in c++/BPs

edit:
/**
* Show/Hide Material - technical correct name for this is Section, but seems Material is mostly used
* This disable rendering of certain Material ID (Section)
*
* @param MaterialID - id of the material to match a section on and to show/hide
* @param bShow - true to show the section, otherwise hide it
* @param LODIndex - index of the lod entry since material mapping is unique to each LOD
*/
void ShowMaterialSection(int32 MaterialID, bool bShow, int32 LODIndex);

already there

Is that for SkeletalMeshes only? We use special Invicible material that is transparent, do not use fog or depth test, disables basically everything that you can. Then it set sqrt(-1) to world position offset. This generates static NAN to vertex position and compiler optimize vertex shader to empty and those vertices does not produce any pixels so pixel shader cost is also zero. This shader does not even load model vertices because they are not used. It’s not totally free. CPU cost is there because draw call is emitted but GPU cost is almost or even totally zero.

There is now this node to hide / show a material element, material element == material ID.

material-hide.jpg

@m.orzelek
@sivan

if it has a bone in the mesh, you could try “hide bone by name”.
if not, you could possibly use a command to set the texture to invisible.