├── README.md ├── heatmap.shader └── inverse.shader /README.md: -------------------------------------------------------------------------------- 1 | A collection of short scripts to be used with the [obs-shaderfilter plugin](https://github.com/exeldro/obs-shaderfilter) for OBS Studio: 2 | 3 | > OBS shaders are written in OBS version of HLSL. 4 | 5 | > 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. -------------------------------------------------------------------------------- /heatmap.shader: -------------------------------------------------------------------------------- 1 | // Pseudo Heat Map Shader for obs-shaderfilter plugin 2 | // @author CareFreeBomb 3 | // @version 2022-11-08 4 | 5 | uniform float Mix_Amount = 1.0; // 6 | uniform float Cold = 1.2; 7 | 8 | float4 mainImage(VertData v_in) : TARGET 9 | { 10 | // Normalized pixel coordinates (from 0 to 1) 11 | float2 uv = v_in.uv; 12 | 13 | // Get the original color at uv coords 14 | float4 origColor = image.Sample(textureSampler, uv); 15 | 16 | // Convert to grayscale value to be used for x val on gradient 17 | float grayscaleVal = dot(origColor.rgb, float3(0.299, 0.587, 0.114)); 18 | 19 | // Gradient data 20 | float level = grayscaleVal * 3.14159265 / Cold; // uv.x * 21 | float3 col; 22 | col.r = sin(level); 23 | col.g = sin(level * 2.0); 24 | col.b = cos(level); 25 | 26 | // Mix between original and sampled colors 27 | origColor.rgb = lerp(origColor.rgb, col, Mix_Amount); 28 | return origColor; 29 | } -------------------------------------------------------------------------------- /inverse.shader: -------------------------------------------------------------------------------- 1 | // Inverse Color Shader for obs-shaderfilter plugin 2 | // @author CareFreeBomb 3 | // @version 2022-11-08 4 | 5 | uniform float Threshold = 1.0; 6 | 7 | float4 mainImage(VertData v_in) : TARGET 8 | { 9 | float4 origColor = image.Sample(textureSampler, v_in.uv); 10 | 11 | origColor.rgb = abs(Threshold - origColor.rgb); 12 | 13 | return origColor; 14 | } --------------------------------------------------------------------------------