Announcement

Collapse
No announcement yet.

Create dynamic mask within overlapping volume

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

    Create dynamic mask within overlapping volume

    I'm trying to create a material that will be masked by a particular overlapping volume.

    Basically, I want to do this (https://www.youtube.com/watch?v=XYPP...9pvhE&index=14) but instead of using a sphere mask, I need to dynamically create a mask based on an overlapping volume.

    How would I approach this? I've been searching an answer to no avail. I'm working in blueprints. I need to somehow mask my material on a per-pixel basis based on current worldlocation overlap.

    Doable?

    Thanks!

    #2
    If when you say volume you mean a square/rectangular shape mask, then you could use a box mask.
    If you are trying to mask based on some irregular complex shape of an overlapping mesh, idk.
    YT Channel: https://www.youtube.com/channel/UCoc...KYPSK6g7vZ5CNg

    Comment


      #3
      In most instances, a box mask should work! So thanks for that, I think that is what I am looking for.

      However, I can think of a least one instance where I am going to need an irregular shape; not *that* irregular, a pyramid and triangular prism. I anyone else has an idea, I'm all ears.

      Comment


        #4
        You can use both sphere/box mask with distance fields to create that mask. the precision will go as much details you decided to have on the object with distance field set.
        Nilson Lima
        Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
        Art is a state of Spirit

        Join us at Discord: https://discord.gg/QJUb5Wk
        UE4 Marketplace:
        Cloudscape Seasons

        Comment


          #5
          Thanks, NilsonLima. I've never used distance fields...not finding very much for how I'd use them as a mask. Would I use the DistanceToNearestSurface node?

          I've also run into a new (obvious) problem with BoxMask - I can only apply one at a time. Hadn't thought of that :/

          Here is what I am trying to accomplish:

          Click image for larger version

Name:	boxmask.jpg
Views:	2
Size:	63.4 KB
ID:	1528416

          I need a system to place doors and windows into a wall. I need to mask the visibility of the wall for each door/window cutout. I was thinking boxMask would at least work for square doors and windows, but am realizing I can only place a single mask per material (obviously!) - so am feeling stuck again.

          My first thought is to add a bunch (50?) of boxMasks to the material the add them all together. That sounds like a major headache, though. (I'd need separate parameter collections for each window/door instance). Memory-wise, I can't imagine that would be very efficient either.

          Am I missing an obvious solution to this problem? What would be the best way to cut multiple holes in geometry dynamically?

          Comment


            #6
            You would need to create a small bp for each window and which one will have material instance references and also the window. The blueprint knows the mesh for the window and can provide the data for the object position and fed into the material. Give me some time to setup this and upload the small project.
            Nilson Lima
            Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
            Art is a state of Spirit

            Join us at Discord: https://discord.gg/QJUb5Wk
            UE4 Marketplace:
            Cloudscape Seasons

            Comment


              #7
              Didn't make it work as I was expecting either... I remember having a solution for this, I will have to dig among my stuff and see if I can find it.
              Nilson Lima
              Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
              Art is a state of Spirit

              Join us at Discord: https://discord.gg/QJUb5Wk
              UE4 Marketplace:
              Cloudscape Seasons

              Comment


                #8
                does this need to happen at runtime? cause if not geometry brushes would be the way to go.
                YT Channel: https://www.youtube.com/channel/UCoc...KYPSK6g7vZ5CNg

                Comment


                  #9
                  Originally posted by NilsonLima View Post
                  Didn't make it work as I was expecting either... I remember having a solution for this, I will have to dig among my stuff and see if I can find it.
                  Thanks for trying! Please do post if you find something.
                  Originally posted by IndieGameCove View Post
                  does this need to happen at runtime? cause if not geometry brushes would be the way to go.
                  It's not happening at runtime, but I am creating functionality within blueprints - so I need meshes.

                  Comment


                    #10
                    hmm I'm going to list out a couple possible solutions all of which are beyond my knowledge of how to actually implement. I just think that they may work, and you can have a few new avenues to look into.

                    you could make a window by making a portal type effect, but instead of the portal going some distance it would just go to the other side of the wall. usually this is done with render targets, there is a gdc talk for the game 'budget cuts' where another method was explained for performance purposes. I didn't understand it though...
                    This video I saved awhile back could be useful for you if you go with portal windows.
                    https://www.youtube.com/watch?v=_SmPR5mvH7w

                    you could make procedural meshes, or along the same lines look into voxels.


                    this guy is either using a bunch of masks or found a way around having to do that. not sure but he said he would be doing a breakdown of the effect eventually.
                    https://realtimevfx.com/t/kashaar-sketch-16-wip/5709
                    YT Channel: https://www.youtube.com/channel/UCoc...KYPSK6g7vZ5CNg

                    Comment

                    Working...
                    X