From 464dcc3764f42fd7620bc261b844bf79cfd07768 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 14 May 2013 21:11:40 +0000 Subject: Noise3D generator is now using linear upscaling Measured 30% performance increase. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1482 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Generating/Noise3DGenerator.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source/Generating/Noise3DGenerator.h') diff --git a/source/Generating/Noise3DGenerator.h b/source/Generating/Noise3DGenerator.h index 57cf024f8..b23e8645b 100644 --- a/source/Generating/Noise3DGenerator.h +++ b/source/Generating/Noise3DGenerator.h @@ -29,10 +29,15 @@ public: virtual void DoGenerate(int a_ChunkX, int a_ChunkZ, cChunkDesc & a_ChunkDesc) override; protected: - // Linear interpolation dimensions: - static const int DIMX = 5; - static const int DIMY = 65; - static const int DIMZ = 5; + // Linear interpolation step sizes, must be divisors of cChunkDef::Width and cChunkDef::Height, respectively: + static const int UPSCALE_X = 8; + static const int UPSCALE_Y = 4; + static const int UPSCALE_Z = 8; + + // Linear interpolation buffer dimensions, calculated from the step sizes: + static const int DIM_X = 1 + cChunkDef::Width / UPSCALE_X; + static const int DIM_Y = 1 + cChunkDef::Height / UPSCALE_Y; + static const int DIM_Z = 1 + cChunkDef::Width / UPSCALE_Z; cPerlinNoise m_Perlin; // The base 3D noise source for the actual composition cCubicNoise m_Cubic; // The noise used for heightmap directing -- cgit v1.2.3