Skip to content

Instantly share code, notes, and snippets.

View CarlLee's full-sized avatar

Carl Lee CarlLee

  • Chongqing China
View GitHub Profile
float D_GGX_Anisotropic(float at, float ab, float ToH, float BoH, float NoH) {
// Burley 2012, "Physically-Based Shading at Disney"
float a2 = at * ab;
vec3 d = vec3(ab * ToH, at * BoH, a2 * NoH);
return saturateMediump(a2 * sq(a2 / dot(d, d)) * (1.0 / PI));
}
float V_SmithGGXCorrelated_Anisotropic(float at, float ab, float ToV, float BoV,
float ToL, float BoL, float NoV, float NoL) {
// Heitz 2014, "Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs"
@Split82
Split82 / UnityShadersCheatSheet.shader
Created April 17, 2018 10:07
Unity Shaders Cheat Sheet
Shader "Name" {
Properties {
_Name ("display name", Range (min, max)) = number
_Name ("display name", Float) = number
_Name ("display name", Int) = number
_Name ("display name", Color) = (number,number,number,number)
_Name ("display name", Vector) = (number,number,number,number)
@LotteMakesStuff
LotteMakesStuff / PlayerLoop.cs
Last active March 25, 2024 02:38
Player Loop Visualizer: Built to explore the new PlayerLoopSystem api in Unity 2018.1b2. This tool shows you all the PlayerLoop systems that unity uses to update a frame, and demos how to add your own and even remove systems from the player loop. For more info see the patreon post https://www.patreon.com/posts/unity-2018-1-16336053
// Put this in an editor folder
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.Experimental.LowLevel;
using UnityEngine.Profiling;
@cloudwu
cloudwu / ecs.lua
Created December 3, 2017 14:22
Lua ECS
local core = require "ecs.core"
local ecs = {}
local entities = {} -- all Entities, eid -> entity
local entity_id = 0
ecs.entities = entities
-- cset: component set
local cset = { __mode = "kv" }
@nemotoo
nemotoo / .gitattributes
Last active May 18, 2024 08:08
.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
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active June 8, 2024 06:11
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);
@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net