Git Product home page Git Product logo

obs-shaderfilter's Introduction

obs-shaderfilter

Introduction

The obs-shaderfilter plugin for OBS Studio is intended to allow users to apply their own shaders to OBS sources. This theoretically makes possible some simple effects like drop shadows that can be implemented strictly in shader code.

Please note that this plugin may expose a reasonable number of bugs in OBS, as it uses the shader parser and the property system in somewhat unusual ways.

Installation

The binary package mirrors the structure of the OBS Studio installation directory, so you should be able to just drop its contents alongside an OBS Studio install (usually at C:\Program Files\obs-studio). The necessary files should look like this:

obs-studio
|---data
|   |---obs-plugins
|       |---obs-shaderfilter
|           |---examples
|               |---blink.shader
|               |---border.shader
|               |---drop_shadow.shader
|               |---filter-template.effect
|               |---multiply.shader
|               |---pulse.effect
|               |---rectangular_drop_shadow.shader
|               |---rounded_rect.shader
|               |---many more...
|           |---locale
|               |---en-US.ini
|---obs-plugins
    |---32bit
    |   |---obs-shaderfilter.dll
    |---64bit
        |---obs-shaderfilter.dll

Usage

The filter can be added to any source through the "Filters" option when right-clicking on a source. The name of the filter is "User-defined shader."

Shaders can either be entered directly in a text box in the filter properties, or loaded from a file. To change between the two modes, use the "Load shader text from file" toggle. If you are entering your shader text directly, note that you will need to use the "Reload effect" button to apply your changes. This can also be used to reload an external file if changes have been made. OBS shaders are written in OBS version of HLSL.

The option is provided to render extra pixels on each side of the source. This is useful for effects like shadows that need to render outside the bounds of the original source.

Normally, all that's required for OBS purposes is a pixel shader, so the plugin will wrap your shader text with a standard template to add a basic vertex shader and other boilerplate. If you wish to customize the vertex shader or other parts of the effect for some reason, you can check the "Use Effect File (.effect)" option.

Use Shader Time Start the effect from the loadtime of the shader, not the start up time of OBS Studio.

Any parameters you add to your shader (defined as uniform variables) will be detected by the plugin and exposed in the properties window to have their values set. Currently, only int, float, bool, string, texture2d, and float4 parameters are supported. (float4 parameters will be interpreted by the properties window as colors.) string is used for notes and instructions, but could be used in an effect or shader. Variable names are displayed in the GUI with underscore replaced with space uniform float Variable_Name becomes Variable Name.

Version 2.0 and up support setting label, widget_type, minimum, maximum, step using annotations. Version 2.1 and up support setting group using annotations. A slider that has a minimum of -1.0, maximum of 1.0, and a step size of 0.01:

// Contrast from -1.0 to 1.0
uniform float Contrast<
  string label = "Contrast Adjustment";
  string widget_type = "slider";
  string group = "Group";
  float minimum = -1.0;
  float maximum = 1.0;
  float step = 0.01;
> = 0.0;

A drop-down select widget for integer fields:

uniform int SelectTest<
  string label = "Int Select";
  string widget_type = "select";
  int    option_0_value = 0;
  string option_0_label = "First";
  int    option_1_value = 1;
  string option_1_label = "Second";
  int    option_2_value = 3;
  string option_2_label = "Third";
> = 3;

A text field the user can not edit:

uniform string notes<
    string widget_type = "info";
> = "add notes here";

Defaults

You set default values as a normal assignment uniform string notes = 'my note';, except for float4 which requires bracket {} notation like uniform float4 mycolor = { 0.75, 0.75, 0.75, 1.0};

Note that if your shader has syntax errors and fails to compile, OBS does not provide any error messages; you will simply see your source render nothing at all. In many cases the output of the effect parser will be written to the OBS log file, which you can view with the Help -> Log Files menu in OBS.

Standard parameters

The plugin automatically populates a few parameters which your shader can use. If you choose to override the entire effect, be sure to define these as uniform variables and use them where necessary. (The filter should gracefully handle these variables being missing, but the shader may malfunction.)

  • ViewProj (float4x4)—The view/projection matrix. (Standard for all OBS filters.)
  • image (texture2d)—The image to which the filter is being applied, either the original output of the source or the output of the previous filter in the chain. (Standard for all OBS filters.)
  • elapsed_time (float)—The time in seconds which has elapsed since the filter was created. Useful for creating animations.
  • local_time (float)— a random float representing the local time.(1.2)
  • loops (int)— count of how many loops times the shader has rendered a page.(1.2)
  • rand_f (float)— a random float between 0 and 1. changes per frame.
  • rand_activation_f (float)— a random float between 0 and 1. changes per activation, load or change of settings.(1.2)
  • rand_instance_f (float)— a random float between 0 and 1. changes per instance on load.(1.2)
  • uv_offset (float2)—The offset which should be applied to the UV coordinates of the vertices. This is used in the standard vertex shader to draw extra pixels on the borders of the source.
  • uv_scale (float2)—The scale which should be applied to the UV coordinates of the vertices. This is used in the standard vertex shader to draw extra pixels on the borders of the source.
  • uv_size (float2)—The height and width of the screen.
  • uv_pixel_interval (float2)—This is the size in UV coordinates of an individual texel. You can use this to convert the UV coordinates of the pixel being processed to the coordinates of that texel in the source texture, or otherwise scale UV coordinate distances into texel distances.

Optional Preprocessing Macros

The plugin provides some optional pre-processing macros.

  • #include "<path-to-file>" The include macro will insert the contents file at the path <path-to-file> before the shader is compiled. This is useful to place commonly used functions, in a separate file that can be used by multiple shaders. E.g.: #include "util-fns.effect".
  • #define <NAME> <value> This allows you to define constants to be used throughout your shader. Constants can be values or even simple functions. Anywhere the value in <NAME> is found in your shader, it will be replaced with whatever is in <value>. For example, after putting #define PI 3.14159 near the top of your shader file, you can use code like: float circle_area = PI * radius * radius;. Note, the #define line should NOT be ended with a semicolon.
  • #define USE_PM_ALPHA 1 By default, OBS will pass through pre-multiplied alpha color values. This can cause issues if the source being filtered has opacity values that are not zero or one. By default, shaderfilter now corrects internally for premultipled alpha, but if you have written an older shader that does the correction itself, you can turn off the correction by placing #define USE_PM_ALPHA 1 near the top of your shader file.

Example shaders

Several examples are provided in the plugin's data/examples folder. These can be used as-is for some hopefully useful common tasks, or used as a reference in developing your own shaders. Note that the .shader and .effect extensions are for clarity only, and have no specific meaning to the plugin. Text files with any extension can be loaded. In a standard, .effect files include a vertex shader and .shader only has a pixel shader.

I recommend .shader as they do not require Use Effect File (.effect) as pixel shaders, while .effect signifies vertex shaders with Use Effect File (.effect) required.

File Description Example
animated_texture.effect Animates a texture with polar sizing and color options
alpha-gaming-bent-camera.shader image
ascii.shader a little example of ascii art image
background_removal.effect simple implementation of background removal. Optional color space corrections
blink.shader A shader that fades the opacity of the output in and out over time, with a configurable speed multiplier. Demonstrates the user of the elapsed_time parameter.
bloom.shader simple shaders to add bloom effects image
border.shader A shader that adds a solid border to all extra pixels outside the bounds of the input.
box-blur.shader image
burn.shader image
cartoon.effect Simple Cartooning based on hue and steps of detail value. image
cell_shaded.shader image
Chroma+UV-Distortion.shader image
chromatic-aberration.shader image
drop_shadow.shader A shader that adds a basic drop shadow to the input. Note that this is done with a simple uniform blur, so it won't look quite as good as a proper Gaussian blur. This is also an O(N²) blur on the size of the blur, so be very conscious of your GPU usage with a large blur size.
dynamic-mask.shader image
edge_detection.shader A shader that detects edges of color. Includes support for alpha channels.
filter_template.effect A copy of the default effect used by the plugin, which simply renders the input directly to the output after scaling UVs to reflect any extra border pixels. This is useful as a starting point for developing new effects, especially those that might need a custom vertex shader. (Note that modifying this file will not affect the internal effect template used by the plugin.)
filter_template.shader A copy of the default shader used by the plugin, which simply renders the input directly to the output after scaling UVs to reflect any extra border pixels. This is useful as a starting point for developing new pixel shaders. (Note that modifying this file will not affect the internal effect template used by the plugin.)
fire.shader A fire example converted from shadertoy with lots of added options. youtube example
glow.shader simple shaders to add glow effects, with some additional options for animation
glitch_analog.shader A shader that creates glitch effects similar to analog signal issues. Includes support for alpha channel.
gb-camera.shader image
gradient.shader This shader has a little brother simple_gradient.shader, but lets you choose three colors and animate gradients.
halftone.shader image
hexagon.shader A shader that creates a grid of hexagons with several options for you to set. This is an example of making shapes.
intensity-scope.shader image
gaussian-simple.shader A simple gaussian shader for bluring. Really implements closer to a box shader.
luminance.shader A shader that adds an alpha layer based on brightness instead of color. Extremely useful for making live video special effects, like replacing backgrounds or foregrounds.
matrix.effect The cat is a glitch conversion from shadertoy. Updated with several configurable options.(1.2) image
multiply.shader A shader that multiplies the input by another image specified in the parameters. Demonstrates the use of user-defined texture2d parameters.
night_sky.shader Animated moon, clouds, stars background(1.2) image
page-peel.shader image
perlin_noise.effect An effect generates perlin_noise, used to make water, clouds and glitch effects. image
pie-chart.shader image
pixelation.shader image
pulse.effect An effect that varies the size of the output over time. This demonstrates a custom vertex shader that manipulates the position of the rendered vertices based on user data. Note that moving the vertices in the vertex shader will not affect the logical size of the source in OBS, and this may mean that pixels outside the source's bounds will get cut off by later filters in the filter chain.
rainbow.shader Creates Rainbow effects, animated, rotating, horizontal or vertical. This is an expensive process and limiters are implemented. image
rain-window.shader image
rectangular_drop_shadow.shader A shader that renders an optimized drop shadow for sources that are opaque and rectangular. Pixels inside the bounds of the input are treated as solid; pixels outside are treated as opaque. The complexity of the blur does not increase with its size, so you should be able to make your blur size as large as you like wtihout affecting GPU load.
remove_partial_pixels.shader A shader that removes pixels with partial alpha, excellent for cleaning up green screens.
repeat.effect Duplicates the input video as many times as you like and organizes on the screen. image
repeat_texture.effect As above, but add a texture input to repeat instead of the input source. image
rgb_color_wheel.shader A rotatable RGB color wheel! image
rgb_split.shader image
rotatoe.effect A test rotation effect
rounded_rect.shader A shader that rounds the corners of the input, optionally adding a border outside the rounded edges.
rounded_stroke.shader A shader that rounds the corners of the input, optionally adding a border outside the rounded edges. Updated by Exeldro. Several shaders have been upgraded with Apply To Specific Color for you to animate borders. https://youtu.be/J8mQIEKvWt0
scan_line.shader An effect that creates old style tv scan lines, for glitch style effects. image
seasick.shader
selective_color.shader Create black and white effects with some colorization. (defaults: .4,.03,.25,.25, 5.0, true,true, true, true. cuttoff higher = less color, 0 = all 1 = none) image
shake.effect creates random screen glitch style shake. Keep the random_scale low for small (0.2-1) for small jerky movements and larger for less often big jumps.
shine.shader Add shine / glow to any element, use the transition luma wipes (obs-studio\plugins\obs-transitions\data\luma_wipes SOME NEW WIPES INCLUDED IN THIS RELEASE ZIP) or create your own, also includes a glitch (using rand_f), hide/reveal, reverse and ease, start adjustment and stop adjustment
spotlight.shader Creates a stationary or animated spotlight effect with color options, speed of animation and glitch image
Swirl.shader image
thermal.shader image
tv-crt-subpixel.shader image
twist.shader image
VCR.shader image
VHS.shader image
vignetting.shader A shader that reduces opacity further from the center of the image. inner radius is the start and outer radius is the end. suggested default settings is opacity 0.5, innerRadius = 0.5, outerRadius = 1.2 image
voronoi-pixelation.shader image
ZigZag.shader image
zoom_blur.shader A shader that creates a zoom with blur effect based on a number of samples and magnitude of each sample. It also includes an animation with or without easing and a glitch option. Set speed to zero to not use animation. Suggested values are 15 samples and 30-50 magnitude.

Building

If you wish to build the obs-shaderfilter plugin from source, you should just need CMake and the OBS Studio libraries and headers.

  1. In-tree build

  2. Stand-alone build (Linux only)

    • Verify that you have package with development files for OBS
    • Check out this repository and run cmake -S . -B build -DBUILD_OUT_OF_TREE=On && cmake --build build

Donations

https://www.paypal.me/exeldro

obs-shaderfilter's People

Contributors

exeldro avatar finitesingularity avatar mandakan avatar nleseul avatar norihiro avatar oncorporation avatar rmanky avatar rondhi avatar synocode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

obs-shaderfilter's Issues

Applying rounded_rect_per_corner crashes filter

When I try to apply the "rounded_rect_per_corner.shader" filter it makes my cam goes black and the following error appears on log.

It happens with other filters too, for instance the "circle-mask-filter.shader".


I am using:

  • OBS 29.1.3
  • Mac OS M2 Ventura

I've attached the logs below.

image

image

image

2023-08-12 12-28-06.txt

OpenGL does not allow C style initializers.

Hi, I hope I'm asking this in the right place..

I've been trying to get the Halsu_HybridKeyer_V022.shader shader for obs working running the latest builds on ArchLinux and I seem to be running into the following errors:

18:43:01.300: [obs-shaderfilter] Unable to create effect. Errors returned from parser:
18:43:01.300: (null) (427, 1): Error creating shader: 0(88) : error C7549: OpenGL does not allow C style initializers
18:43:01.300: 0(89) : error C7549: OpenGL does not allow C style initializers
18:43:01.300: 0(90) : error C7549: OpenGL does not allow C style initializers
18:43:01.300: 0(91) : error C7549: OpenGL does not allow C style initializers
18:43:01.300: 0(107) : error C7549: OpenGL does not allow C style initializers
18:43:01.300: 0(108) : error C7549: OpenGL does not allow C style initializers
18:43:01.300: 0(109) : error C7549: OpenGL does not allow C style initializers
18:43:01.300: 0(371) : error C7011: implicit cast from "vec4" to "vec3"

Inside the shader on lines 88-91:

float4 white = {1.0,1.0,1.0,1.0};
float4 black = {0.0,0.0,0.0,1.0};
float dx = 1.0 / uv_size.x;
float dy = 1.0 / uv_size.y;

I'm not exactly sure where to look. I most recently did update all of my packages with a pacman -Syu

Any help pointing me in any direction would be super appreciated if you have the time. I'm baffled at this point.

Thank you!

no version present in OBS Log

Noticed that there is no version listed in the log anywhere compared to your other plugins which do include the version in the log. Perhaps this is because it was a fork, and the original didn't have a version in the log? Would really appreciate this so I can check if users have an outdated version of shader filter for one of my projects 😊 it's caused some trouble already but nothing too bad

unable to enter numbers larger than 1000 into uniforms

for some reason, i cant enter in numbers >3 digits, for both float and int, into shader uniforms. using an autoclicker the biggest number is 1000, and entering a float such as 0.1000 doesnt allow you to delete the period to make it 1000

No filter works on the webcam

Hello there, when i turn on a filter my cam just disappears. If the filter is turned off again, my cam shows me again. How can i fix this problem?

User-Defined Shader not Showing

I went ahead and downloaded the obs-shaderfilter today and the filter "user-defined shader" wont come up under my filters list. It is showing in logs and everything and I even double checked to make sure all files went to the correct destinations. It all looks good, but it still wont work. Wondering if it could be a conflict with another plugin or what. Any ideas?

Already did try uninstalling and reinstalling, as well as resetting OBS and my PC

Buffer overflow in string parameters with escaped characters

If string variable contains escaped characters, such as \", both are counted but only the " is printed, resulting in UI printing past actual string variable

Reproduction example below;

uniform string infooverflow<
    string widget_type = "info";
> = "here's some escaped \" characters: \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\" and some more text";
uniform string stringoverflow="also works with straight string \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"";
float4 mainImage(VertData v_in) : TARGET {
	return image.Sample(textureSampler, v_in.uv);
}

Looks like this in OBS
https://i.imgur.com/Hc7CVqU.png

Rounded Rectangle

For some reason It never fully gets rounded could someone please help
Screenshot (93)

Texture Sampling behaviour issues

I was attempting to do some texture sampling from an png in a function, but I found some odd behaviour.

Make a colour source of colour ff00ff in an OBS scene and a 10x10 png of a different solid colour (I used ff8811). You can also create another colour source to sample from, it is not exclusive to loading from a graphics file.

Apply the following shader to the colour source, setting testTexture to the png.

uniform texture2d testTexture;

float4 getColour(float2 uv)
{
	return testTexture.Sample(textureSampler, uv);
}

float4 mainImage(VertData v_in) : TARGET
{
	float2 testuv = {0.5f, 0.5f};
	return getColour(testuv);
	float4 sourceColour = image.Sample(textureSampler, testuv);
}

You will observe that the colour being returned is the colour source, when it should be the colour from the texture.
Commenting out the float4 definition after the return OR replacing the GetColour call with sampling the testTexture directly has the desired behaviour and returns the sampled texture rather than the source.

OBS is 30.0 and plugin version is 2.1.3

Add 2nd source/image to page peel shader (and maybe other similar ones)

The non-transition one has limited paramers and just works on the source where it's applied.
The transition one has double source option, but it can't be used as a regular dynamic filter as it's just stopped.

So you can't define a non-transition filter that animates and uses another source as a "reveal". A sort of combination of both would be great. I suggest adding either:

  • 2nd source (or at least still image) to filters like the page peel one
  • a way to animate the transition shaders inside of filters, maybe with a checkbox option

Shaders Not Loading

Following .shader/.effect files display an 'Error Unknown' on load.
This is using OBS Studio 29.1.3 (64 bit) with obs-shaderfilter 2.1.2 on Debian 12 with KDE X11.

  • alpha_border.shader
  • ascii.shader
  • aspect_ratio.shader (This one has a slightly different error: 'Error (null) (50,28): Expected 'type'')
  • box-blur.shader
  • circle-mask-filter.shader
  • cut_rect_per_corner.shader
  • darken.shader
  • dead-pixel-fixer.shader
  • embers.effect
  • gaussian-blur-advanced.shader
  • gaussian-blur-simple.shader
  • gaussian-blur.effect
  • gaussian-example.effect
  • gb-camera.shader
  • heat-wave-simple.shader
  • hexagon.shader
  • invert-luma.shader
  • pie-chart.shader
  • rain-window.shader
  • rotatoe.effect
  • rounded_rect_per_corner.shader
  • rounded_rect_per_side.shader
  • rounded_rect2.shader
  • rounded_stroke_gradient.shader
  • rounded_stroke.shader
  • simplex_noise.shader
  • Swirl.shader
  • twist.shader
  • VHS.shader
  • voronoi-pixelation.shader

Also I've encountered a strange bug (?) with the Add.shader, it functions correctly when using a pure black image to add as a background to text (say) but if using a grey image (262626 hex code) it acts as a transparent highlight over the text.

Improper blending when alpha is zero but RGB values are not (0,0,0)

Shaderfilter rendering was recently change to use obs_source_process_filter_begin_with_color_space when rendering the output rather than obs_source_process_filter_begin (

if (!obs_source_process_filter_begin_with_color_space(
). This was likely done to fix some color blending issues when alpha is neither zero nor one.

However, it is causing a problem (both here, and in my plugins) where for alpha values of zero, the RGB values must be zero as well, otherwise the output alpha channel is incorrect. For example, given a very simple shader:

float4 mainImage(VertData v_in) : TARGET
{
    float alpha = distance(v_in.uv, float2(0.5, 0.5)) < 0.2 ? 1.0 : 0.0;
    return float4(1.0, 0.0, 0.0, alpha);
}

This should render a red ellipse in the center of the source, with transparent alpha outside of the circle. In earlier versions of shaderfilter this is exactly what happens:
image

However in the new version, the pixels outside of the ellipse are rendered with a very high (nearly 1.0) alpha:
image

If we alter the shader slightly to ensure that all pixels outside of the ellipse have their RGB values set to (0.0, 0.0, 0.0) things render as they should:
image

I suspect the reason is that both the alpha, and the magnitude of the RGB values are being used for the output channel. Perhaps it has something to do with the blend functions set here?

gs_blend_function(GS_BLEND_ONE, GS_BLEND_INVSRCALPHA);

Blacked out camera

Anytime I add a shaderfilter source to my desired camera scene / camera it black outs my camera. When I invs the shader source, camera comes back. So, it's literally unusable. I am on OBS 30.0.2 and have the most recent shaderfilter plugin installed for windows. Please help!

Suggestion for using non-linear sRGB in Shader

This pertains to the BlendingMethod option SrgbOff for an OBS source.

When SrgbOff is enabled for an OBS source, it skips pre-multiplication, which involves multiplying the RGB values with the alpha channel (default background is black). However, after applying the shader filter, the pre-multiplication is reintroduced. To address this, I used a "pre-division function" to offset the pre-multiplication, which worked as expected.

To implement this, include the following function outside the image.Sample():

float4 fix_alpha(float4 rgba)
{
  float r = min(rgba.r / rgba.a, 1);
  float g = min(rgba.g / rgba.a, 1);
  float b = min(rgba.b / rgba.a, 1);
  return float4(r, g, b, rgba.a);
}

The code should be written as follows: fix_alpha(image.Sample(...)).
Regardless of whether BlendingMethod is set to SrgbOff or Normal, the filter will work as expected.

ASCII Shader doesn't respect image scaling

I don't know shader programming or I'd attempt a PR but when using the legacy shader ascii it seems it converts the image using its original dimensions, ignoring any scaling of the image texture performed by the user in OBS.

Image scaled to fill screen:
image

With the filter active the displayed image only fills the original image size:
image

Bad types in shader crashes OBS

Hi,
For example this shader with void instead of float4 type crashes OBS immediately:

void mainImage(VertData v_in) : TARGET
{
	return image.Sample(textureSampler, v_in.uv);
}

Memory leaks

Setup: obs-shaderfilter 2.1.1 with OBS 29.1.3 on Windows 10

Repro:

  • Run OBS and exit it again without obs-shaderfilter installed, check the OBS log -> no memory leaks
  • Install the obs-shaderfilter plugin
  • Add an empty media source (or any other source type a shader filter can be applied to), add a user-defined shader - for simplicity just pick the Add.shader from the examples folder, doesn't matter which one
  • Run OBS and exit it again, check the OBS log -> multiple memory leaks

How many depends on the number of shader filters configured, for my simple repro scenario with just one I can get as little as 4, in my real setup with lots of shaders configured (but not even activated) already a short start and stop of OBS currently reports 1199 memory leaks, I also saw more than 3000 in some runs.

Linux filters only behave when actually sampling the image in an expected manner?

float4 mainImage(VertData v_in) : TARGET
{
    return float4(1.0, 1.0, 1.0, 1.0);
}

the above shader is a MCVE for a filter that doesn't work on linux, and below is a MCVE for a filter that does:

float4 mainImage(VertData v_in) : TARGET
{
    return float4(image.Sample(textureSampler, v_in.uv).xyz, 1);
}

I'd expect both to work fine?

[feature] FSR or\and Anime4k upscalers as a shaders

Pretty sure StreamFX dev is trying to implement it now for his plugin, and it will be nice to have an alternative.

As for anime4k. There are some shaders that already has been made already by another guy, but they don't work properly with latest OBS versions: https://github.com/ryandash/Anime4k-obs-upscaling-shaders
The main idea is to upscale a small resolution windowed games (old rpg maker games for example), so they don't look like crap when being stretched.

Transparency issues in gradients with alpha

Alpha gradients shows halos around, only applying the filter (is not needed to set any shader).

obs64_syby52WNBf

I have tried with my own images created in Photoshop and downloaded from websites.
Also with alpha gradient effects generated in obs like the Stroke Glow Shadow plugin.

obs64_QYEJuydvro

Some shaders seem to be broken on Mac (M1 specifically)

I found in 1.21.3 many, many more shaders work than the previous 1.21.1 version. However, there are some that still seem to not work on a mac (M1 processor). I don’t have windows so can’t test there. I tested each using a pixel border of 100 for left, right, top, bottom. Plus, I had the source resized down some and centered on a white background. These are the results:

aspect_ratio.shader - no visible effect or controls
circle.shader - draws an oval, no controls appear
cut_rect_per_corner.shader - makes source cram into upper left of transform. no controls
darken.shader - no visible effect or controls
glass.shader - makes source cram into upper left of transform. note, frosted_glass.shader worked great
hexagon.shader - source crams into upper left of transform. No controls
pie-chart.shader - source crams into upper left of transform. No controls
rounded_rect_per_corner.shader - source crams into upper left of transform. No controls
rounded_rect_per_side.shader - source crams into upper left of transform. No controls
note: rounded_rect.shader DOES work (it didn’t in 1.21.1) THANK YOU!!!
rounded_rect2.shader - source crams into upper left of transform. No controls
rounded_stroke_gradient.shader - source crams into upper left of transform. No controls
rounded_stroke.shader - source crams into upper left of transform. No controls
simplex_noise.shader - source crams into upper left of transform. No controls
twist.shader - source crams into upper left of transform. No controls

I didn’t have time to test the .effect files.
If there is anything else I can provide that would be helpful, please let me know.

Thanks

The shader seems to have skip sampling behavior

I tried to use the obs shader plug-in to delete specific grayscale colors (adjust alpha=0) on a black and white masked image, but I found that the results were always unsatisfactory.

Later, I tried to use the code as shown below to test, and I found that the final result screen seemed to have a regular pixel skip sampling problem. In the black pixels, every other pixel will become transparent, but in the actual picture, there is no such color performance in the black parts.

This grayscale picture is from bmd ultimatte 12 chroma key matte out.

微信图片_20231118162544

微信图片_20231118162559
微信图片_20231118162605

微信图片_20231118162609

this is orignal frame
微信图片_20231118162616

no matching function for call to `clamp(vec2, vec2, float)

Hi ! Thanks a lot for this plugin, i'm trying to use the pixelation-transition.shader and it gives the following error :

error: device_pixelshader_create (GL) failed
error: Pass (0) <> missing pixel shader!
warning: [obs-shaderfilter] Unable to create effect. Errors returned from parser:
(null) (110, 1): Error creating shader: 0:66(7): error: no matching function for call to `clamp(vec2, vec2, float)'; candidates are:
0:66(7): error:    float clamp(float, float, float)
0:66(7): error:    vec2 clamp(vec2, float, float)
0:66(7): error:    vec3 clamp(vec3, float, float)
0:66(7): error:    vec4 clamp(vec4, float, float)
0:66(7): error:    vec2 clamp(vec2, vec2, vec2)
0:66(7): error:    vec3 clamp(vec3, vec3, vec3)
0:66(7): error:    vec4 clamp(vec4, vec4, vec4)
0:66(7): error:    int clamp(int, int, int)
0:66(7): error:    ivec2 clamp(ivec2, int, int)
0:66(7): error:    ivec3 clamp(ivec3, int, int)
0:66(7): error:    ivec4 clamp(ivec4, int, int)
0:66(7): error:    ivec2 clamp(ivec2, ivec2, ivec2)
0:66(7): error:    ivec3 clamp(ivec3, ivec3, ivec3)
0:66(7): error:    ivec4 clamp(ivec4, ivec4, ivec4)
0:66(7): error:    uint clamp(uint, uint, uint)
0:66(7): error:    uvec2 clamp(uvec2, uint, uint)
0:66(7): error:    uvec3 clamp(uvec3, uint, uint)
0:66(7): error:    uvec4 clamp(uvec4, uint, uint)
0:66(7): error:    uvec2 clamp(uvec2, uvec2, uvec2)
0:66(7): error:    uvec3 clamp(uvec3, uvec3, uvec3)
0:66(7): error:    uvec4 clamp(uvec4, uvec4, uvec4)

I'm running this on arch linux, obs-shaderfilter being installed from the AUR.

aur/obs-shaderfilter-git 2.2.2-1 (+2 0.04) (Installed: 2.3.1.r1.g30011f0-1)

I've done a bit of googling without any success, would you have a few pointers to where I could find a fix ?
Thanks

No Delay Percentage on shine filter effect

The notes on the shine.effect filter mentions a "Delay Percentage" that can be modified in order to adjust the frequency of the shine effect. When checking the parameters of the shine effect there is no delay percentage modification slider or input.

Please see attached file for info.

Delay Percentage Missing

Suggestion/Request Add Gameboy Camera Shader

Hello!

Would like to request a Gameboy Camera Shader

Looking for emulator/apps out there I found that this one looks best with great option parameters

Contrast
Brightness
Sharpness?
Color Palette

Site: https://maple.pet/webgbcam/
Source: https://github.com/Lana-chan/webgbcam

This site probably has the best clone of it with some additional features that'd be great to emulate here.

image

I understand this is not a shader so here's some possible examples on shader toy.

https://www.shadertoy.com/view/3tSXRh

https://www.shadertoy.com/view/ttsSzr

https://www.shadertoy.com/view/3tByRd

Extreme decimal places for inputs on all shaders

Most shaders have decimal spaces up to .000000 , making changing by the sliders too extreme and changing by scroll wheel too gradual. Its currently way too easy to accidentally remove the decimal and tell OBS you want a 8000000 strength shader when all you wanted was 8. Not sure if this an installation issue or not.

Adding extra pixels on left or right of image source containing a dithered image adds banding.

With an image that contains dithering, if the scaler includes extra pixels on left or right, you can see noticeable banding. This is with with default shader and no extra scaling. Does this suggest that scaling occurs somewhere when adding extra pixels?

When taking screenshots, I did notice that taking screenshots of the source (instead of the scene) lead to screenshots with the same dimensions of 640x400, even though OBS says that it is 660x400 in the transform window after adding extra pixels.

Using OBS 29.1.3 and obs-shaderfilter 2.2.2 on Windows 10 (haven't had a chance to upgrade to newer OBS yet sorry, hopefully it's unrelated)

To test:
Add this image as a source with no scaling:
qm_001

Configure shader with extra pixels on left and right as so:
image

OBS scene screenshot without shader:
Screenshot 2024-03-04 01-11-14

OBS scene screenshot with shader:
Screenshot 2024-03-04 01-11-27

Rainbow random.

This might be not the place for this if so I will walk away i dont mean to bother your work but with the rainbow can you make a random 1 time or even between parameters version of the rainbow color. What i mean is you put the shader on and it gives you a random color that you can use.

Off-scene transition video sources don't update or become visible for rendering when used

When I would try to use video media sources as textures, I found they'd only work for me if they were in the current scene and visible. For transitions this was a problem since I'd need many copies of sources, also the videos should restart with the transition restarts.

I hacked a little fix in here locally that seems to be working for me.

I'm struggling my way through github's learning curve. Apologies if I'm making a mess of things. Link below is to a commit that, for me, corrects the issue outlined.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.