mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-14 15:31:49 +00:00
update X sprites rendering randomization
This commit is contained in:
parent
4ea4224452
commit
9f70e14a13
2 changed files with 5 additions and 1 deletions
|
|
@ -227,7 +227,8 @@ void BlocksRenderer::blockXSprite(
|
||||||
pickSoftLight({x + 1, y + 1, z}, {1, 0, 0}, {0, 1, 0}),
|
pickSoftLight({x + 1, y + 1, z}, {1, 0, 0}, {0, 1, 0}),
|
||||||
pickSoftLight({x, y + 1, z}, {1, 0, 0}, {0, 1, 0})
|
pickSoftLight({x, y + 1, z}, {1, 0, 0}, {0, 1, 0})
|
||||||
};
|
};
|
||||||
int rand = ((x * z + y) ^ (z * y - x)) * (z + y);
|
randomizer.setSeed((x * 52321) ^ (z * 389) ^ y);
|
||||||
|
short rand = randomizer.rand32();
|
||||||
|
|
||||||
float xs = ((float)(char)rand / 512) * spread;
|
float xs = ((float)(char)rand / 512) * spread;
|
||||||
float zs = ((float)(char)(rand >> 8) / 512) * spread;
|
float zs = ((float)(char)(rand >> 8) / 512) * spread;
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
#include "voxels/Chunk.hpp"
|
#include "voxels/Chunk.hpp"
|
||||||
#include "voxels/VoxelsVolume.hpp"
|
#include "voxels/VoxelsVolume.hpp"
|
||||||
#include "graphics/core/MeshData.hpp"
|
#include "graphics/core/MeshData.hpp"
|
||||||
|
#include "maths/util.hpp"
|
||||||
|
|
||||||
class Content;
|
class Content;
|
||||||
class Mesh;
|
class Mesh;
|
||||||
|
|
@ -42,6 +43,8 @@ class BlocksRenderer {
|
||||||
const ContentGfxCache* const cache;
|
const ContentGfxCache* const cache;
|
||||||
const EngineSettings* settings;
|
const EngineSettings* settings;
|
||||||
|
|
||||||
|
util::PseudoRandom randomizer;
|
||||||
|
|
||||||
void vertex(const glm::vec3& coord, float u, float v, const glm::vec4& light);
|
void vertex(const glm::vec3& coord, float u, float v, const glm::vec4& light);
|
||||||
void index(int a, int b, int c, int d, int e, int f);
|
void index(int a, int b, int c, int d, int e, int f);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue