UCefView 1.0.27 Install On Fab Fab logo
World's highest-performance WebView plugin for Unreal Engine. UCefView delivers GPU-accelerated rendering, seamless cross-platform integration and both C++ code and Blueprint development approaches.
Loading...
Searching...
No Matches
Input Passthrough

UCefView supports pixel-level transparent input passthrough. When enabled, the web view only consumes pointer input on visible browser pixels. Mouse, touch, wheel, and drag events over transparent pixels are returned to Unreal as unhandled, allowing widgets behind the web view to remain interactive.

This is useful for HUDs, menus, and hybrid interfaces where HTML/CSS is layered above native UMG or Slate widgets. For example, a floating web menu can consume clicks on its buttons while transparent areas allow the underlying Unreal UI to keep working.

Warning
Pixel-level transparent input passthrough always has a performance cost once enabled, even if the web page does not contain any transparent regions or transparent pixels. UCefView still needs to maintain an alpha mask from the rendered browser texture, so enable it only for views that need pixel-accurate input passthrough.

Enable the Feature

UMG

Select your UCefView widget in the UMG editor and enable:

  • UCefView::bEnableTransparentInputPassthrough

You can also control it from Blueprint through the generated setter:

Slate

Pass the option when constructing SCefView:

SNew(SCefView)
.Url(TEXT("https://example.local/"))
.bEnableTransparentInputPassthrough(true)
A Slate widget that embeds a Chromium Embedded Framework (CEF) browser.
Definition SCefView.h:42

Or change it at runtime:

MyCefView->SetEnableTransparentInputPassthrough(true);

Make the Web Page Transparent

Transparent input passthrough depends on the final rendered alpha value. The web page and the UCefView background must actually be transparent.

For HTML content, make sure the page background does not fill the whole browser:

html,
body {
background: transparent;
}

For UCefView, keep the configured background alpha at 0. If the UCefView background is opaque, the entire view is treated as visible and input will not pass through.

Hit-Test Rules

When transparent passthrough is enabled, the Slate widget checks the local pointer position before handling input. The check follows the visible composition order:

  1. If transparent passthrough is disabled, the view handles input normally.
  2. If the configured browser background is opaque, the view handles input normally.
  3. The main browser frame alpha mask is sampled. Opaque pixels consume input.
  4. If a CEF popup is visible, the popup alpha mask is sampled above the main frame. Opaque popup pixels consume input.
  5. If no visible browser pixel claims the position, the event is returned to Unreal as unhandled so widgets behind the web view can receive it.

Implementation Notes

The alpha mask is maintained by FCefSlateTexture. It uses double-buffered TBitArray<> storage so the active mask is only swapped after a new readback has completed. The same path is used for both pixel-buffer-backed textures and shared-texture-backed textures after they become Unreal UETexture2DRHIRef resources.

Because the mask is read from the rendered texture, this feature reflects the final browser alpha output instead of relying on DOM hit testing. The tradeoff is that texture readback has a cost, so it should be enabled only for views that need pixel-accurate passthrough behavior.

Common Issues

  • If every click is still consumed by the web view, check whether the page or UCefView background is opaque.
  • If only popup content behaves incorrectly, verify that the popup itself has transparent pixels in its rendered output.
  • If the feature is not needed for a view, keep it disabled to avoid unnecessary alpha mask readback.