A cross-platform GPU-accelerated CEF-based (Chromium Embedded Framework) WebView Extension for Godot 4
219
stars
263
commits
Rust
primary language
Sep 9, 2026
updated

A high-performance Chromium Embedded Framework (CEF) integration for Godot Engine 4.5+, written in Rust. Render web content directly inside your Godot games and applications with full support for modern web standards, JavaScript, HTML5, and CSS3.
CefTexture node (extends TextureRect)Variant / JS values) without manual JSON serializationaddListener/removeListener/hasListener![]() | ![]() |
| GitHub page rendered with full interactivity | Web content integrated into 3D scenes |
![]() | ![]() |
| WebGPU demos running natively | WebGL Aquarium at ~120 FPS with 10,000 fish |
Download the latest pre-built binaries from the Releases page, extract the addon to your Godot project's addons/ folder, and you're ready to go!
[!NOTE] During export/package builds, Godot may convert some imported assets into other formats. If your frontend is built with Vite and needs specific source files to remain as-is, you can use
vite-plugin-godot-keep-importto keep imports for selected file types.
extends Control
func _ready():
var cef_texture = CefTexture.new()
cef_texture.url = "https://example.com"
cef_texture.enable_accelerated_osr = true # Enable GPU acceleration
add_child(cef_texture)
extends Node2D
@onready var browser = $CefTexture
func _ready():
# Set initial URL
browser.url = "https://example.com"
# Connect to signals
browser.load_finished.connect(_on_page_loaded)
browser.ipc_message.connect(_on_message_received)
func _on_page_loaded(url: String, status: int):
print("Page loaded: ", url)
# Execute JavaScript
browser.eval("document.body.style.backgroundColor = '#f0f0f0'")
func _on_message_received(message: String):
print("Received from web: ", message)
For comprehensive API documentation, examples, and guides, visit the full documentation.
| Resource | Description |
|---|---|
| API Reference | Complete CefTexture API documentation |
| Properties | Node properties and configuration |
| Methods | Browser control and JavaScript execution |
| Signals | Events and notifications |
| IME Support | International text input |
| Platform | DirectX 12 | Metal | Vulkan | Software Rendering |
|---|---|---|---|---|
| Windows | ✅ (Note 1) | n.a. | ✅ (Note 2) | ✅ |
| macOS | n.a. | ✅ | ❌ [#4] | ✅ |
| Linux | n.a. | n.a. | ✅ (Note 2) | ✅ |
Windows DirectX 12: Requires at least Godot 4.6 beta 2. Godot 4.5.1 contains a bug where RenderingDevice.get_driver_resource on DirectX 12 textures always returns 0.
Vulkan Backends: See #4 for details. On Windows and Linux, we use hooking to inject extensions for GPU-accelerated rendering (x86_64 only). This is a workaround until godotengine/godot-proposals#13969 is resolved. On Linux with NVIDIA proprietary drivers, DMA-BUF acceleration requires the nvidia-drm.modeset=1 kernel parameter; see the Vulkan support guide for GRUB setup steps.
Software Rendering: On platforms where accelerated rendering is not yet implemented, the extension automatically falls back to software rendering using CPU-based frame buffers.
The prebuilt CEF binaries do not include proprietary codecs (H.264, AAC, MP3) due to licensing restrictions in the Chromium/CEF stack. This is an upstream limitation that cannot be addressed within this project.
| Codec Type | Supported (Royalty-Free) | Not Supported (Proprietary) |
|---|---|---|
| Video | VP8, VP9, AV1, Theora | H.264/AVC, H.265/HEVC |
| Audio | Opus, Vorbis, FLAC, WAV, PCM | MP3, AAC |
| Container | WebM, Ogg, WAV | MP4 (with H.264/AAC) |
For best compatibility, encode your media using these royalty-free formats:
Recommended for video: WebM container with VP9 or AV1 video and Opus audio
# Convert video to WebM (VP9 + Opus)
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 -c:a libopus -b:a 128k output.webm
# Convert video to WebM (AV1 + Opus) - better compression, slower encoding
ffmpeg -i input.mp4 -c:v libaom-av1 -crf 30 -c:a libopus -b:a 128k output.webm
Recommended for audio: Opus in WebM/Ogg container
# Convert audio to Opus
ffmpeg -i input.mp3 -c:a libopus -b:a 128k output.ogg
These formats offer comparable or better quality than proprietary alternatives and work out of the box.
If you require H.264/AAC/MP3 support, you must build CEF from source with proprietary codec flags enabled:
proprietary_codecs=true
ffmpeg_branding=Chrome
Important considerations:
See the CEF build documentation for detailed instructions.
For detailed build instructions, see CONTRIBUTING.md.
Install prerequisites: mise and Godot 4.5+
Install the project toolchain:
mise trust
mise install
The commands below assume mise shell integration is active. If your shell is not configured for mise activation yet, prefix commands with mise exec --.
Install CEF binaries:
export CEF_PATH="$HOME/.local/share/cef"
export-cef-dir --version "$CEF_VERSION" --force "$CEF_PATH"
CEF_VERSION is pinned in mise.toml to the CEF runtime build version from the resolved cef / cef-dll-sys crate in Cargo.lock. For example, crate version 152.0.0+152.0.5 uses CEF runtime 152.0.5.
Build:
cargo xtask bundle --release
Copy to Godot project: Copy built artifacts from target/release/ to your project's addons/godot_cef/bin/<platform>/ folder.
See the addons/godot_cef/godot_cef.gdextension file for the complete list of required files per platform.
You can validate bundled addon artifacts with:
cargo xtask validate --addon addons/godot_cef
This project treats panics in crate runtime code as bugs. We do not use panic-based control flow.
panic!, unwrap(), expect(), todo!(), and unimplemented!().cargo clippy --workspace --all-targets -- -D warnings is used as a CI gate.panic = "abort" to prevent unwind-based panic behavior in production artifacts.If you find a runtime panic path, please open an issue or submit a fix.
| Feature | Godot CEF (this project) | godot_wry | gdcef |
|---|---|---|---|
| Browser Engine | Chromium (CEF) | Native OS webview (WRY) | Chromium (CEF) |
| Implementation | Rust | Rust | C++ |
| Rendering | Texture (OSR) | Window overlay | Texture (OSR) |
| GPU Acceleration | ✅ Yes | ✅ Yes | ❌ Software only |
| 3D Scene Support | ✅ Yes | ❌ No (always on top) | ✅ Yes |
| HiDPI Aware | ✅ Yes | ✅ Yes | ❌ No |
| Consistent Cross-Platform | ✅ Same engine everywhere | ❌ Different engines | ✅ Same engine everywhere |
| JS ↔ GDScript IPC | ✅ Yes | ✅ Yes | ✅ Yes |
| Godot Filesystem Access | ✅ Yes (res://) | ✅ Yes | ❌ No |
| Project Export | ✅ Yes | ✅ Yes | ❌ No |
| Headless CI Support | ✅ Yes | ❌ No | ✅ Yes |
| Bundle Size | Large (~100MB+) | Small (uses OS webview) | Large (~100MB+) |
Choose Godot CEF (this project) if you need:
Choose godot_wry if you need:
Choose gdcef if you need:
This project was created during development of Engram. While our first demo version benefited greatly from an interactive UI written in Vue.js using godot_wry, we encountered limitations with the wry-based approach. Since other implementations have long struggled with GPU-accelerated OSR, we decided to create our own solution.
We welcome contributions! Please see CONTRIBUTING.md for guidelines on:
MIT License — Copyright 2025-2026 Delton Ding
See LICENSE for details.
pxp unit (px + var) that can be useful for game UI workflows.Rust
99.0%
A cross-platform GPU-accelerated CEF-based (Chromium Embedded Framework) WebView Extension for Godot 4
219
stars
263
commits
Rust
primary language
Sep 9, 2026
updated

A high-performance Chromium Embedded Framework (CEF) integration for Godot Engine 4.5+, written in Rust. Render web content directly inside your Godot games and applications with full support for modern web standards, JavaScript, HTML5, and CSS3.
CefTexture node (extends TextureRect)Variant / JS values) without manual JSON serializationaddListener/removeListener/hasListener![]() | ![]() |
| GitHub page rendered with full interactivity | Web content integrated into 3D scenes |
![]() | ![]() |
| WebGPU demos running natively | WebGL Aquarium at ~120 FPS with 10,000 fish |
Download the latest pre-built binaries from the Releases page, extract the addon to your Godot project's addons/ folder, and you're ready to go!
[!NOTE] During export/package builds, Godot may convert some imported assets into other formats. If your frontend is built with Vite and needs specific source files to remain as-is, you can use
vite-plugin-godot-keep-importto keep imports for selected file types.
extends Control
func _ready():
var cef_texture = CefTexture.new()
cef_texture.url = "https://example.com"
cef_texture.enable_accelerated_osr = true # Enable GPU acceleration
add_child(cef_texture)
extends Node2D
@onready var browser = $CefTexture
func _ready():
# Set initial URL
browser.url = "https://example.com"
# Connect to signals
browser.load_finished.connect(_on_page_loaded)
browser.ipc_message.connect(_on_message_received)
func _on_page_loaded(url: String, status: int):
print("Page loaded: ", url)
# Execute JavaScript
browser.eval("document.body.style.backgroundColor = '#f0f0f0'")
func _on_message_received(message: String):
print("Received from web: ", message)
For comprehensive API documentation, examples, and guides, visit the full documentation.
| Resource | Description |
|---|---|
| API Reference | Complete CefTexture API documentation |
| Properties | Node properties and configuration |
| Methods | Browser control and JavaScript execution |
| Signals | Events and notifications |
| IME Support | International text input |
| Platform | DirectX 12 | Metal | Vulkan | Software Rendering |
|---|---|---|---|---|
| Windows | ✅ (Note 1) | n.a. | ✅ (Note 2) | ✅ |
| macOS | n.a. | ✅ | ❌ [#4] | ✅ |
| Linux | n.a. | n.a. | ✅ (Note 2) | ✅ |
Windows DirectX 12: Requires at least Godot 4.6 beta 2. Godot 4.5.1 contains a bug where RenderingDevice.get_driver_resource on DirectX 12 textures always returns 0.
Vulkan Backends: See #4 for details. On Windows and Linux, we use hooking to inject extensions for GPU-accelerated rendering (x86_64 only). This is a workaround until godotengine/godot-proposals#13969 is resolved. On Linux with NVIDIA proprietary drivers, DMA-BUF acceleration requires the nvidia-drm.modeset=1 kernel parameter; see the Vulkan support guide for GRUB setup steps.
Software Rendering: On platforms where accelerated rendering is not yet implemented, the extension automatically falls back to software rendering using CPU-based frame buffers.
The prebuilt CEF binaries do not include proprietary codecs (H.264, AAC, MP3) due to licensing restrictions in the Chromium/CEF stack. This is an upstream limitation that cannot be addressed within this project.
| Codec Type | Supported (Royalty-Free) | Not Supported (Proprietary) |
|---|---|---|
| Video | VP8, VP9, AV1, Theora | H.264/AVC, H.265/HEVC |
| Audio | Opus, Vorbis, FLAC, WAV, PCM | MP3, AAC |
| Container | WebM, Ogg, WAV | MP4 (with H.264/AAC) |
For best compatibility, encode your media using these royalty-free formats:
Recommended for video: WebM container with VP9 or AV1 video and Opus audio
# Convert video to WebM (VP9 + Opus)
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 -c:a libopus -b:a 128k output.webm
# Convert video to WebM (AV1 + Opus) - better compression, slower encoding
ffmpeg -i input.mp4 -c:v libaom-av1 -crf 30 -c:a libopus -b:a 128k output.webm
Recommended for audio: Opus in WebM/Ogg container
# Convert audio to Opus
ffmpeg -i input.mp3 -c:a libopus -b:a 128k output.ogg
These formats offer comparable or better quality than proprietary alternatives and work out of the box.
If you require H.264/AAC/MP3 support, you must build CEF from source with proprietary codec flags enabled:
proprietary_codecs=true
ffmpeg_branding=Chrome
Important considerations:
See the CEF build documentation for detailed instructions.
For detailed build instructions, see CONTRIBUTING.md.
Install prerequisites: mise and Godot 4.5+
Install the project toolchain:
mise trust
mise install
The commands below assume mise shell integration is active. If your shell is not configured for mise activation yet, prefix commands with mise exec --.
Install CEF binaries:
export CEF_PATH="$HOME/.local/share/cef"
export-cef-dir --version "$CEF_VERSION" --force "$CEF_PATH"
CEF_VERSION is pinned in mise.toml to the CEF runtime build version from the resolved cef / cef-dll-sys crate in Cargo.lock. For example, crate version 152.0.0+152.0.5 uses CEF runtime 152.0.5.
Build:
cargo xtask bundle --release
Copy to Godot project: Copy built artifacts from target/release/ to your project's addons/godot_cef/bin/<platform>/ folder.
See the addons/godot_cef/godot_cef.gdextension file for the complete list of required files per platform.
You can validate bundled addon artifacts with:
cargo xtask validate --addon addons/godot_cef
This project treats panics in crate runtime code as bugs. We do not use panic-based control flow.
panic!, unwrap(), expect(), todo!(), and unimplemented!().cargo clippy --workspace --all-targets -- -D warnings is used as a CI gate.panic = "abort" to prevent unwind-based panic behavior in production artifacts.If you find a runtime panic path, please open an issue or submit a fix.
| Feature | Godot CEF (this project) | godot_wry | gdcef |
|---|---|---|---|
| Browser Engine | Chromium (CEF) | Native OS webview (WRY) | Chromium (CEF) |
| Implementation | Rust | Rust | C++ |
| Rendering | Texture (OSR) | Window overlay | Texture (OSR) |
| GPU Acceleration | ✅ Yes | ✅ Yes | ❌ Software only |
| 3D Scene Support | ✅ Yes | ❌ No (always on top) | ✅ Yes |
| HiDPI Aware | ✅ Yes | ✅ Yes | ❌ No |
| Consistent Cross-Platform | ✅ Same engine everywhere | ❌ Different engines | ✅ Same engine everywhere |
| JS ↔ GDScript IPC | ✅ Yes | ✅ Yes | ✅ Yes |
| Godot Filesystem Access | ✅ Yes (res://) | ✅ Yes | ❌ No |
| Project Export | ✅ Yes | ✅ Yes | ❌ No |
| Headless CI Support | ✅ Yes | ❌ No | ✅ Yes |
| Bundle Size | Large (~100MB+) | Small (uses OS webview) | Large (~100MB+) |
Choose Godot CEF (this project) if you need:
Choose godot_wry if you need:
Choose gdcef if you need:
This project was created during development of Engram. While our first demo version benefited greatly from an interactive UI written in Vue.js using godot_wry, we encountered limitations with the wry-based approach. Since other implementations have long struggled with GPU-accelerated OSR, we decided to create our own solution.
We welcome contributions! Please see CONTRIBUTING.md for guidelines on:
MIT License — Copyright 2025-2026 Delton Ding
See LICENSE for details.
pxp unit (px + var) that can be useful for game UI workflows.Rust
99.0%