pushing cause its kinda working.

This commit is contained in:
Yggdrasil75
2026-01-05 12:56:32 -05:00
parent 466fa26dc7
commit 264f5d9496
3 changed files with 77 additions and 36 deletions

View File

@@ -164,6 +164,29 @@ public:
return retval;
}
Vec4ui8 permuteColor(const Vec3<float>& point) {
TIME_FUNCTION;
float noiseR = permute(point);
float noiseG = permute(point + Vec3<float>(100.0f, 100.0f, 100.0f));
float noiseB = permute(point + Vec3<float>(200.0f, 200.0f, 200.0f));
float noiseA = permute(point + Vec3<float>(300.0f, 300.0f, 300.0f));
float rNormalized = (noiseR + 1.0f) * 0.5f;
float gNormalized = (noiseG + 1.0f) * 0.5f;
float bNormalized = (noiseB + 1.0f) * 0.5f;
float aNormalized = (noiseA + 1.0f) * 0.5f;
rNormalized = std::clamp(rNormalized, 0.0f, 1.0f);
gNormalized = std::clamp(gNormalized, 0.0f, 1.0f);
bNormalized = std::clamp(bNormalized, 0.0f, 1.0f);
aNormalized = std::clamp(aNormalized, 0.0f, 1.0f);
uint8_t r = static_cast<uint8_t>(rNormalized * 255.0f);
uint8_t g = static_cast<uint8_t>(gNormalized * 255.0f);
uint8_t b = static_cast<uint8_t>(bNormalized * 255.0f);
uint8_t a = static_cast<uint8_t>(aNormalized * 255.0f);
return Vec4ui8(r, g, b, a);
}
};
#endif