Skip to content

Instantly share code, notes, and snippets.

View pinkwerks's full-sized avatar
💭
Environment aware manipulation

Pink Bobsledder pinkwerks

💭
Environment aware manipulation
View GitHub Profile
@tonyg
tonyg / 2d.rkt
Last active April 8, 2024 03:41
Playing with OpenGL in Racket
#lang send-exp racket/gui
(require sgl/gl)
(require sgl/gl-vectors)
(require pict)
(define texture%
(class object%
(init [(initial-bitmap bitmap)])
(field [width 0]
@senko
senko / maybe.py
Last active May 2, 2024 18:35
A Pythonic implementation of the Maybe monad
# maybe.py - a Pythonic implementation of the Maybe monad
# Copyright (C) 2014. Senko Rasic <[email protected]>
#
# 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:
#
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active April 18, 2025 15:31
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);

Git Cheat Sheet

Commands

Getting Started

git init

or

// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "Custom/Wireframe" {
Properties
{
_WireThickness ("Wire Thickness", RANGE(0, 800)) = 100
_Color("Color", Color) = (1,1,1,1)
}
SubShader
{
@yasirkula
yasirkula / EditorCollapseAll.cs
Last active October 24, 2024 06:17
An editor script for Unity 3D to collapse all GameObject's in Hierarchy view or to collapse all folders in Project view. See the comments section below for instructions.
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEditor.IMGUI.Controls;
using UnityEditorInternal;
using UnityEngine.SceneManagement;
public static class EditorCollapseAll
{
private const BindingFlags INSTANCE_FLAGS = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
@a3geek
a3geek / PoissonDiskSampling.cs
Last active February 13, 2025 02:16
Fast Poisson Disk Sampling for Unity.
using System.Collections.Generic;
using UnityEngine;
namespace Gists
{
// The algorithm is from the "Fast Poisson Disk Sampling in Arbitrary Dimensions" paper by Robert Bridson.
// https://www.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk.pdf
public static class FastPoissonDiskSampling
{
@a3geek
a3geek / KneeCurve.cs
Last active January 5, 2023 04:14
Knee Curve and Soft Knee Curve for Unity.
using System;
using UnityEngine;
namespace Gists
{
[Serializable]
public class KneeCurve
{
[SerializeField]
protected float threshold = 0f;