Skip to content

Instantly share code, notes, and snippets.

View Lokno's full-sized avatar

Lokno Lokno

View GitHub Profile
@Lokno
Lokno / goblin.shader
Last active January 15, 2026 14:09
OBS filter using OBS-shaderfilter to render goblindotbest with distance functions
// The MIT License
// Copyright © 2018 Inigo Quilez
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOF
@Lokno
Lokno / snow.shader
Last active January 5, 2026 02:36
OBS-shaderfilter shader that displays snow (conversion of this shadertoy shader: https://www.shadertoy.com/view/Mdt3Df)
uniform int outerIter<
string label = "Outer Iterations";
string widget_type = "slider";
int minimum = 0;
int maximum = 20;
int step = 1;
> = 6;
uniform int innerIter<
string label = "Inter Iteration";
@Lokno
Lokno / audio_reactive.shader
Last active January 6, 2026 02:46
OBS-shaderfilter (2.6.0+) shader for dimming a source when an audio channel goes below a certain threshold. Optionally blend into a "talk" texture.
uniform float audio_magnitude;
uniform float threshold<
string label = "Activation Threshold";
string widget_type = "slider";
float minimum = 0.0;
float maximum = 1.0;
float step = 0.01;
> = 0.1;
@Lokno
Lokno / audio_squish.shader
Last active January 4, 2026 19:15
obs-shaderfilter (2.6.0) shader that will squish a source based on the audio_magnitude selected in the parameters
uniform float audio_magnitude;
uniform float amount<
string label = "Maximum Squish Height";
string widget_type = "slider";
float minimum = 0.0;
float maximum = 1.0;
float step = 0.01;
> = 0.4;
@Lokno
Lokno / BlueprintLibraryLD.cpp
Last active January 1, 2026 23:19
Expose the existing LevenshteinDistance code to blueprints
#include "BlueprintLibraryLD.h"
#include "Algo/LevenshteinDistance.h"
int32 UBlueprintLibraryLD::LevenshteinDistance(const FString& A, const FString& B)
{
return Algo::LevenshteinDistance(A, B);
}
@Lokno
Lokno / BlueprintLibraryLD.h
Last active January 1, 2026 23:19
Expose the existing LevenshteinDistance code to blueprints
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "BlueprintLibraryLD.generated.h"
UCLASS()
class YOURPROJECT_API UBlueprintLibraryLD : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
@Lokno
Lokno / parseCSV.cs
Last active January 21, 2026 01:21
Streamer.bot C# Script that parses a CSV line in a global into 3 values and stores them in 3 seperate globals. Handles double quotes.
using System;
using System.Collections.Generic;
public class CPHInline
{
// parses a CSV line where elements may be wrapped in double quotes
public string[] parse_csv( string line )
{
string comma = ",";
string quote = "\"";
@Lokno
Lokno / hue-rotaton-heck.shader
Last active September 18, 2025 17:39
Revision of hue-rotaton.shader provided by obs-shaderfilter to cycle back and through only a window of the possible hues
// Hue Rotation shader, version 1.heck.jr for OBS Shaderfilter
// Copyright ©️ 2023 by SkeletonBow
// Modified by Lokno
// License: GNU General Public License, version 2
//
// Contact info:
// Twitter: <https://twitter.com/skeletonbowtv>
// Twitch: <https://twitch.tv/skeletonbowtv>
// YouTube: <https://youtube.com/@skeletonbow>
// Soundcloud: <https://soundcloud.com/skeletonbowtv>
@Lokno
Lokno / ResolveEnvVars.h
Created July 20, 2025 18:32
C++ static function which will replace envionment variable name denoted by a prefix and corresponding postfix
// Replace environment variables identified by a prefix and postfix string with their corresponding values
// Returns a new modified string or the original string if it encounters incorrect formatted input
static std::string ResolveEnvVars(const std::string& str, const std::string prefix, const std::string postfix)
{
size_t p = 0;
size_t a = std::string::npos;
size_t b = std::string::npos;
std::string outstr = str;
bool found = true;
bool error = false;
@Lokno
Lokno / overflow_loop_bug.csx
Last active July 2, 2025 13:19
Demonstration of intentional overflow loop and infinite loop pitfall
byte id = 25;
int temp;
Console.WriteLine($"Loop Start!");
//for(byte i = (byte)(id+1); i <= byte.MaxValue; i++ ) // infinite loop
for(byte i = (byte)(id+1); i != id; i++ )
{
Console.WriteLine($"i: {i}");