Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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..?
    Last edited by Erigo; 01-05-2016, 01:01 PM.

    #2
    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...

    Comment


      #3
      Do you mean such hide/reveal effect: https://youtu.be/3EJC1edU3Y4?t=46 ? 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.
      UE4 blog: www.michalorzelek.com/blog/ - Tutorials, free content and more!

      Comment


        #4
        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...

        Comment


          #5
          Originally posted by Erigo View Post
          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.

          Click image for larger version

Name:	isolate.JPG
Views:	1
Size:	20.4 KB
ID:	1098753
          UE4 blog: www.michalorzelek.com/blog/ - Tutorials, free content and more!

          Comment


            #6
            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)
            Edge of Chaos RTS
            "Age of Total Heroes" - RTS Pathfinding and Movement System for UE4
            RTS Camera C++ Tutorial

            Comment


              #7
              2 sivan

              Nope man, unfortunately not

              Comment


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

                Comment


                  #9
                  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
                  Last edited by intoxicat3; 10-04-2018, 07:55 AM.
                  How to create first person shooter game from scratch. Lots of tutorials: http://www.shootertutorial.com - celebrating 50th Tutorial!

                  My Marketplace Assets

                  Comment


                    #10
                    Originally posted by intoxicat3 View Post
                    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.

                    Comment

                    Working...
                    X