Skip to content

Instantly share code, notes, and snippets.

@SabinT
SabinT / UnitySetup.bat
Last active January 6, 2022 08:39
Common Unity project first time setup
git init
curl -o .gitignore https://github.com/github/gitignore/raw/main/Unity.gitignore
curl -o .gitattributes https://gist.github.com/nemotoo/b8a1c3a0f1225bb9231979f389fd4f3f/raw/dc3e8cab80fc62d1c60db70c761b1ffa636aa796/.gitattributes
git add .gitignore
git add .gitattributes
git commit -m "Initialize with gitignore/git LFS attributes"
# Optional: add useful packages
@webbisswiftapps
webbisswiftapps / patterns.pde
Last active May 26, 2021 05:24
Processing sketch to generate a pattern using the 10print algorithm.
int canvasWidth = 1920;
int canvasHeight = 1080;
int originX = 0;
int originY = 0;
int lineUnit = 25;
int startX = originX;
int startY = originY;
void setup(){
size(1920, 1080);
@totallyRonja
totallyRonja / oklab.hlslinc
Created March 24, 2021 13:47
OkLab color conversion functions for hlsl
static const float3x3 lrgb2cone = {
0.412165612, 0.211859107, 0.0883097947,
0.536275208, 0.6807189584, 0.2818474174,
0.0514575653, 0.107406579, 0.6302613616,
};
static const float3x3 cone2lab = {
+0.2104542553, +1.9779984951, +0.0259040371,
+0.7936177850, -2.4285922050, +0.7827717662,
+0.0040720468, +0.4505937099, -0.8086757660,
@grapefrukt
grapefrukt / URPPostProcessStripper.cs
Last active October 30, 2024 08:40
Strips all post-processing shaders and related assets from Unity builds using URP
/*
Copyright 2020 Martin Jonasson
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
@ayamflow
ayamflow / rotate-uv.glsl
Created January 16, 2018 23:24
Rotate UV in GLSL
vec2 rotateUV(vec2 uv, float rotation)
{
float mid = 0.5;
return vec2(
cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,
cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid
);
}
vec2 rotateUV(vec2 uv, float rotation, vec2 mid)
@nemotoo
nemotoo / .gitattributes
Last active February 14, 2025 12:47
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@cjddmut
cjddmut / EasingFunctions.cs
Last active February 14, 2025 22:14
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* 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
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active February 12, 2025 13:54
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);