Commit Graph

273 Commits

Author SHA1 Message Date
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
Cat Stevens 3b1551b8ef cmake: Fix "FindLibobs.cmake" capitalisation
Fix "FindLibobs.cmake" filename case for case-sensitive filesystems
2019-01-14 22:20:56 +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
wwj402 0ad73bbf67 add chinese simplified language 2018-12-22 20:52:05 +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 6216311827 project: Update README 2018-11-08 04:26:30 +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 58661bf3ac cmake: Add obs-source and obs-tools source 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 Dirks 37ad918881 Add Issue Templates
Add issue templates to aid in categorizing and resolving issues.
2018-10-05 20:40:52 +02: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 a2a30b5fe1 effects: Add masking lerp effect
* Supports region, feathered region, inverted region, inverted feathered region and image input.
* Interpolates between image_blur and image_orig depending on the result of the mask function.
2018-09-30 22:47:37 +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 38b6ec7c65 gs-mipmapper: Fix Sharpen shader, add strength support for Smoothen 2018-09-29 15:58:13 +02:00