[orx-shader-phrases] Add shader embedding

This commit is contained in:
Edwin Jakobs
2021-06-25 09:55:35 +02:00
parent 4e1a2cf930
commit 4f0de6a39b
22 changed files with 111 additions and 479 deletions

View File

@@ -0,0 +1,14 @@
#pragma import phraseHash21
float valueNoise21(vec2 x) {
vec2 i = floor(x);
vec2 f = fract(x);
float a = hash21(i);
float b = hash21(i + vec2(1.0, 0.0));
float c = hash21(i + vec2(0.0, 1.0));
float d = hash21(i + vec2(1.0, 1.0));
vec2 u = f * f * (3.0 - 2.0 * f);
return mix(a, b, u.x) + (c - a) * u.y * (1.0 - u.x) + (d - b) * u.x * u.y;
}