Text of dev.overwolf.com › ow-electron › reference › examples › overlay › shared-texture-rendering as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Shared texture rendering | Overwolf Developers

Skip to main content From November 1, 2026, Overwolf only approves apps with Overwolf monetization. See Native monetization or Electron monetization . By default, every painted overlay frame is delivered to the injected game as a CPU-side pixel copy before the game composites it. Shared texture rendering switches an overlay window to a GPU path: the overlay hands the GPU texture directly to the game, which composites it without a CPU-side pixel copy.

This significantly lowers per-frame CPU overhead, which matters most for overlay windows that repaint continuously. BETA useSharedTexture is experimental and its behavior may change in a future release. Requirements ​ ow-electron 39.8.10 or later. On earlier versions the option is ignored and the window uses the default CPU copy path. A game running on D3D11 or D3D12. D3D9, OpenGL, and Vulkan games use the CPU copy path.

Application hardware acceleration must stay enabled. Shared texture is a GPU path, so do not call app.disableHardwareAcceleration() — it switches the whole application to CPU rendering. The window must also not set disableHardwareAcceleration . See Hardware acceleration . Offscreen (OSR) overlay windows only. Adopting shared texture requires no migration. It is opt-in and defaults to false . Opting in ​ useSharedTexture is a top-level option on the createWindow options object, not a webPreferences entry: const overlay = app . overwolf . packages . overlay ; const window = await overlay . createWindow ( { name : 'my-shared-texture-overlay' , width : 1920 , height : 1080 , transparent : true , useSharedTexture : true , // opt into the GPU shared-texture path } ) ; Knowing whether the path is active ​ Whether the path can actually be used depends on the game and on the user's machine, so it is only known after the overlay injects into a game.

Whether to opt a window in is your decision — what the flag does not do is put that window at risk: if the path turns out to be unavailable, the window renders through regular CPU rendering instead of failing (see When shared texture is unavailable ). If you do want to know which path a window ended up on, game-window-changed carries two related fields on GameWindowInfo : Field Answers isSharedTextureSupported Does the game's graphics API support GPU textures? true for D3D11 / D3D12, false for D3D9 / OpenGL / Vulkan.

A capability probe only. isSharedTextureAvailable Can the path actually be used on this machine, for this game ? false means the window is rendering on the CPU. overlay . on ( 'game-window-changed' , ( windowInfo , gameInfo , reason ) => { console . log ( 'shared texture available:' , windowInfo . isSharedTextureAvailable ) ; } ) ; Both are undefined until the game is injected and its graphics API is detected, and isSharedTextureAvailable can turn false mid-game — it reflects the current state, not a one-time answer.

When shared texture is unavailable ​ You never get a blank overlay. When any requirement is unmet, the flag is silently ignored and the window renders through the CPU copy path with the only visible difference being default (rather than reduced) CPU overhead. The rendering path also follows the active game for the lifetime of the window: Moving to a game that does not support shared texture falls the window back to the CPU copy path.

Moving to a game that does support it restores the shared-texture path. You do not need to destroy and recreate windows when the user switches games. Note the difference between the two kinds of requirement: Resolved once, at createWindow — the ow-electron version, offscreen rendering, and hardware acceleration. A window that was not eligible when it was created never becomes eligible; it has to be destroyed and recreated.

Re-evaluated per game, at runtime — the game's graphics API and its availability on this machine. This is what "follows the active game" refers to. This is why hardware acceleration is a setup decision rather than a runtime one — see Hardware acceleration . Reacting to the shared-texture-unavailable event ​ shared-texture-unavailable fires at most once per injected game and names the reason. By the time it fires the affected windows are already on the CPU copy path and remain visible and interactive.

Reason What it means What you can do unsupportedGraphicsApi The game's graphics API cannot composite GPU textures (D3D9 / OpenGL / Vulkan). Nothing — expected for these games. gpuAdapterMismatch The game and the overlay are running on different GPUs, which the shared-texture path cannot bridge. Fixable from the first launch with the force_high_performance_gpu switch , or at runtime with setGpuPreference and an application restart. copyFailure The game could not use the textures it received. setGpuPreference may help when the cause is GPU-related. overlay . on ( 'shared-texture-unavailable' , ( reason ) => { // The overlay is already on the CPU copy path and still visible. console . log ( ` Shared texture unavailable for this game: ${ reason } ` ) ; } ) ; Pinning the application to one GPU ​ On multi-GPU machines — a laptop with integrated and discrete graphics, for example — the game may run on the discrete GPU while the overlay runs on the one driving the primary display.

That is the gpuAdapterMismatch reason. There are two ways to put the overlay on the same GPU as the game: force_high_performance_gpu switch setGpuPreference('highPerformance') Applied from Your main script, before the app is ready Anywhere, at any time Takes effect On the current launch On the next launch Scope Chromium's GPU process only Every process started from the application's executable Persistent Windows state None Yes, until you remove it Both keep the discrete GPU awake while the application runs, which costs laptop battery.

At startup: force_high_performance_gpu ​ If your application always shows an in-game overlay, the simplest fix is to start Chromium on the discrete GPU in the first place. Append Electron's --force_high_performance_gpu switch at the top of your main script: // main.ts — must run before the app is ready. import { app } from 'electron' ; app . commandLine . appendSwitch ( 'force_high_performance_gpu' ) ; Chromium reads the switch when it launches its GPU process, which happens after your main script's top-level code runs.

So the GPU process starts on the high-performance adapter on the very first launch, with no restart and no Windows setting written. Call it before the ready event. Called later, it has no effect on a GPU process that is already running. For the same reason the overlay package cannot apply it for you, because packages load after the app is ready. At runtime: setGpuPreference ​ setGpuPreference('highPerformance') records a Windows per-executable GPU preference so both run on the same adapter.

Use it when you did not add the startup switch, or want to pin the GPU only after a mismatch actually occurs. Read before calling setGpuPreference is not a per-window switch, and it is never applied implicitly: It moves the entire application's rendering to that GPU, draining laptop battery and keeping the discrete GPU awake. It writes persistent, user-visible Windows state , visible to the user under Settings → System → Display → Graphics .

It is keyed on the executable path, so moving or renaming the application leaves a stale entry behind. A restart is normally required — Windows reads the preference when the application starts. Call setGpuPreference('default') to remove the entry. This is the recommended revert on uninstall, or when the user turns your overlay off. getGpuPreference() tells you whether the application is already aligned and therefore needs no restart.

It resolves to 'default' when no entry exists. setGpuPreference is idempotent, so calling it unconditionally is safe. overlay . on ( 'shared-texture-unavailable' , async ( reason ) => { if ( reason !== 'gpuAdapterMismatch' ) return ; // Already pinned — nothing to do,

The rest of this page is on the live site.