17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-04 13:45:49 +01:00

Vulkan: scene rendering (D1–D7) on a scene walk shared with GL (N6a, N6b)

This commit is contained in:
2026-10-24 20:10:24 +02:00
parent bd589f272d
commit 9b7d02e5fb
107 changed files with 14511 additions and 3924 deletions

39
shaders/vk14/random.glsl Normal file
View File

@@ -0,0 +1,39 @@
uint Hash(uint s);
uint Hash(uvec2 s);
uint Hash(uvec3 s);
uint Hash(float s);
uint HashCombine(uint seed, uint value);
// Evolving Sub-Grid Turbulence for Smoke Animation
// H. Schechter and R. Bridson
uint Hash(uint s) {
s ^= 2747636419u;
s *= 2654435769u;
s ^= s >> 16u;
s *= 2654435769u;
s ^= s >> 16u;
s *= 2654435769u;
return s;
}
uint Hash(uvec2 s) {
return HashCombine(Hash(s.x), s.y);
}
uint Hash(uvec3 s) {
return HashCombine(Hash(s.xy), s.z);
}
uint HashCombine(uint seed, uint value) {
return seed ^ (Hash(value) + 0x9e3779b9u + (seed<<6u) + (seed>>2u));
}
uint Rand(inout uint seed) {
seed = Hash(seed);
return seed;
}
float RandF(inout uint seed) {
return float(Rand(seed)) * 2.3283064365386963e-10;
}