Commit graph

130 commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks
fb09e98a5f gfx/shader/param-texture: Use obs::weak_source instead of obs::source 2023-04-05 18:58:33 +02:00
lainon
6e1566386e project: Apply more C++ paradigms to the code
- Use auto in places where code clarity is improved or identical.
- Replace trivial constructors and destructors with default.
- Use true random for random generation.
- Use std::string_view where it is valid to do so.
- Apply const where it is valid to do so.
- Use references where it is valid to do so.
- Manually optimize memory usage with std::move and std::copy.
- Opt for memory efficient containers where the size is known ahead of time.

Signed-off-by: lainon <GermanAizek@yandex.ru>
2023-04-05 18:58:32 +02:00
Michael Fabian 'Xaymar' Dirks
30134bd284 gfx/source-texture: Fix bad ref with Debug compiles 2023-04-05 18:58:30 +02:00
Michael Fabian 'Xaymar' Dirks
ba15203c67 gfx/source-texture: Apply formatting as required by clang-format 14 2023-04-05 18:58:26 +02:00
Michael Fabian 'Xaymar' Dirks
8a31b986ab project: Update to new classes 2023-04-05 18:58:22 +02:00
Michael Fabian 'Xaymar' Dirks
b108362ee1 gfx/source-texture: Update to new classes 2023-04-05 18:58:21 +02:00
Michael Fabian 'Xaymar' Dirks
0627628884 obs/tools: Remove work-around for obs_properties_remove_by_name
The bug fix to this was applied upstream, so we no longer need to support the broken behavior
2023-04-05 18:58:20 +02:00
Michael Fabian 'Xaymar' Dirks
cce33eef80 gfx/shader/texture: Fix incorrect placement of modified_type
The previous placement would result in the properties not yet existing.
2023-04-05 18:51:49 +02:00
Michael Fabian 'Xaymar' Dirks
ba05258547 gfx/shader/texture: Improve load/acquire behavior
Prevents massive stalls from happening unexpectedly due to repeatedly loading the same thing over and over.
2023-04-05 18:51:49 +02:00
Michael Fabian 'Xaymar' Dirks
7994d03166 gfx/shader/texture: Add default file annotation 2023-04-05 18:51:49 +02:00
Michael Fabian 'Xaymar' Dirks
c3b1dc2ec2 gfx/shader: Call defaults before update before properties
Fixes an unusual order of initialization bug resulting in poor user experience
2023-04-05 18:51:48 +02:00
Michael Fabian 'Xaymar' Dirks
86cb224783 gfx/shader: Clear render target before rendering
Accidentally left as a comment, this causes things like SMAA to freak out.
2023-04-05 18:51:48 +02:00
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