Skip to content

Instantly share code, notes, and snippets.

View KiJou's full-sized avatar

奇九 KiJou

View GitHub Profile
@KiJou
KiJou / Quaternion.hlsl
Created January 7, 2022 04:49 — forked from mattatz/Quaternion.hlsl
Quaternion structure for HLSL
#ifndef __QUATERNION_INCLUDED__
#define __QUATERNION_INCLUDED__
#define QUATERNION_IDENTITY float4(0, 0, 0, 1)
#ifndef PI
#define PI 3.14159265359f
#endif
// Quaternion multiplication
@KiJou
KiJou / GLSL-Noise.md
Created December 9, 2020 16:51 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

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);
	return mix(rand(fl), rand(fl + 1.0), fc);
}