Skip to content

Instantly share code, notes, and snippets.

View sad1e's full-sized avatar
:octocat:
getting things done.

sad1e sad1e

:octocat:
getting things done.
View GitHub Profile
@sad1e
sad1e / .gitdepsignore
Created April 8, 2025 00:47 — forked from parthnaik92/.gitdepsignore
Create a minimal binary build of the Oculus fork UE4 from source for internal distribution. (Should work with normal UE4 source build too) (Windows only)
/Samples/MobileStarterContent/**
/Samples/PixelStreaming/**
/Samples/StarterContent/**
/Templates/**
/FeaturePacks/**
/Engine/Source/Developer/Datasmith/**
/Engine/Source/Programs/Enterprise/**
/Engine/Source/Programs/SwitchboardListener/**
/Engine/Source/Runtime/Datasmith/**
/Engine/Plugins/AI/UE4ML/**
@sad1e
sad1e / opt_fsr.fxh
Created April 7, 2025 08:24 — forked from atyuwen/opt_fsr.fxh
An optimized AMD FSR implementation for Mobiles
//==============================================================================================================================
// An optimized AMD FSR 1.0 implementation for Mobiles
// EASU and RCAS are combined in a single pass.
// Based on https://github.com/GPUOpen-Effects/FidelityFX-FSR/blob/master/ffx-fsr/ffx_fsr1.h
// Details can be found: https://atyuwen.github.io/posts/optimizing-fsr/
// Distributed under the MIT License. Copyright (c) 2021 atyuwen.
// -- FsrEasuSampleH should be implemented by calling shader, like following:
// AH3 FsrEasuSampleH(AF2 p) { return MyTex.SampleLevel(LinearSampler, p, 0).xyz; }
//==============================================================================================================================
void FsrMobile(
@sad1e
sad1e / fmath.h
Last active September 3, 2024 08:56
parula colormap generator.
#include <cmath>
#include <concepts>
#define Float double
namespace fmath {
constexpr Float pi = 3.141592653589793;
template <std::floating_point T>
@sad1e
sad1e / FlyCamera.cs
Created May 31, 2024 14:38 — forked from FreyaHolmer/FlyCamera.cs
A camera controller for easily flying around a scene in Unity smoothly. WASD for lateral movement, Space & Ctrl for vertical movement, Shift to move faster. Add this script to an existing camera, or an empty game object, hit play, and you're ready to go~
using UnityEngine;
[RequireComponent( typeof(Camera) )]
public class FlyCamera : MonoBehaviour {
public float acceleration = 50; // how fast you accelerate
public float accSprintMultiplier = 4; // how much faster you go when "sprinting"
public float lookSensitivity = 1; // mouse look sensitivity
public float dampingCoefficient = 5; // how quickly you break to a halt after you stop your input
public bool focusOnEnable = true; // whether or not to focus and lock cursor immediately on enable
@sad1e
sad1e / disable_exe_conn.ps1
Last active March 30, 2024 16:02
script to add exe files to firewall outbound rules.
param(
[string]$DestPath = "",
[string]$GroupName = ""
)
if ([string]::IsNullOrEmpty($DestPath)) {
Write-Host "Destinationpath path is empty.";
return;
}
@sad1e
sad1e / GLSL-Noise.md
Created March 18, 2024 08:04 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
// read the PDF about this if you precompute it! it's got helpful info!
// can be optimized into lut (compute can gen it)
float GTTonemap(float x) {
float m = 0.22; // linear section start
float a = 1.0; // contrast
float c = 1.33; // black brightness
float P = 1.0; // maximum brightness
float l = 0.4; // linear section length
float l0 = ((P-m)*l) / a; // 0.312
@sad1e
sad1e / latency.markdown
Created September 6, 2022 10:19 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs