Commit Graph

118 Commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks 89f1affe32 gfx/shader: Shaders don't render in sRGB mode 2023-04-05 18:51:47 +02:00
Michael Fabian 'Xaymar' Dirks ab84537a6e gfx/shader/param-texture: Fix detection of enumerations and paths 2023-04-05 18:51:46 +02:00
coolsoft.rf 4601df76d9 gfx/shader/param/texture: Add support for Texture parameters
Implements File, Source and Enumeration type for Texture shader inputs, completing the initial Shader implementation.

Related: #5

Co-authored-by: Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
2023-04-05 18:51:43 +02:00
Michael Fabian 'Xaymar' Dirks 1816e29862 gfx/shader: Optional sRGB support for inputs 2023-04-05 18:51:43 +02:00
Michael Fabian 'Xaymar' Dirks 93a20c7dd4 gfx/shader: Add profiling code and fix problems with properties 2023-04-05 18:51:43 +02:00
Michael Fabian 'Xaymar' Dirks e1b7e6eaf2 gfx/shader: Get-er for currently loaded shader file 2023-04-05 18:51:43 +02:00
Michael Fabian 'Xaymar' Dirks 22786005d6 gfx/shader/param: Track the parent shader object 2023-04-05 18:51:42 +02:00
Michael Fabian 'Xaymar' Dirks 69a72d4975 gfx/shader: Add a way to retrieve the underlying obs_source_t* 2023-04-05 18:51:42 +02:00
coolsoft.rf bba606e439 gfx/shader: Support for visible and active tracking in parameters
Co-authored-by: Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
2023-04-05 18:51:42 +02:00
coolsoft.rf 6aa3f6dbc2 gfx/shader: De-duplicate some code paths
Co-authored-by: Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
2023-04-05 18:51:41 +02:00
Michael Fabian 'Xaymar' Dirks 655ff6e367 third-party: Add GLAD OpenGL wrapper 2023-04-05 18:51:40 +02:00
Michael Fabian 'Xaymar' Dirks 29bbe22bec obs/gs/effect: Preprocess shaders to improve platform compatibility
Improves cross-platform compatibility of Shaders written for StreamFX through the use of preprocessing to make things a bit more compatible. While we don't perform any proper parsing, this will be able to prevent basic issues.
2023-04-05 18:51:38 +02:00
Michael Fabian 'Xaymar' Dirks 28fa127ead gfx/debug: Helper class to handle common debug rendering 2023-04-05 18:51:35 +02:00
Michael Fabian 'Xaymar' Dirks 380d75f770 project: Unify logging structure 2023-04-05 18:51:14 +02:00
Michael Fabian 'Xaymar' Dirks 733b325f98 gfx/blur/dual-filtering: Clean up code
Cleans up the code slightly, without affecting actual functionality
2023-04-05 18:51:02 +02:00
Michael Fabian 'Xaymar' Dirks 011bee032a gfx/blur/gaussian: Fix Gaussian Kernel generation
While the previous method worked, it matches no other implementation including a reference implementation. The new implementation almost perfectly matches the reference implementation and uses oversampling to achieve the goal. This has the downside of limiting the blur size to just 64, but it is necessary in order to achieve correct results.

Fixes #573
2023-04-05 18:51:01 +02:00
Michael Fabian 'Xaymar' Dirks cda430ccad gfx/shader: Apply coding guidelines 2023-04-05 18:51:01 +02:00
Michael Fabian 'Xaymar' Dirks 578d84be63 gfx: Apply coding guidelines 2023-04-05 18:50:59 +02:00
Michael Fabian 'Xaymar' Dirks c84c301d49 obs/gs: Apply coding guidelines 2023-04-05 18:50:59 +02:00
Michael Fabian 'Xaymar' Dirks 015fac588b obs: Apply coding guidelines 2023-04-05 18:50:58 +02:00
Michael Fabian 'Xaymar' Dirks d62da72ce5 util: Apply coding guidelines 2023-04-05 18:50:57 +02:00
Michael Fabian 'Xaymar' Dirks 5a65cf3525 plugin: Replace long descriptions with "Open Manual" button
While the long descriptions were useful, keeping the updated and translated is pretty much impossible. Technology moves fast and not everyone that translates the project knows a lot about technology.

Therefore the long descriptions have now been replaced with a button that opens the wiki page for the feature instead. This should drastically reduce the number of help cases, and improve the translation coverage at the same time.
2023-03-28 13:11:20 +02:00
Michael Fabian 'Xaymar' Dirks e7dd44e3ec gfx/shader: Allow specifying effect for direct rendering (#501) 2023-03-28 13:11:17 +02:00
Michael Fabian 'Xaymar' Dirks eba0a467d5 gfx/lut: Add a simple but efficient LUT producer and consumer
For simple image and video editing, LUTs (Look-Up Tables) are vastly superior to running the entire editing operation on each pixel - especially if all the processing can be done inside a single shader.

Due to the post-processing requirements for our LUTs, we are limited to 8 bits per channel - though clever use of the unused Alpha channel may result in additional space. For our purposes however, this is definitely enough.
2023-03-28 13:11:11 +02:00
Michael Fabian 'Xaymar' Dirks 17ffbdc55e gfx/shader: Correctly cache shader rendering result
Fixes #392
2023-03-28 13:11:06 +02:00
Michael Fabian 'Xaymar' Dirks 54127f6ced gfx/shader: Fix unicode support
Related: #359
2023-03-28 13:11:04 +02:00
Michael Fabian 'Xaymar' Dirks 55ad82aac0 gfx/blur: Fix unicode support
Related: #359
2023-03-28 13:11:04 +02:00
Michael Fabian 'Xaymar' Dirks 63a5873413 project: Remove non-standard std:: prefix from types 2023-03-28 12:52:22 +02:00
Michael Fabian 'Xaymar' Dirks dbb9db596e project: Apply formatting 2023-03-28 12:52:21 +02:00
Michael Fabian 'Xaymar' Dirks dbb71cf801 project: Code cleanup and reapply formatting
Changes applied:

* Moved utility files to /util/.
* Removed unused #includes.
* Removed unused ::ffmpeg::tools function.
* Removed unused variables.
* Fixed missing parentheses in the version macro.
* Fixed missing override on virtual function overrides and removed unnecessary virtual keyword from them.
* Disabled additional warning for ATL headers on MSVC only.
* Replaced direct printf parameters with their macro equivalent.
* Replaced C-style casts with C++-style casts.
* Applied clang-format again after an earlier change to the CMake file broke the integration for it.
2023-03-28 12:52:20 +02:00
Michael Fabian 'Xaymar' Dirks 68a49498e6 common: Rename LOG_ to DLOG_ to avoid macro confusion 2023-03-28 12:52:17 +02:00
Michael Fabian 'Xaymar' Dirks d9198211f7 gfx/shader: Add Per-Instance/Activation/Frame Random values 2023-03-28 12:52:13 +02:00
Michael Fabian 'Xaymar' Dirks b4250a74f5 gfx/shader: Increase size limit and function to get base size 2023-03-28 12:52:12 +02:00
Michael Fabian 'Xaymar' Dirks c1b3972550 gfx/shader/param/basic: Fix bool and suffixes, add enums and optimize
Adds support for enumerations, a different way of selecting how something should behave in a shader. Enumerations rely on a continuous list of values, and will automatically detect how many values there are in the enumeration. Only non-vector types are supported as enumeration entries, and array/vector parameters can have each member set to a different enumeration value.

Furthermore suffixes now are properly assigned, and 'bool' no longer causes shaders to stop rendering. Additionally by inlining some functions and using std::string_view we can achieve a slightly better performance than before.
2023-03-28 12:40:45 +02:00
Michael Fabian 'Xaymar' Dirks a2fd4dd2f6 gfx/shader: Inlining, std::string_view and optimizations 2023-03-28 12:40:45 +02:00
Michael Fabian 'Xaymar' Dirks a9bb56c5ee project: Optimize to use single fullscreen tri instead 2023-03-28 12:40:42 +02:00
Michael Fabian 'Xaymar' Dirks 49f1cbc15e project: Improve performance profiling support
Adds a new CMake option "ENABLE_PROFILING" which enables all CPU and GPU performance profiling available in StreamFX for tracking what's actually causing things to be slow.
2023-03-28 12:40:41 +02:00
Michael Fabian 'Xaymar' Dirks fb024cad73 gfx-blur-dual-filtering: Implement asynchronous rendering
Asynchronous rendering allows the GPU to perform work while the CPU performs other work, and is significantly faster than lockstep immediate rendering. By reusing existing render targets we can see a performance improvement of up to 500%, while still doing the same things.
2023-03-28 12:40:41 +02:00
Michael Fabian 'Xaymar' Dirks 6e8135dc98 gfx-blur-*: Add debug markers for performance tracking 2023-03-28 12:40:41 +02:00
Michael Fabian 'Xaymar' Dirks a553b39a6d gfx-shader: Actually fix the thing 93207d was supposed to fix 2023-03-28 12:40:40 +02:00
Michael Fabian 'Xaymar' Dirks c2c5afd763 gfx-shader: Actually write alpha channel to render target 2023-03-28 12:40:39 +02:00
Michael Fabian 'Xaymar' Dirks a19e8d1e00 gfx-shader: Add default path for file selection 2023-03-28 12:40:37 +02:00
Michael Fabian 'Xaymar' Dirks 7a929d6af4 locale: Add missing and remove unused strings 2020-04-23 09:14:31 +02:00
Michael Fabian 'Xaymar' Dirks 5291b193e2 gfx-shader: Fix rendering at unexpected sizes and fix performance
Fixes rendering at unexpected sizes by first rendering to a render target and then rendering the contents of that render target to the frame buffer instead. This also prevent rendering twice or more, which might cause severe FPS impact.
2020-04-23 08:10:01 +02:00
Michael Fabian 'Xaymar' Dirks 908d1f0a20 project: Modernize code to proper C++ 2020-04-09 00:17:25 +02:00
Michael Fabian 'Xaymar' Dirks a138f95126 cmake: Fix clang support in native OBS Studio build 2020-04-05 06:50:21 +02:00
Michael Fabian 'Xaymar' Dirks 9ca190c96a gfx-shader: Don't use modified_properties to reload shaders
As OBS Studio locks some mutexes in a different order depending on what actions are being done, using modified_properties for GPU work causes things to freeze in place. Instead have users manually click the refresh button when they changed files in order to prevent this freeze from happening.

Fixes: #118
2020-04-03 18:54:56 +02:00
Michael Fabian 'Xaymar' Dirks cc9d3486b2 project: Fix Linux support by fixing errors and warnings
With this, GCC 8 and above should now be able to compile the project both in obs-studio and as a standalone install. Some features are currently still not fully supported and require extra work, but the majority of things are supported and work out of the box. Exact feature parity can be looked up here on the wiki: https://github.com/Xaymar/obs-StreamFX/wiki/Platform-Feature-Parity

Related: #119 #98 #30
2020-04-02 20:37:45 +02:00
Michael Fabian 'Xaymar' Dirks 59fa1d36d7 common: Common header include for improved platform support
This header includes all common data between headers used in the plugin. This should improve cross-platform compiling support whenever possible, as all platform-dependent common includes and defines can be done here.
2020-04-02 17:02:01 +02:00
Michael Fabian 'Xaymar' Dirks ac8844b305 gfx-shader: Add defaults 2020-03-31 22:34:22 +02:00