title: Unreal Engine / C++: How to draw a texture mask based on where 2D UI Widgets are on-screen
body: <p>It seems like the Unreal Engine (4.8.1) lacks a built-in "buffer" or similar that masks out where 2D UI Widgets are laid out on screen while they are being rendered; while it's very simple to extract various Depth Buffers for the 3D world (including 3D UI elements that are part of that domain, unlike the 2D UI that is being rendered on top of everything).</p>
  
  <p>However, I figure that there has to be a way to use C++ and draw some black rectangles on a white base texture; based on the positions and sizes of the UI widgets that are part of a UMG UI HUD. Perhaps, even to extract the absolute screen bounds of each "rectangle" per Widget (in order to avoid having to deal with the various "anchor" points or do conversions from some local UMG space to screen space).</p>
  
  <p>What I'm after, is to create a "render target" texture that looks something like this attachment - that is being updated each frame, or whenever the UI updates (as Widgets may be moved or resized, like when a Minimap or Inventory is re-arranged by the player). A texture asset that in turn can be used in a normal Unreal Material, for example, to mask a Post Process layer:</p>
  
  <p><img src="https://i.stack.imgur.com/cAt5x.png" alt="enter image description here"></p>
  
  <p>Any help would be greatly appreciated as I'm completely stuck on my own.</p>