Commit Graph

348 Commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks d29f5ce477 filter-transform: Transform to transform, ...Addon to ..._factory 2019-01-25 00:38:20 +01:00
Michael Fabian 'Xaymar' Dirks 2aa4595bd3 filter-displacement: Rename Displacement to displacement, ...Addon to ..._factory 2019-01-25 00:38:01 +01:00
Michael Fabian 'Xaymar' Dirks 7a61006d2b source-mirror: Rename Mirror to mirror, ...Addon to ..._factory 2019-01-25 00:36:54 +01:00
Michael Fabian 'Xaymar' Dirks a37d9bbb59 filter-shadow-sdf: Actually delete instances in destroy()
This fixes a memory leak discovered by @catb0t.

Related #33
2019-01-25 00:31:50 +01:00
Michael Fabian 'Xaymar' Dirks ddfb08f39e filter-displacement: Update file logic and rendering
This replaces the use of gs_texture_t* with gs::texture, further improving stability. Additionally some of the useless checks were replaced or reduced.
2019-01-25 00:28:06 +01:00
Michael Fabian 'Xaymar' Dirks 0bdf8e3bba filter-displacement: Use gs::effect instead of gs_effect_t*
The managed gs::effect class handles all acquire and release calls for us. Also slightly simplifies the video_render logic.
2019-01-25 00:28:06 +01:00
Michael Fabian 'Xaymar' Dirks fedb6e3259 filter-displacement: Further refactoring 2019-01-25 00:28:06 +01:00
Michael Fabian 'Xaymar' Dirks c1995c03a9 filter-displacement: Refactor to match new class structure 2019-01-25 00:28:05 +01:00
Cat Stevens c749f5dd62 obs-audio-capture.hpp: missing memory include 2019-01-24 23:30:42 +01:00
Michael Fabian 'Xaymar' Dirks 160ad3b5a9 locale: Replace file filters with file types
The filters are always the same for every language and should not be translated, instead only the file type should be translated. This way bad translations will not affect the options that the user can select.
2019-01-24 20:34:28 +01:00
Michael Fabian 'Xaymar' Dirks 0ae120835a filter-transform: Optimize rendering, fix bad property names
The Transform filter will now no longer render the child source more than once per tick(), resulting in an overall speed up for heavy sources. This also applies to mipmapping and shape rendering. Any other calls to video_render will instead just use the cached texture.

Additionally the crash on exit has been fixed which was caused by strings.hpp containing static const char*s and using these directly in obs calls. Instead we now use #define for those property names
2019-01-24 20:20:34 +01:00
Michael Fabian 'Xaymar' Dirks e28334d27b util-memory: Fix alligned_alloc for MSVC
Microsofts _aligned_malloc has size and alignment switched around, which causes an unwanted exception.
2019-01-24 20:18:28 +01:00
Michael Fabian 'Xaymar' Dirks b3c2845d15 filter-transform: Refactoring and formatting 2019-01-24 15:57:33 +01:00
Michael Fabian 'Xaymar' Dirks e4a534fbfe plugin: Remove legacy instance references
The modern system is a self-registering system using initializers and finalizers
2019-01-24 14:26:08 +01:00
Michael Fabian 'Xaymar' Dirks 406326b378 util-math: Add 16-byte aligned version of vec2 2019-01-24 05:14:17 +01:00
Michael Fabian 'Xaymar' Dirks 98baa0d98b filter-transform: Fix order of functions 2019-01-24 04:35:22 +01:00
Michael Fabian 'Xaymar' Dirks ff6176d7bc filter-transform: Destructor comes before Constructors 2019-01-24 04:33:56 +01:00
Michael Fabian 'Xaymar' Dirks c1441e72c0 filter-transform: Refactor to match source-mirror structure 2019-01-24 04:32:14 +01:00
Michael Fabian 'Xaymar' Dirks 9d55013ec2 source-mirror: Improve rendering and add new rescaling options
Rendering will now use a cached version of the mirrored source in order to reduce rendering cost drastically for heavy sources or scenes. Additionally rescaling now uses the internal scene instead of being a custom implementation, allowing for some new things.

Rescaling now has a new option: Bounds Type! This option allows control over just how a source is scaled, by default it is set to Stretch, but there are other options that can keep the aspect ratio of the mirrored source in tact.

Additionally the ScalingMethod struct has been replaced with obs_scale_type, which means that Bilinear Low Resolution is now no longer an option.

Implements #35
2019-01-24 04:28:11 +01:00
Michael Fabian 'Xaymar' Dirks 82f64d16eb source-mirror: Refactoring and partially revert 4bb32a71bc
Initialization happens in the constructor again, as using a delayed initialization only caused update() to be slower.

Additionally refactored some variable names to make more sense.
2019-01-24 01:12:48 +01:00
Michael Fabian 'Xaymar' Dirks 144323bec3 source-mirror: Revert thread name from c5e02af178 2019-01-24 01:00:38 +01:00
Michael Fabian 'Xaymar' Dirks 6b7ef2d3ed gfx-source-texture: Allocate a render target in constructor
Can't really render without one.
2019-01-24 00:12:42 +01:00
Michael Fabian 'Xaymar' Dirks bf35b54957 gs-rendertarget: Don't ignore failed creation of render target 2019-01-24 00:08:26 +01:00
Michael Fabian 'Xaymar' Dirks 04ddf76920 source-mirror: Release reference in modified_properties callback
Fixes the problem where additional references to other sources would appear if properties are opened or modified.

Fixes #34
2019-01-23 23:23:49 +01:00
Michael Fabian 'Xaymar' Dirks 4bb32a71bc source-mirror: Use load() and update() for initialization
load() is guaranteed to happen after all sources have been created and no earlier, and we can use update() to guarantee that we don't need to duplicate our initialization code in case we go back to initializing earlier than load().
2019-01-23 22:25:48 +01:00
Michael Fabian 'Xaymar' Dirks b2b3f5fde8 source-mirror: Add empty list entry to select no source 2019-01-23 22:04:25 +01:00
Michael Fabian 'Xaymar' Dirks c5e02af178 source-mirror: Remove unused references, set scene and thread name 2019-01-23 22:03:47 +01:00
Michael Fabian 'Xaymar' Dirks 73b96b8900 source-mirror: Fix various issues, reformat, redesign
This fixes the multi-reference issue that caused Source Mirror to keep a permanent reference to a source that should have been released.

The obs::audio_capture was also updated to now use the util::event code for improved callback support. There are a bunch of new additional checks in the acquire_input function that prevent bad references from happening, and is also now self-cleaning through the use of obs::source
2019-01-23 21:06:05 +01:00
Michael Fabian 'Xaymar' Dirks 911b8a1cf4 obs-audio-capture: Use util::event and delete move and copy operator
By using util::event a single obs::audio_capture can now have multiple callbacks for the same data, without requiring additional obs::audio_capture to be present. Additionally it allows us to stop listening on an obs callback if there are no actual listeners, and start listening as soon as there is a listener.

Move and Copy constructors are currently not supported by this class and thus have been marked deleted. Internally also now using obs::source to keep track of the used source.
2019-01-23 20:06:30 +01:00
Michael Fabian 'Xaymar' Dirks 52af973014 util-event: Listen, Silence callbacks and other operators 2019-01-23 20:02:50 +01:00
Michael Fabian 'Xaymar' Dirks 9848c5aa28 obs-source: Implement copy and move constructors and operators
There was no proper implementation for all copy and move constructors and operators before, which meant that occasionally the default behavior took over. This is not what we want, as the default behavior doesn't deal well with reference counted pointers.

Related: #32, #33
2019-01-23 18:49:20 +01:00
Michael Fabian 'Xaymar' Dirks f910312a2d gfx-effect-source: Make destructor virtual 2019-01-23 02:26:32 +01:00
Michael Fabian 'Xaymar' Dirks 5a54a67946 project: Remove unused parameters and fix additional warnings 2019-01-23 02:26:32 +01:00
Michael Fabian 'Xaymar' Dirks f0fa36a19e source-mirror: Fix format string and remove unused parameters 2019-01-23 02:26:32 +01:00
Michael Fabian 'Xaymar' Dirks 52f4e4641f project: Additional #ifdef _MSC_VER checks 2019-01-23 02:26:32 +01:00
Michael Fabian 'Xaymar' Dirks f41bd2c7c1 source-mirror: Remove unnecessary register keyword
This keyword also no longer exists in C++17
2019-01-23 02:26:32 +01:00
Michael Fabian 'Xaymar' Dirks ec544bddb3 gs-texture: Move ENABLE_BITMAPS_OPERATORS to global scope 2019-01-23 02:26:32 +01:00
Michael Fabian 'Xaymar' Dirks e0e2d9fe80 project: Improve Linux support (#27 and #13)
While Linux was not an original goal of the project, it should still be supported out of the box. Therefore a number of changes are contained in this changeset:

- All C++ .h files were renamed to .hpp.
- All C includes (<....h>) were replaced with C++ includes (<c...>) and missing includes were added.
- std::memset and std::memcpy was replaced with memset and memcpy.
- All anonymous structs were removed where necessary.
- `extern "C"` was removed where it wasn't needed.
- #pragma warning was placed behind an #ifdef _MSC_VER
- The macros for `min`, `max` and `clamp` were removed as they were not used.
- `-fpedantic` was added to the GCC flags for bitmask support.
- `gs::rendertarget_op` is now declared before use.
- std::exception(const char*) was replaced with std::runtime_error(const char*).
- Added aligned_alloc and aligned_free macros for GCC and MSVC support.
- Replaced use of `sprintf_s` with `snprintf`.
- Placed additional guards around windows only code.

Additonally some changes were made that do not affect Linux:
- `NOMINMAX` and `NOINOUT` were removed.

Fixes: #27
Fixes: #13
2019-01-14 22:31:35 +01:00
Michael Fabian 'Xaymar' Dirks ca1e26fd20 filter-shadow-sdf: Fix crash when adding source
I'm not sure how this one passed by me. Or how this worked, as I have screenshots and videos of it working before applying this fix.
2018-12-23 23:48:08 +01:00
Michael Fabian 'Xaymar' Dirks 95fdcff3a9 cmake: Reworked build system for Installers and Archives 2018-12-23 21:15:05 +01:00
Michael Fabian 'Xaymar' Dirks c94a3fa11f util-math: Use C++ math header 2018-12-23 19:57:07 +01:00
Michael Fabian 'Xaymar' Dirks 3952c33c60 filter-blur: Add Directional Blur (Motion Blur) and Step Scaling
Directional Blur (also known as Motion Blur in some art software) enables full control over the direction the passes are applied in, which can further be combined with the scaling option. With this very simple blur effects can have a massively bigger influence.

Step Scaling allows for improved control over individual Blur passes and can be combined with Directional Blur to imitate certain effects. It also allows smaller Blur sizes to cover a larger area, although with a drastic loss in final quality. For example, if someone is streaming at 720p and wants to have their dynamic 2160p background blurry to a very high degree, this option would allow that at next to no quality loss in the final stream. The actual values that need to be used vary for each source and encoder however, so they will have to be chosen carefully.
2018-12-23 19:54:57 +01:00
Michael Fabian 'Xaymar' Dirks ad97eeebe7 filter-blur: Fix translucent source rendering and modernize code
Translucent sources previously rendered with wrong alpha, which caused sources to look different than they should. With the new code, this is no longer the case and instead now renders the source correctly.

Additionally the modernized code should reduce any problems with rendering by reducing the amount of duplicated manually written code and instead using classes.
2018-12-23 18:27:24 +01:00
Michael Fabian 'Xaymar' Dirks fd14fd62a6 gs-rendertarget: Add function to get texture directly 2018-12-23 17:56:52 +01:00
Michael Fabian 'Xaymar' Dirks a6f9451654 filter-blur: Switch to Kernel Array instead of Kernel Texture
This speeds up Gaussian Blur and Linear Gaussian Blur drastically reduces time spent reading textures and instead uses existing registers - maximizing time spent reading the actual image texture.

See Also: #21 Blur Quality
2018-12-23 02:00:30 +01:00
Michael Fabian 'Xaymar' Dirks 92c4b54177 filter-blur: Add Linear Gaussian Blur
Similar to Linear Box Blur, this version of Gaussian Blur reduces the total number of sample by up to n. This results in a total sample count (per pass) of O(n+1) for even radii and O(n+2) for odd radii. The quality sacrificed to do this is higher this time, though careful adjustment of the halfTexelDelta value can bring it much closer to normal Gaussian Blur. The current offset however had no noticable effects on visual quality.

See Also: #21 Blur Quality
2018-12-22 22:54:30 +01:00
Michael Fabian 'Xaymar' Dirks 93df9b50b8 filter-blur: Add Linear Box Blur and combine all effects
Linear Box Blur abuses the fact that with Linear Sampling we can sample up to four adjacent texels at the same time and get a correct result for Box Blur back. Using this the total number of sample for Box Blur is reduced by n, making the total either n+1 (Even Radius) or n (Odd Radius).

Additionally all blur effect files have been merged into a single blur.effect file to reduce the time required to change a single parameter name. New blur effects should be added as a new technique instead of as a new effect file.

See Also: #21 Blur Quality
2018-12-22 22:08:55 +01:00
Michael Fabian 'Xaymar' Dirks 0c92f3dbf5 filter-shadow-sdf: Inner/Outer shadow based on signed distance fields
Adds Inner/Outer Shadows for dynamic sources based on signed distance field generation. This is fast, but does add a bit of latency when it comes to updates - which means that moving objects will leave a trail before the generator has a chance to update.

Fixes #3
2018-11-08 13:52:43 +01:00
Michael Fabian 'Xaymar' Dirks c0cb20300b filter-blur: Rename factory and instance to blur_* 2018-11-08 11:16:55 +01:00
Michael Fabian 'Xaymar' Dirks 1aa42c58f0 plugin: Fix double plugin name in log line 2018-11-08 11:16:33 +01:00
Michael Fabian 'Xaymar' Dirks 844fcee0bd source-mirror: Additional protections against crashes on impossible behavior 2018-11-08 08:17:04 +01:00
Michael Fabian 'Xaymar' Dirks ac06ff48bc source-mirror: Fix crash caused by source renames and forced destroy of a source 2018-11-08 08:08:38 +01:00
Michael Fabian 'Xaymar' Dirks 9ffe53754b obs-source: Add support for all signals on a source 2018-11-08 08:08:06 +01:00
Michael Fabian 'Xaymar' Dirks 79daeb5a75 util-event: Template event handler class 2018-11-08 08:07:49 +01:00
Michael Fabian 'Xaymar' Dirks e4a5b34745 gfx-source-texture: Check for valid child and parent 2018-11-08 04:26:01 +01:00
Michael Fabian 'Xaymar' Dirks 6d25342302 obs-source: Check for early source destruction
This should prevent problems where the source is destroyed but a pointer is still around to it.
2018-11-08 04:25:21 +01:00
Michael Fabian 'Xaymar' Dirks 11fc32f935 source-mirror: Fix crash with audio mirroring
Fixes #23
2018-11-07 15:29:24 +01:00
Michael Fabian 'Xaymar' Dirks b87ca70796 project: Formatting 2018-11-07 15:24:25 +01:00
Michael Fabian 'Xaymar' Dirks 16f55ca583 source-mirror: Fix crash with audio data on obs_shutdown (#22)
Due to the lack of checking aud and aoi, a rare race condition crash can be observed with audio mirroring enabled on closing OBS. In this case, aoi is used even though it is null, causing OBS to crash instead of closing normally.

Fixes #22
2018-11-07 14:44:07 +01:00
Michael Fabian 'Xaymar' Dirks b5339b4429 source-mirror: Add support for scenes and fix last commit 2018-11-07 14:44:07 +01:00
Michael Fabian 'Xaymar' Dirks c084a0bfd0 source-mirror: Use a private scene source for rendering 2018-11-07 14:44:07 +01:00
Michael Fabian 'Xaymar' Dirks 0be79842e7 filter-transform: Fix various warnings 2018-11-07 14:44:07 +01:00
Michael Fabian 'Xaymar' Dirks eef9f0697d gfx-effect-source: Fix various warnings 2018-11-07 14:44:07 +01:00
Michael Fabian 'Xaymar' Dirks 55abc87126 plugin: extern "C" around obs includes 2018-11-07 14:44:07 +01:00
Michael Fabian 'Xaymar' Dirks f54efe7704 gfx-source-texture: Support for new obs-source managed class
This also adds support for proper source management in unmanaged cases.
2018-11-07 14:44:06 +01:00
Michael Fabian 'Xaymar' Dirks 234cbf5dab obs-tools: Various obs related tools 2018-11-07 14:44:06 +01:00
Michael Fabian 'Xaymar' Dirks 9c0761adde obs-source: Managed class for obs_source_t 2018-11-07 14:44:06 +01:00
Michael Fabian 'Xaymar' Dirks daad792eda filter-blur: Add support for scene as mask input (#14)
Adds full support for Scenes as mask input so that you can re-use your overlay scene as a blur input and have the blur follow behind your overlay.

Closes #14
2018-10-01 01:03:48 +02:00
Michael Fabian 'Xaymar' Dirks 382a217f06 filter-blur: Add support for image and source masks (#14) 2018-10-01 01:00:00 +02:00
Michael Fabian 'Xaymar' Dirks ebbc0cb1ce filter-blur: Fix Mask Type and split Color into Color and Alpha 2018-10-01 00:57:22 +02:00
Michael Fabian 'Xaymar' Dirks 999df5e6e5 gfx-source-texture: Refactoring 2018-10-01 00:54:18 +02:00
Michael Fabian 'Xaymar' Dirks d56f4f9eac filter-blur: Add proper mask options
* Removes the old 'Region' fields and places them under a 'Mask' option that can do much more.
* Supported Mask types: Region, Image, Source.
* Image and Source mask types allow for a color filter and multiplier.
2018-09-30 22:48:47 +02:00
Michael Fabian 'Xaymar' Dirks cfaa7eb1b9 strings: Add translated File Filters for Images 2018-09-30 21:55:13 +02:00
Michael Fabian 'Xaymar' Dirks f327f4ccc6 util-math: Undefine macro 2018-09-30 21:44:00 +02:00
Michael Fabian 'Xaymar' Dirks 3135214a03 filter-blur: Refactor and formatting
* Now using a Factory and Instance approach to simplify and beautify the code at the same time.
* Additionally we now keep track of created filters and only load data if there is a filter active, and unload data if there are no more filters. This reduces memory and GPU overhead when no filter is active, but adds a first time filter creation overhead.
* Variables and functions now use snake_case.
2018-09-30 20:50:00 +02:00
Michael Fabian 'Xaymar' Dirks 354445bc81 strings: Remove plugin:: namespace 2018-09-30 20:18:13 +02:00
Michael Fabian 'Xaymar' Dirks 8296af68c6 project: Rename 'Filter' to 'filter' 2018-09-30 18:49:52 +02:00
Michael Fabian 'Xaymar' Dirks da22e72da7 filter-transform: Fix mipmapping for npot input
The filter will now automatically rescale the parent stack into the next best power of two size. With this, even non-power-of-two sources can now be mipmapped semi-correctly.

To accurately support mipmapping even for npot textures, this feature would have to be built into OBS and OBS would have to stop refusing to create textures with mipmaps that are not a power of two in size. Almost all common Direct3D 11 (except Intel) are capable of npot mipmaps at full speed, while OpenGL usually depends on the GPU and Driver used.
2018-09-29 17:05:58 +02:00
Michael Fabian 'Xaymar' Dirks 6561ea9b3c util-math: Rename get_power_of_two to get_power_of_two_exponent 2018-09-29 16:57:41 +02:00
Michael Fabian 'Xaymar' Dirks 9a8a44045b gs-mipmapper: Fix support for very small mipmaps
This fixes the final mip map of a texture being empty, in cases where either width or height is reduced to just a single pixel.
2018-09-29 16:57:17 +02:00
Michael Fabian 'Xaymar' Dirks 0a7283b2ba filter-transform: more Formatting, add mipmap options 2018-09-29 15:57:25 +02:00
Michael Fabian 'Xaymar' Dirks dbe577e372 filter-transform: Formatting, refactoring and mipmapping
The '3D Transform' filter now support mipmapping using the Linear generator. This results in smoother images when the shape is squished or distant, instead of a pixelated mess.
2018-09-29 01:07:38 +02:00
Michael Fabian 'Xaymar' Dirks 7c520ae9ee gs-mipmapper: Implement actual mipmap generation
This enables full mipmapping support for textures with a shader view that allows accessing different mip levels. In order to access mip levels, you have to specify gs::texture:🎏:BuildMipMaps when creating the texture, as OBS currently forces the maximum mip level to 1 even if you actually have mip data available.
2018-09-29 01:06:30 +02:00
Michael Fabian 'Xaymar' Dirks c591902fea gs-texture: Allow texture creation without data
This is a valid operation and allows for creation of uninitialized textures, which can be copied to but should not be read from until that moment.
2018-09-28 23:34:43 +02:00
Michael Fabian 'Xaymar' Dirks 95018868dc gs-mipmapper: Formatting and refactoring 2018-09-28 23:32:35 +02:00
Michael Fabian 'Xaymar' Dirks bb5c1f80b5 gfx-source-texture: Formatting and refactoring 2018-09-28 23:31:21 +02:00
Michael Fabian 'Xaymar' Dirks bc89eaf33a util-math: Fix is_power_of_two_loop for non-64-bit types 2018-09-28 21:21:40 +02:00
Michael Fabian 'Xaymar' Dirks 6e03f2334d gs-mipmapper: Textures with no mip level do not exist 2018-09-28 21:21:24 +02:00
Michael Fabian 'Xaymar' Dirks f78be9c387 gs-texture: Undo removal of mip_data check 2018-09-28 21:21:04 +02:00
Michael Fabian 'Xaymar' Dirks 04d7379ff1 filter-transform: Formatting 2018-09-28 14:49:59 +02:00
Michael Fabian 'Xaymar' Dirks b5746e473b gfx-effect-source: Remove mipmapper 2018-09-28 14:26:06 +02:00
Michael Fabian 'Xaymar' Dirks ff8618c339 gs-mipmapper: Specify source and target and remove Bilinear 2018-09-28 14:24:30 +02:00
Michael Fabian 'Xaymar' Dirks afc04a5d0e gs-texture: Use util::math functions 2018-09-28 14:23:47 +02:00
Michael Fabian 'Xaymar' Dirks 528d36a13f util-math: Fix compile error and add get_power_of_two_* 2018-09-28 14:23:26 +02:00
Michael Fabian 'Xaymar' Dirks 391fca7497 gs-effect: Formatting 2018-09-28 14:18:09 +02:00
Michael Fabian 'Xaymar' Dirks 1923a724d7 util-math: Formatting and is_power_of_two templates 2018-09-28 14:17:43 +02:00
Michael Fabian 'Xaymar' Dirks db13c50ec5 gfx-effect-source: Add initial code for texture support 2018-09-28 11:55:55 +02:00
Michael Fabian 'Xaymar' Dirks 7b995cf50b gs-vertexbuffer: Fix heap corruption 2018-09-28 11:47:50 +02:00
Michael Fabian 'Xaymar' Dirks 72d15bad31 gs-mipmapper: Slight formatting changes 2018-09-27 06:21:39 +02:00
Michael Fabian 'Xaymar' Dirks bc63696306 gs-mipmapper: Early attempts at proper mipmap rendering
This class is an attempt at adding dynamic mipmapping support to OBS, which is lacking this feature. It is pretty much a hack until I figure out how to do it for both d3d11 and opengl and can make a PR for obs-studio to include this ability by default.
2018-09-27 06:09:43 +02:00
Michael Fabian 'Xaymar' Dirks 14b370a7a5 gs-texture: Remove accidentally added enum 2018-09-27 05:36:49 +02:00
Michael Fabian 'Xaymar' Dirks fb77cc90a6 gs-rendertarget: Allow retrieving color and zstencil format 2018-09-27 05:23:14 +02:00
Michael Fabian 'Xaymar' Dirks faeb5af45b gs-rendertarget: Formatting and refactoring 2018-09-27 05:17:08 +02:00
Michael Fabian 'Xaymar' Dirks ded5896fca gs-texture: Add get_color_format method 2018-09-27 05:11:37 +02:00
Michael Fabian 'Xaymar' Dirks 52cb7a6d20 gs-texture: Formatting, refactoring and cleanup 2018-09-27 05:09:38 +02:00
Michael Fabian 'Xaymar' Dirks 4c1e66e27b gs-vertexbuffer: Remove #pragma region 2018-09-27 03:11:04 +02:00
Michael Fabian 'Xaymar' Dirks 8a897c8898 gs-vertex: Formatting and fix constructors 2018-09-27 03:07:38 +02:00
Michael Fabian 'Xaymar' Dirks 431fee7b9b gs-vertexbuffer: Do not assign uv layers that do not exist 2018-09-27 03:00:17 +02:00
Michael Fabian 'Xaymar' Dirks cace17a817 gs-vertexbuffer: Allow specifying amount of UV layers
This should reduce GPU memory usage for vertex buffers that need less UV information than the maximum allowed UV layers possible.
2018-09-27 02:57:53 +02:00
Michael Fabian 'Xaymar' Dirks c3e67bad97 gs-vertexbuffer: Formatting and various fixes
With the addition of clang-format and cppcheck, and the changes to .editorconfig, various changes need to be added.
2018-09-27 02:49:00 +02:00
Michael Fabian 'Xaymar' Dirks a54a526c4b plugin: Write plugin version to log file on load and unload 2018-08-13 01:01:15 +02:00
Michael Fabian 'Xaymar' Dirks e8da137ab6 filter-custom-shader: Basic custom shader support
The Custom Shader Filter is now capable of rendering a custom shader using the gfx::effect_source class as a backend. An example shader is provided for starting off, more advanced examples may come later.

Related: #5
2018-04-29 03:07:26 +02:00
Michael Fabian 'Xaymar' Dirks 0957ce0bb9 gfx-effect-source: Implement basic functionality
Rendering is now possible, although some parameter types are not yet supported. So far, booleans and floats will work fine, integers will cause an error in OBS Studios rendering code for an unknown reason.
2018-04-29 03:05:53 +02:00
Michael Fabian 'Xaymar' Dirks b4de874ec9 gs-effect: Work around for an obs-studio issue with Integer parameters 2018-04-29 03:01:20 +02:00
Michael Fabian 'Xaymar' Dirks 6057101f26 gs-vertexbuffer: Fix usage of gs_vertexbuffer_get_data() 2018-04-29 03:00:40 +02:00
Michael Fabian 'Xaymar' Dirks e200127595 source-mirror: Fix compiler warnings 2018-04-29 03:00:04 +02:00
Michael Fabian 'Xaymar' Dirks c9ed74a3f9 gs-texture: Additional type safety and new methods 2018-04-29 02:59:51 +02:00
Michael Fabian 'Xaymar' Dirks d59b54811f utility: Code for using enumerations as flags/bitsets
It baffles me that this is not just part of the language itself from the beginning, it's used nearly everywhere and is needed for type safety.
2018-04-29 01:02:05 +02:00
Michael Fabian 'Xaymar' Dirks af71a7cc1d filter-blur: Allow applying Blur to a sub-region of the source only
The Blur Filter can now be applied to a region inside the source itself, the inverse of that region, and/or a feathered version of that region. This allows for easier scene setups where only some parts need to be blurred, but the rest can be left as is.

Fixes #12
2018-04-29 00:14:29 +02:00
Michael Fabian 'Xaymar' Dirks 1ba9145fbd filter-blur: Use only a single Gaussian Kernel Texture 2018-04-28 14:41:18 +02:00
Michael Fabian 'Xaymar' Dirks 6c1e874369 filter-blur: Refactoring, formatting and copyright 2018-04-28 13:59:54 +02:00
Michael Fabian 'Xaymar' Dirks 0cd4520774 util-math: Bilateral Blur 2018-04-28 12:45:23 +02:00
Michael Fabian 'Xaymar' Dirks c4942da235 source-mirror: Refactoring 2018-04-28 12:45:11 +02:00
Michael Fabian 'Xaymar' Dirks 410ba9df88 source-mirror: Implement mirroring of Source Audio
From this point on, Source Mirror is now capable of real-time mirroring of Video and Audio. This can help if you need different filters per scene for your microphone or voice chat, depending on the scene (audio ducking for pause scene, no audio ducking for live gaming).
2018-04-27 23:38:49 +02:00
Michael Fabian 'Xaymar' Dirks 57c2daa80c obs-audio-capture: Helper class for automated capture of source audio 2018-04-27 23:34:26 +02:00
Michael Fabian 'Xaymar' Dirks e621b69aa2 source-mirror: Ensure that we have a source on video_tick 2018-04-24 17:07:06 +02:00
Michael Fabian 'Xaymar' Dirks 5e4a781912 source-mirror: Ensure that we have a proper source on activate() 2018-04-24 15:31:51 +02:00
Michael Fabian 'Xaymar' Dirks d8d60f7a21 gfx-effect-source: Check for effect == nullptr in test_for_updates 2018-04-24 13:58:07 +02:00
Michael Fabian 'Xaymar' Dirks 49964e15be gfx-source-texture, source-mirror: Prevent recursion caused by Source Mirror 2018-04-24 13:48:42 +02:00
Michael Fabian 'Xaymar' Dirks ec19f44f96 project: Don't prefix includes with "libobs/" 2018-04-23 17:53:27 +02:00
Michael Fabian 'Xaymar' Dirks 0b5a848c32 cmake: Improve automatic versioning 2018-04-23 17:52:40 +02:00
Michael Fabian 'Xaymar' Dirks fc78bd83a6 filter-custom-shader: Initial version based on gfx::effect_source 2018-04-09 13:28:13 +02:00
Michael Fabian 'Xaymar' Dirks 9f91039ca0 util-memory: Don't use _dbg versions for aligned_alloc/free 2018-04-09 13:27:51 +02:00
Michael Fabian 'Xaymar' Dirks 5e9f113553 gfx-effect-source: Base class for Custom Shaders
gfx::effect_source is the base class for all Custom Shader Sources and Transitions, which reduces the overall workload to a single file, but unfortunately also reducing the effective customization per source a bit.
2018-04-09 13:27:22 +02:00
Michael Fabian 'Xaymar' Dirks 9ae8ecc3e1 source-mirror: Fix crashes caused by uncaught exception 2018-04-09 13:23:57 +02:00
Michael Fabian 'Xaymar' Dirks fe05dca51e gfx, gs: Fix commits 9f518764b6 & 2adfa5765c 2018-03-20 12:50:17 +01:00
Michael Fabian 'Xaymar' Dirks 22eb53a856 gfx: Initial code for an Effect Source (Custom Shader)
This class will be used by any Custom Shader type (Filter, Source, Transition) and as such is pretty much used as the basis for all of it.
2018-03-20 12:45:41 +01:00
Michael Fabian 'Xaymar' Dirks 2adfa5765c gs: Rename to snake_case instead of PascalCase
This should prevent mishaps with upper/lowercase typos and fits in better with the C++ standard code, which is also in snake_case.
2018-03-20 12:44:02 +01:00
Michael Fabian 'Xaymar' Dirks 9f518764b6 gfx: Move util::SourceTexture to gfx::SourceTexture
'gfx' is the new preview for Graphics utilities that do not act as a wrapper around the Graphics Subsystem directly.
2018-03-08 11:28:23 +01:00
Michael Fabian 'Xaymar' Dirks 53073660c0 Merge branch 'filter-custom-shader' 2018-03-05 16:50:57 +01:00
Michael Fabian 'Xaymar' Dirks 65a7ac696b source-mirror: Use util:SourceTexture instead of custom code 2018-03-05 16:50:19 +01:00
Michael Fabian 'Xaymar' Dirks 304db23335 util-math: Add SizeFromString method
Converts a String to an std::pair of int64_t (long long), which contain the size or 0 if none could be parsed. Any delimiter except digits(0-9), a minus sign(-) or a plus sign(+) between width and height are allowed. If a plus or minus sign is used as a delimiter, it must immediately be followed by the second size number. This allows for formats such as: 100x100, 100:100, 100p100, 100@100, 100+100 and so on, but not formats such as 100+:100, 100ThisIsSomeReall+yLongText100, etc.

The parameter 'allowSquare' also determines what to do when the height parameter is not found. A value of true will have the function return <width,width> instead of <width,0>.
2018-03-05 16:36:20 +01:00
Michael Fabian 'Xaymar' Dirks 1f60e3d56f util-source-texture: Fix commit 75aeb561bd
Including obs.h directly is not compatible with CPack installations of libobs.
2018-03-05 16:21:30 +01:00
Michael Fabian 'Xaymar' Dirks 224544efff util-source-texture: Add method to retrieve obs_source_t* obejct 2018-03-05 16:19:42 +01:00
Michael Fabian 'Xaymar' Dirks 75aeb561bd util: Add SourceTexture utility
This utility class is used to quickly render and retrieve a Texture from a source. It should be used in place of manual rendering since it can be updated quickly, fixing outstanding issue in all places of the plugin instead of just one.
2018-03-05 15:17:34 +01:00
Michael Fabian 'Xaymar' Dirks cc68e2864f gs-rendertarget: Add and implement GetTexture(...) methods 2018-03-05 15:10:51 +01:00
Michael Fabian 'Xaymar' Dirks 7d065c131d gs-texture: Allow creation from existing gs_texture_t* 2018-03-05 15:10:19 +01:00
Michael Fabian 'Xaymar' Dirks 01bf510a28 util-memory: Use standard alloc/free and fix incorrect aligned length
The custom allocator occasionally returned memory that was aligned, but did not have enough space to store the actual size due to a calculation error in the size. This resulted in situations where allocating 1022 bytes would give you a writable buffer of only 1020 bytes or less, or also known as writing into unknown memory, possibly even the heap. This is now fixed by doubling the padding used.

Additionally it will now default to using standard allocators, which should work better and rely on the Compiler.
2018-02-24 04:35:49 +01:00
Michael Fabian 'Xaymar' Dirks eccd95c68c filter-custom-shader: First working version with several fixes
- Shaders now have all promised special variables available to them.
- 'Pass' (int) is no longer a special variable.
- Files should now properly update every half second.
- Fixed a ton of compiler warnings.
- Forced loading shaders from text instead of files to avoid caching.
- Fixed file modification tests always failing.
- Actually renders shaders now.

Known issues:
- Parameters aren't updated with file modifications unless the file is actually changed in the UI.
2018-01-25 10:26:09 +01:00
Michael Fabian 'Xaymar' Dirks 107103001b gs-effect: Add HasParameter and fix Set*Array
HasParameter can be used to safely check if a parameter exists and such should be preferred over try-catch blocks. Additionally, SetFloat2, SetFloat3, SetFloat4, SetFloatArray, SetInteger2, SetInteger3, SetInteger4 and SetIntegerArray should no longer cause rendering issues due to invalid buffer sizes.
2018-01-25 09:12:47 +01:00