GameOverlay.Net icon indicating copy to clipboard operation
GameOverlay.Net copied to clipboard

Applying custom HLSL PixelShaders

Open maschere opened this issue 4 years ago • 3 comments

Hi Michel. Thanks a lot for your work on this library. I really like it and it has been very helpful in different projects. I was wondering if you'd consider the following enhancement to the library (or if you have some pointers how to accomplish this in its current state):

  • Extend the Graphics class with a DrawShader function that applies a custom HLSL PixelShader to the whole Screen (think ReShade) or within a specified rectangle only. This would allow to render arbitrary Shader output in the overlay or distort / adjust what you see on the screen (for example making in grayscale or inverting colors).

  • Here is a little mockup of the effects I'd like to achieve with the overlay

overlay_shaders

  • red rectangle: Invert the colors of what's seen below the overlay
  • blue rectangle: adjust the colors of what's seen below the overlay to grayscale
  • green rectangle: render some pixel shader (example taken from https://www.shadertoy.com/view/MdSXzz) and do some kind of alpha blending with what's seen below the overlay

maschere avatar Apr 12 '20 11:04 maschere

Looks like this is totally possible but my knowledge in graphics programming is very limited and i would take a lot of time to read about all the required stuff. I don't think that I can add that myself anytime soon.

I'll drop some links which might help you/me implementing that at some point.

https://docs.microsoft.com/en-us/windows/win32/direct2d/effects-overview https://docs.microsoft.com/en-us/windows/win32/api/d2d1effectauthor/nf-d2d1effectauthor-id2d1effectcontext-loadpixelshader?redirectedfrom=MSDN https://docs.microsoft.com/en-us/windows/win32/direct2d/hlsl-helpers

michel-pi avatar Apr 12 '20 15:04 michel-pi

@maschere do you have any updates on the topic? I would like to be able to do the same thing and haven't found a way of doing it for now.

Versette avatar Dec 28 '20 01:12 Versette

No sorry, I haven't looked into it.

maschere avatar Dec 28 '20 06:12 maschere