This repository is a powerful in-game modding plugin and a public template for creating custom tools and UIs for Portal 2, built with Rust and the egui library. It comes "batteries-included" with a suite of professional-grade tools for modders and developers alike.
Get Started • Built-in Tools • Showcase • Documentation • Support
The easiest way to try the overlay is with a pre-built version.
- Go to the Releases Page and download the
injector_server_plugin.zip. - Extract the contents into your
...Portal 2/portal2/folder. - Launch the game.
- Press F3 in-game to toggle the overlay menu's focus.
Note
This overlay does not support Portal 2: Community Edition (P2:CE). For a detailed explanation, please see the P2:CE Support Notice.
Use this framework as a foundation for a wide variety of tools:
- Debug Tools - Real-time variable monitoring, performance profilers
- Gameplay Enhancements - Custom HUDs, information overlays
- Development Tools - Entity inspectors, playtest surveys
- Anything - no, i'm serious, you can do anything!
Version 1.0.0 transforms this framework into a ready-to-use modding toolkit. The following tools are available out-of-the-box:
Edit .vmt files in real-time! Point your crosshair at any surface, grab its material, change properties, validate texture paths, and preview the results instantly without restarting the map.
Easily manipulate fog parameters on the fly. Sync settings directly from env_fog_controller entities on the map to find the perfect atmospheric look.
A dedicated menu for tweaking Bloom, Autoexposure, Motion Blur, and Color Correction LUTs (.raw files). Test color grading instantly inside the engine.
Quick toggles for engine performance, Material System flags (mat_wireframe, mat_fullbright), Renderer debug modes, and crosshair entity inspection.
- Playtest Tool — advanced in-game feedback and bug reporting
- VMF to PBR — in-game interface for editing PBR lightning on Vanilla Portal 2
- P2:RO 3D renderer — A simple software renderer written in Rust that renders custom 3D scenes in Portal 2
- Your project here — see how to add it in CONTRIBUTING.md
[TIP] Add the
p2-rust-overlay-projecttopic to your repo for discoverability!
Direct manipulation of game variables with immediate visual feedback:
xx.mp4
Modern, responsive interface replacing game's default UI:
Video_2025-09-03_13-34-09.mp4
Any egui application can be ported seamlessly:
Ready to create your own tools? This project is a template designed for extension. All development instructions, from setting up your environment to building from source and adding new windows, are in our comprehensive Developer Guide.
crates/
├── injector_*/ # Entry points (don't modify)
├── hook_core/ # D3D9 hooking core
├── overlay_types/ # Shared types, event system, and hotkey abstractions
├── overlay_runtime/ # Manages UI state, input, and rendering loop
├── egui_backend/ # The egui rendering backend for D3D9
├── portal2_sdk/ # Safe bindings to Source Engine functions
└── custom_windows/ # **YOUR CODE GOES HERE! 🎯**
Common Issues & Solutions
| Issue | Solution |
|---|---|
| Overlay not appearing | Press F3 to toggle focus. Check the in-game console and d3d9_proxy_mod.log (in the game directory) for errors. |
| Game crashes on start | Ensure you are using a 32-bit game. Verify game files in Steam. Make sure you placed the DLL in the correct folder (bin is common). |
| Mouse input doesn't work | Run the game in windowed or borderless-windowed mode. |
| Performance drops | Reduce UI complexity |
We welcome contributions! See CONTRIBUTING.md for:
- Setting up development environment
- Keeping your fork updated
- Submitting pull requests
- Code style guidelines
This project wouldn't have been possible without the inspiration and help from several projects and individuals in the community.
- egui - Immediate mode GUI framework
- p2-rtx for inspiring the project and showing that creating external custom GUIs was possible.
- Portal 2 Multiplayer Mod Plugin for serving as a valuable codebase and reference.
Special thanks to @OrsellGit and @0xNULLderef for their invaluable technical assistance with the Source Engine plugin system.
MIT License - see LICENSE for details. Use freely in your projects!
Ready to build your own overlay?
Use this template •
Read the docs •
Get help