-
Notifications
You must be signed in to change notification settings - Fork 0
CEF (Host)
CEF_HOST is the external Windows process used by the WebUserInterface plugin. It runs Chromium through CEF in windowless/off-screen mode and produces browser frames that Unreal consumes.
The host is not a standalone desktop browser. It is the render producer in this pair:
CEF_HOST (Host.exe) <-> CefWebUi Unreal plugin <-> UMG / Slate / game code
renderer consumer
Upstream project: ArtemIyX/CefHost.
The host process:
- starts Chromium with CEF windowless rendering;
- renders frames using GPU-accelerated paint callbacks;
- publishes frame metadata through shared-memory ring buffers;
- shares D3D11 textures through named handles for GPU-oriented consumption;
- receives URL, resize, JavaScript, mouse, keyboard, and other control events from Unreal;
- publishes optional console and loading events back to the Unreal plugin.
This arrangement keeps Chromium outside the Unreal process while allowing the Unreal UI to display the rendered browser surface and forward input to it.
- Windows only: the current implementation relies on Win32 and D3D11.
- One host instance per machine/user session is supported. Shared memory, events, and texture objects use fixed names such as
CEFHost_*andGlobal\\CEFHost_*; multiple instances collide. - The host and Unreal plugin must use compatible shared-memory layout and protocol versions.
- CEF runtime files must match the
Host.exebuild. Do not replaceHost.exewithout also checking its CEF bundle.
Clone the upstream repository separately from this Unreal project:
git clone https://github.com/ArtemIyX/CefHost.git
cd CefHostThe upstream project expects a CEF binary distribution under its cef/ directory. Its CMake configuration is Windows/MSVC-oriented and uses C++17.
Configure and build a Release host:
cmake -S . -B build
cmake --build build --config ReleaseThe resulting executable is normally:
CefHost/build/Release/Host.exe
The build also needs to provide the CEF runtime beside the executable, including libcef.dll, .pak/.dat/.bin resources, and locales/. The upstream CMake project copies these from its cef/ bundle into the build output.
Copy the complete runtime output, not only the executable, into the plugin’s ThirdParty CEF directory:
ScpRiftborn/
└─ Plugins/
└─ WebUserInterface/
└─ Source/
└─ ThirdParty/
└─ Cef/
├─ Host.exe
├─ libcef.dll
├─ chrome_*.pak
├─ resources.pak
├─ icudtl.dat
├─ v8_context_snapshot.bin
├─ locales/
└─ ... other CEF runtime files
This location is required because the Unreal plugin resolves the host relative to its own module/plugin installation. Keeping the host beside the plugin’s CEF runtime also ensures that Host.exe loads the matching libcef.dll and resource files.
The repository currently contains both the source-side ThirdParty directory and generated/runtime output locations. For development, the authoritative handoff location is:
Plugins/WebUserInterface/Source/ThirdParty/Cef/
Do not place only Host.exe there. A missing DLL or resource file usually results in a host startup failure or a blank browser surface.
Ensure the project enables CefWebUi:
{
"Name": "CefWebUi",
"Enabled": true
}Then regenerate project files and build the Unreal project. At runtime, the plugin starts the host when a browser session is created and communicates with it through shared memory, events, and shared D3D11 resources.
The host can be run directly from its installed location to verify the external dependency before debugging Unreal integration:
cd C:\path\to\ScpRiftborn\Plugins\WebUserInterface\Source\ThirdParty\Cef
.\Host.exe --url https://example.com --size 1920x1080 --fps 60Supported options include:
| Option | Meaning |
|---|---|
--url <value> |
Startup URL. |
--size <width>x<height> |
Sets the initial browser size. |
--width <value> / --height <value>
|
Sets dimensions separately. |
--fps <1..240> |
Sets the frame cadence. |
--no-thread-tuning |
Disables host thread tuning. |
--enable-cadence-feedback |
Enables cadence feedback. |
--help |
Prints command-line help. |
The Unreal plugin normally supplies the startup URL, size, and control events itself, so direct execution is primarily a packaging and dependency check.
The host and plugin communicate through named channels for:
- frame metadata and frame-ready notification;
- input events and input-ready notification;
- control events and control-ready notification;
- console events and console-ready notification;
- shutdown notification.
The host also publishes a texture ring, an optional popup texture, and a shared GPU fence. The consumer must respect the protocol version, current write slot, frame sequence, and GPU fence values. These details are an implementation contract, not an API to change independently in one repository.
When updating the upstream host or its CEF bundle:
- Build the host and CEF runtime together.
- Copy the complete Release output into
Plugins/WebUserInterface/Source/ThirdParty/Cef/. - Rebuild the Unreal project.
- Test browser startup, frame updates, resize, keyboard/mouse input, popups, and shutdown.
- If the shared layout or protocol changes, update the host and Unreal plugin as one change.
The upstream repository currently documents CEF 146.0.10+g8219561+chromium-146.0.7680.179; treat that as a compatibility reference, not a promise that every future host build will work with the current plugin.
Check that Host.exe, libcef.dll, all .pak/.dat/.bin files, and locales/ are in the same installed CEF directory. Run Host.exe --help directly to separate a packaging problem from an Unreal integration problem.
Verify that only one host instance is running, the host and plugin versions agree, the frame handshake succeeds, and the consumer is reading the current texture slot with the correct fence sequencing.
Confirm the files were copied to Plugins/WebUserInterface/Source/ThirdParty/Cef/, not only left in the cloned CefHost repository. Also check the Unreal logs and enable bShowHostConsole in the plugin’s developer settings.