hecomi / uWindowCapture

This allows you to use Windows Graphics Capture / PrintWindow / BitBlt in Windows to capture multiple windows individually and easily use them as Texture2D in Unity.
https://tips.hecomi.com/entry/2021/04/30/230322
MIT License
504 stars 81 forks source link

(Feature suggestion) Ability to flip texture #6

Closed CurtisVL closed 5 years ago

CurtisVL commented 5 years ago

Hi,

I'm using this asset to display a window capture texture onto a SteamVR Overlay, however, the texture is flipped and as far as I'm aware there's no way to flip it back.

Is it possible to implement an option to flip the texture itself? I'm well aware this could be done through a material within Unity, but in my case the texture is going directly into a SteamVR Overlay, so no material options are available.

Loving the asset so far though, good job. :)

hecomi commented 5 years ago

Thanks for using my asset and giving the feedback!

I'll make 2 options in the future.

  1. add an unlit shader which has a shader property to flip the texture (faster).
  2. add a serialized field in UwcWindowCapture to flip the texture for the case of using different shader from above (slower)

Please wait for the next update ;)

hecomi commented 5 years ago

I released v0.3.0 just a few minutes ago. This version has shaders that has properties to flip the captured texture (the 1. option in the above post). Regarding the 2., I had a significant performance issue, so now I didn't include it in this release.

CurtisVL commented 5 years ago

Thanks for the update! I just wanted to check if you think the 2. would be possible at some point? If it's too much of a performance hit that can't be resolved, that's perfectly fine. I'd just like to know so I can work around it if required. I understand flipping a texture real-time is potentially very intensive. 👍

CurtisVL commented 5 years ago

Going to close this issue as I feel it's not possible without too large of a performance hit! Personally, I work around this issue in my own way anyway! :)