All the stuff to do with HWNDs is based on a 90s design when merely overlapping two windows was pretty novel. It turns out this is not what the Win32 windowing APIs were ever designed to support. I thought: let's create a child window with support for alpha transparency layered on top of the app. Fortunately I have some familiarity with all this, as past versions of Construct were built using these technologies, so I know the right combination of C++, Win32, JavaScript and modern web APIs to understand all the moving parts here. I'm working on Windows with C++ and good old Win32 APIs. Unfortunately, as I mentioned, this cannot actually be made to work! Here's what I tried. So, Steam wants Direct3D surface in the main process, eh? What if we give it one? The app could render a transparent Direct3D surface on top of WebView2, solely so Steam can render its overlay in to it. (If anyone from Valve is reading: please look at ticket HT-3BB7-YQY6-N3MQ!) WebView2 doesn't appear to have any way to customize the process model to work around it. I explained all this to Steam support but they've not responded usefully yet. Rendering is still happening in a different process, and Steam is not happy. However WebView2 has an app process, a WebView2 process, and a GPU process -in-process-gpu still merges the WebView2 process and GPU process, but you're left with an app process and a WebView2 process. Browsers have a main process and GPU process, and -in-process-gpu merges them. I suspect this is because the process architecture of WebView2 is slightly different. However it does not work for an app using WebView2. This moves all the GPU code to the main process again, and the Steam Overlay works. And it only knows to do this for the main process.īrowsers and frameworks like Electron and NW.js which are also builds of Chromium can work around this with the command-line flag -in-process-gpu. It seems the Steam Overlay has quite an intrusive design, hooking in to the actual rendering code the game uses, and inserting extra drawing at the end of the frame to draw the overlay content directly over the very same backbuffer the game is rendering to. The undocumented limitation in the Steam Overlay appears to be that it only supports rendering over graphics rendered from the main app process. This is a good architecture: it has built-in multithreading to limit the performance overhead, but also GPU code and drivers can be super complicated if it fails only the GPU process crashes, and it can potentially recover from that. All their calls to graphics APIs like DirectX, OpenGL, Metal or Vulkan are now done from a different process to the main app. However the key part is: browsers use a separate GPU process. The Chrome developer blog Inside look at modern web browser has more details if you want to know more. The Windows task manager shows the different processes Edge uses nicely.Ī list of the different browser processes used by the Microsoft Edge browser, as shown by Task Manager on Windows. It's difficult to know for sure as Steam support haven't been too helpful yet, but I suspect this is due to the multi-process architecture of modern browser engines. However running the WebView2 app from Steam, no overlay shows up. The overlay supports games that use DirectX 7 - 12, OpenGL, Metal, and Vulkan.Īt first glance, it looks like things will work: WebView2 uses the Chromium browser engine, which uses the ANGLE graphics library, which translates OpenGL to Direct3D 11 on Windows (by default - there's lots of different backend combinations). Your game does not need to do anything special for the overlay to work, it automatically hooks into any game launched from Steam!. ![]() So, this is the blog post I wish I could have read before trying! How the Steam Overlay worksĭocumentation is fairly limited on the inner workings of the Steam Overlay, but some Steam documentation states: I wrote this post so at least I got a blog post out of a couple of days otherwise wasted work! The technical details are quite interesting too, and perhaps I could save someone else the trouble. I actually failed to get it to work at all: it appears to be impossible to correctly show the Steam Overlay over WebView2. How hard can it be? It turns out: very hard. So I wanted to make sure the Steam Overlay could appear on top of an app using WebView2. If you publish a game to Steam, naturally you'd like it to work with Steam features like the Steam Overlay. ![]() Typically the game is still visible through a semitransparent background. The Steam Overlay showing over a game running in Steam.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |