mirror of
https://github.com/Kbz-8/42_vox.git
synced 2026-01-11 14:43:34 +00:00
Nerfed mountains, added beaches, placeholder for water & snow
This commit is contained in:
@@ -184,7 +184,14 @@ const int Noise::ApplyPerlin2DParameters(float x, float y) noexcept // Wrapper t
|
|||||||
{
|
{
|
||||||
// const std::uint32_t value = Perlin3D(pos.x, y, pos.y);
|
// const std::uint32_t value = Perlin3D(pos.x, y, pos.y);
|
||||||
if(y > std::min(height, CHUNK_SIZE.y) - 2)
|
if(y > std::min(height, CHUNK_SIZE.y) - 2)
|
||||||
data[y] = static_cast<std::uint32_t>(BlockType::Grass);
|
{
|
||||||
|
if (height <= 23)
|
||||||
|
data[y] = static_cast<std::uint32_t>(BlockType::Sand);
|
||||||
|
else if (height < 140)
|
||||||
|
data[y] = static_cast<std::uint32_t>(BlockType::Grass);
|
||||||
|
else
|
||||||
|
data[y] = static_cast<std::uint32_t>(BlockType::Stone);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
data[y] = static_cast<std::uint32_t>(BlockType::Stone);
|
data[y] = static_cast<std::uint32_t>(BlockType::Stone);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
class Noise
|
class Noise
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Noise(const std::uint32_t seed = 42, float frequency = 0.045f, float amplitude = 0.80f, int octaves = 4, float lacunarity = 2.0f, float persistance = 0.7f, int redistribution = 4, float compensatory_factor = 1.3f);
|
Noise(const std::uint32_t seed = 42, float frequency = 0.045f, float amplitude = 0.80f, int octaves = 4, float lacunarity = 2.0f, float persistance = 0.7f, int redistribution = 4, float compensatory_factor = 1.2f);
|
||||||
|
|
||||||
[[nodiscard]] std::array<std::uint32_t, CHUNK_SIZE.y> GetHeight(Scop::Vec2i pos);
|
[[nodiscard]] std::array<std::uint32_t, CHUNK_SIZE.y> GetHeight(Scop::Vec2i pos);
|
||||||
[[nodiscard]] const int Perlin2D(int x, int y) noexcept;
|
[[nodiscard]] const int Perlin2D(int x, int y) noexcept;
|
||||||
|
|||||||
Reference in New Issue
Block a user