Skip to content

Instantly share code, notes, and snippets.

View AquaGeneral's full-sized avatar

Jesse Stiller AquaGeneral

View GitHub Profile
@vassvik
vassvik / Simulation_Projection.md
Last active May 14, 2026 05:38
Realtime Fluid Simulation: Projection

Realtime Fluid Simulation: Projection

The core of most real-time fluid simulators, like the one in EmberGen, are based on the "Stable Fluids" algorithm by Jos Stam, which to my knowledge was first presented at SIGGRAPH '99. This is a post about one part of this algorithm that's often underestimated: Projection

MG4_F32.mp4

Stable Fluids

The Stable Fluids algorithm solves a subset of the famous "Navier Stokes equations", which describe how fluids interact and move. In particular, it typically solves what's called the "incompressible Euler equations", where viscous forces are often ignored.

@Wumpf
Wumpf / cfd.md
Last active February 3, 2026 09:54
Notes on CFD
@phi-lira
phi-lira / UniversalPipelineTemplateShader.shader
Last active April 29, 2026 02:38
Template shader to use as guide to create Universal Pipeline ready shaders. This shader works with Universal Render Pipeline 7.1.x and above.
// When creating shaders for Universal Render Pipeline you can you the ShaderGraph which is super AWESOME!
// However, if you want to author shaders in shading language you can use this teamplate as a base.
// Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader.
// This shader works with URP 7.1.x and above
Shader "Universal Render Pipeline/Custom/Physically Based Example"
{
Properties
{
// Specular vs Metallic workflow
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0
@keijiro
keijiro / AngleAxis3x3.hlsl
Last active July 28, 2024 18:35
3x3 Rotation matrix with an angle and an arbitrary vector
// Rotation with angle (in radians) and axis
float3x3 AngleAxis3x3(float angle, float3 axis)
{
float c, s;
sincos(angle, s, c);
float t = 1 - c;
float x = axis.x;
float y = axis.y;
float z = axis.z;
@StagPoint
StagPoint / QuaternionCompression.cs
Last active December 2, 2024 07:38
C# - Use "smallest three" compression for transmitting Quaternion rotations in Unity's UNET networking, from 16 bytes to 7 bytes.
// Copyright (c) 2016 StagPoint Software
namespace StagPoint.Networking
{
using System;
using UnityEngine;
using UnityEngine.Networking;
/// <summary>
/// Provides some commonly-used functions for transferring compressed data over the network using
@kylemcdonald
kylemcdonald / hsv2rgb.glsl
Created July 14, 2015 18:44
Every unique HSV to RGB conversion function named "hsv2rgb" on ShaderToy.
vec3 hsv2rgb(vec3 c) {
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
const vec4 K = vec4(1., 2. / 3., 1. / 3., 3.);
vec3 hsv2rgb(vec3 c)
{
// from http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl
@MattRix
MattRix / SolutionFixer.cs
Created January 15, 2015 02:44
Updates the solution .NET version and removes UnityScript projects
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.IO;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System;
class SolutionFixer : AssetPostprocessor
@mwegner
mwegner / StripGeneratedSolutionSettings.cs
Last active May 9, 2019 23:37
Strip Settings From Unity's Generated .sln Files
/*
v2: Matt Rix pointed out there's an undocumented ONGeneratedCSProjectFiles() callback
https://gist.github.com/MattRix/0bf8de88e16e8b494dbb
v1: Still available in the gist history if you want a FileSystemWatcher solution!
THE PROBLEM:
- Unity constantly rewrites its .sln files whenever you rename/add/remove scripts
@keijiro
keijiro / about.md
Last active December 11, 2017 11:28
About Me

About Me

Photo

高橋 啓治郎 - 1977年生まれ

コンシューマーゲーム業界にて10年間の開発経験を持つゲームプログラマーです。ゲームプログラミング全般に経験を持ち、中でもグラフィックスプログラミング、AIプログラミングを得意としています。

現在は iPhone/iPad アプリの開発を主軸に置きつつ、技術書への寄稿や、ゲーム開発のコンサルティングなどを手がけています。