Skip to content

Instantly share code, notes, and snippets.

@HighTeaFrog
HighTeaFrog / ContainerExtensions.cs
Created Jan 25, 2019
C# SortNoAlloc for List, Array, etc...
View ContainerExtensions.cs
using System.Collections.Generic;
public static class ContainerExtensions
{
public static void SortNoAlloc<T>(this IList<T> list) where T : System.IComparable<T>
{
if(list.Count <= 1) return;
QuickSort(list, 0, list.Count - 1);
}
@HighTeaFrog
HighTeaFrog / UtilsCG.cginc
Created Jul 31, 2018
Random, Noise and Doodle Function in HLSL
View UtilsCG.cginc
float random(float2 seed)
{
return frac(sin(dot(seed.xy, float2(12.9898, 78.233))) * 43758.5453123);
}
float noise(float2 seed)
{
float2 i = floor(seed);
float2 f = frac(seed);