Skip to content

Instantly share code, notes, and snippets.

@keijiro
keijiro / FpsCapper.cs
Last active March 17, 2026 06:10
FpsCapper - Limits the frame rate of the Unity Editor in Edit Mode
using UnityEditor;
using UnityEngine;
using UnityEngine.LowLevel;
using System.Linq;
using System.Threading;
namespace EditorUtils {
//
// Serializable settings
@float3
float3 / Bitpacking.cginc
Last active February 9, 2022 14:17
2 Bitpacking methods
// Method 1:
// by MerlinVR
// You can convert the uints to full precision floats using asfloat(half3ToUint(input)) and store floats using uintToHalf3(asuint(inputfloat))
// Packing/unpacking routines for saving integers to R16G16B16A16_FLOAT textures
// Heavily based off of https://github.com/apitrace/dxsdk/blob/master/Include/d3dx_dxgiformatconvert.inl
// For some reason the last 2 bits get stomped so we'll only allow uint14 for now :(
float uint14ToFloat(uint input)
{
@beesandbombs
beesandbombs / rgbHexes.pde
Created September 8, 2020 22:56
RGB hexes
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
@ompuco
ompuco / PSXDither.hlsl
Last active January 29, 2026 07:52
Color dither & truncation based on Sony's PlayStation (1) hardware features & limitations.
#ifdef PSXDTH
#else
#define PSXDTH
//PS1 Hardware Dithering & Color Precision Truncation Function
//by ompu co | Sam Blye (c) 2020
//PS1 dither table from PSYDEV SDK documentation
@radiatoryang
radiatoryang / SmoothVideoPlaylist.cs
Last active March 27, 2025 16:07
short Unity C# script example for smoothly cutting / playing a playllist of VideoClips, by using one VideoPlayer (activeCam) to play the video and another VideoPlayer (otherCam) to cue up the next video... MIT License.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Video;
public class SmoothVideoPlaylist : MonoBehaviour {
// to smoothly cut between two videos, we need two VideoPlayers
// make sure you create two VideoPlayers and assign them in the Inspector
public VideoPlayer activeCam, otherCam;
@keijiro
keijiro / mesh_to_pointcloud.md
Last active August 6, 2025 16:01
How to convert a mesh into a point cloud with Houdini.

screenshot

  1. Import the source geometry.
  2. Append a Point Wrangle SOP and set the following snippet.
int vlist[] = pointvertices(0, @ptnum);
vector uv = vertex(0, "uv", vlist[0]);
@Cd = colormap("$HIP/TEXTURE_FILENAME.jpg", uv);
  1. Insert a Delete SOP. Change the pattern to "*". Enable "Keep Points".
@narongdejsrn
narongdejsrn / CoreTemp.ini
Created October 15, 2016 13:10
Rainmeter CoreTemp ini with illustro theme
[Rainmeter]
Update=1000
Background=#@#Background.png
; #@# is equal to Rainmeter\Skins\illustro\@Resources
BackgroundMode=3
BackgroundMargins=0,34,0,14
[Variables]
; Variables declared here can be used later on between two # characters (e.g. #MyVariable#).
fontName=Trebuchet MS