Announcement

Collapse
No announcement yet.

How to create TextureRenderTarget2D mask (Fog of War effect)

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

    How to create TextureRenderTarget2D mask (Fog of War effect)

    Hi I am wondering if it is possible to have a Scene Capture 2D camera to only render certain materials and not render the rest.
    The reason for this is that I want to create a streaming texture mask that captures only the elements of the screen that i want to use as a mask.
    I want to have R/G/B colored materials in the scene that will only be visible to the Scene Capture 2D camera.
    So then I would end up with RGB channels I can use for full screen masks that keep changing depending on the invisible elements inside the scene.

    Best way to describe the sort of effect I want to achieve is something like the fog of war in RTS games.

    how would I go about doing this? I would appreciate your help greatly!

    #2
    here is a drawing to illustrate what i mean:

    Click image for larger version

Name:	rendertarget.jpg
Views:	1
Size:	102.8 KB
ID:	1050520

    Comment


      #3
      May you can create a "Post Process" material with your mask as input.

      Click image for larger version

Name:	postProcessUE4.JPG
Views:	1
Size:	99.2 KB
ID:	1050529

      Comment


        #4
        the mask needs to be an interactive mask that animates and changes in shape. i tried to do this using invisible objects with custom depth turned on.. it seemed like a solution at first. but then i found out that i cannot do a TextureTargetRender2D with post processing applied to it. i tried using the custom depth material as a blendable on the SceneCapture2D camera, but it did not work. on top of that, the SceneTexture node that is used in this post processing material is not supported on mobile platforms.

        the only way i could think of is to have the SceneCapture2D camera to capture a hidden scene that runs parallel to the actual level. and then somehow use the TextureTargetRender2D as a mask on all the level materials. but this doesnt feel right to me. there has to be a better way and i hope someone here can point me to the right direction.

        Comment


          #5
          Have you had any progress on this problem? I'm trying to achieve something similar:
          https://answers.unrealengine.com/que...r-texture.html
          Join us on IRC! We are on #unrealengine @ freenode.org

          Comment

          Working...
          X