Skip to content

Instantly share code, notes, and snippets.

@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;
@johans2
johans2 / SSS.hlsl
Created August 17, 2018 11:42
Subsurface scattering shader
Shader "Custom/SSS" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_NormalMap ("MormalMap", 2D) = "white" {}
_Thickness ("Thickness", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
_Distortion("Distortion", Range(0,1)) = 0.0
_Power("Power", Range(0,10)) = 0.0
#!/usr/bin/env ruby
#
# Recreate Lightroom catalog by replacing corrupt files with recovered copies
#
# Keeps the directory structure and creates the new catalog in a new path,
# which means you'll need at least 3x the size of your photos of free space.
#
# Dependencies:
# - ruby
# - exiftool