SolerSoft / Refract

Real-time holographic game streaming for Looking Glass Portrait.
MIT License
25 stars 3 forks source link

Focus on Window #4

Open jbienz opened 2 years ago

jbienz commented 2 years ago

Is your feature request related to a problem? Please describe. Feature request

Describe the solution you'd like It'd be great if Refract should be targeted at a specific window rather than the entire desktop. This would make it easier to do things like depth editing in PhotoShop.

Describe alternatives you've considered Currently Photoshop has to be maximized.

Additional context N/A

jbienz commented 2 years ago

The shortest path to supporting this would probably be to add support for uWindowCapture in addition to the currently supported uDesktopDuplication. This article (translation required) says that this will be slower than uDesktopDuplication, but if the target window is a lot smaller than the desktop it could be decent.

AJpon commented 2 years ago

This article (translation required) says that this will be slower than uDesktopDuplication, but if the target window is a lot smaller than the desktop it could be decent.

This article was written when uWindowCapture was released. It is old information. uWindowCapture now supports WinRT Windows.Graphics.Capture API. It works very fast. See this article for details.

AJpon commented 2 years ago

WinRT Windows.Graphics.Capture API is not supported on legacy Windows. (Windows 10 1803 or later is required) Currently, the only advantage of using uDesktopDuplication is that it works on legacy Windows. If you want to maintain compatibility, I recommend using uDesktopDuplication as is. However, i suggest you switch libraries if the reason you choose uDesktopDuplication is that it is faster than uWindowCapture.

AJpon commented 2 years ago

There are several libraries for Unity that support WinRT Windows.Graphics.Capture API. uWindowCapture also supports some legacy capture APIs, so it is highly compatible, but it is larger. If you don't care about compatibility, you can consider using a tiny library such as UnityGraphicsCapture.