Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How to achieve masking similar to a fog of war effect?


I am working on a side scrolling game and I need to have an interactive fog of war type mask that is positioned in world space and is applied on all materials in the game. Ive looked into using a TargetTextureRender2D, but I don't know how to make it render only specific elements that i want to use as a mask. Ive included a picture illustrating what i mean.

alt text

Only thing i could come up with is to use the custom depth buffer as a mask, but that would be pretty limiting to what i want to achieve. I did however tried to add the custom depth blendable to the TargetTextureRender2D camera... but it does not work.

I'm wondering what my options are. Can someone point me in the right direction? Are there better ways of doing this? The game I am working on is for mobile platforms. so I am limited in using certain material nodes such as SceneTexture.

Product Version: Not Selected
rendertarget.jpg (105.3 kB)
more ▼

asked May 17 '14 at 11:21 AM in Using UE4

avatar image

28 3 4 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You can still use the SceneCapture2d effect. Create a blueprint with a SceneCapture2d component and stash it somewhere away from the actual level. Put a cube static mesh component in front of it as a background and use a white material for it. Once the game starts change the texture of the material to the render texture. Imagine this as your minimap. If you create a black circle component between the cube and the scene capture2d components and move it around it would leave a black trail on the render texture. Use the same render texture as an alpha mask to create a material for a horizontal plane above all objects in your level and you're done. It would look a bit pixelated though.

more ▼

answered May 21 '14 at 01:03 PM

avatar image

2k 62 24 111

avatar image Unrhyme May 21 '14 at 02:09 PM

Thank you for your reply.

Thats what i was thinking as well, I'd have to create some kind of a parallel level that will be rendered as a mask. But that just didnt seem like the way to do it, I was hoping there was perhaps a more straight forward and efficient way of achieving something like this. Do I have any other options?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question