Skip to content

Instantly share code, notes, and snippets.

@maxtruxa
Last active September 1, 2015 06:59
Show Gist options
  • Save maxtruxa/6f6c3d5686cb085cdbb4 to your computer and use it in GitHub Desktop.
Save maxtruxa/6f6c3d5686cb085cdbb4 to your computer and use it in GitHub Desktop.
#include "perlin_noise.hpp"
#include <numeric>
#include <random>
namespace detail {
namespace perlin_noise {
double fade(double t)
{
return t * t * t * (t * (t * 6 - 15) + 10);
}
double lerp(double t, double a, double b)
{
return a + t * (b - a);
}
double grad(uint_fast8_t hash, double x, double y, double z)
{
double u = hash < 8 ? x : y;
double v = hash < 4 ? y : hash == 12 || hash == 14 ? x : z;
return ((hash & 1) == 0 ? u : -u) + ((hash & 2) == 0 ? v : -v);
}
} // namespace perlin_noise
} // namespace detail
perlin_noise::perlin_noise(uint_least32_t seed)
{
auto begin = this->vector.begin();
auto end = std::next(begin, this->vector.size() / 2);
std::iota(begin, end, 0);
std::mt19937 engine(static_cast<uint_fast32_t>(seed));
std::shuffle(begin, end, engine);
std::copy(begin, end, end);
}
double perlin_noise::noise(double x, double y, double z)
{
using namespace detail::perlin_noise;
// Find the unit cube that contains the point.
// Find relative coordinates inside the unit cube.
auto X = static_cast<int_fast32_t>(std::floor(x)) & 0xFF;
auto Y = static_cast<int_fast32_t>(std::floor(y)) & 0xFF;
auto Z = static_cast<int_fast32_t>(std::floor(z)) & 0xFF;
x -= std::floor(x);
y -= std::floor(y);
z -= std::floor(z);
// Compute fade curves for each dimension.
auto u = fade(x);
auto v = fade(y);
auto w = fade(z);
uint_fast8_t const* p = this->vector.data();
// Hash coordinates of the 8 cube corners.
auto a = p[X ] + Y;
auto aa = p[a ] + Z;
auto ab = p[a + 1] + Z;
auto b = p[X + 1] + Y;
auto ba = p[b ] + Z;
auto bb = p[b + 1] + Z;
// Blend in results from 8 corners of the cube.
auto g0 = grad(p[aa ], x , y , z );
auto g1 = grad(p[ba ], x - 1, y , z );
auto g2 = grad(p[ab ], x , y - 1, z );
auto g3 = grad(p[bb ], x - 1, y - 1, z );
auto g4 = grad(p[aa + 1], x , y , z - 1);
auto g5 = grad(p[ba + 1], x - 1, y , z - 1);
auto g6 = grad(p[ab + 1], x , y - 1, z - 1);
auto g7 = grad(p[bb + 1], x - 1, y - 1, z - 1);
auto l0 = lerp(u, g0, g1);
auto l1 = lerp(u, g2, g3);
auto l2 = lerp(u, g4, g5);
auto l3 = lerp(u, g6, g7);
auto l4 = lerp(v, l0, l1);
auto l5 = lerp(v, l2, l3);
auto n = lerp(w, l4, l5);
return (n + 1.0) / 2.0;
}
#include <cstdint>
#include <array>
class perlin_noise
{
public:
perlin_noise(uint_least32_t seed);
double noise(double x, double y, double z);
private:
std::array<uint_fast8_t, 512> vector;
};
#include <sstream>
#include <fstream>
#include <iomanip>
#include "perlin_noise.hpp"
// `basic_ios_format_saver` copied from libwio.
template<typename Char, typename Traits = std::char_traits<Char>>
class basic_ios_format_saver
{
public:
typedef std::basic_ios<Char, Traits> ios_type;
explicit basic_ios_format_saver(ios_type& stream)
: _origin(stream)
, _saver(NULL)
{
this->_saver.copyfmt(this->_origin);
}
~basic_ios_format_saver()
{
this->restore();
}
void restore() const
{
this->_origin.copyfmt(this->_saver);
}
private:
ios_type& _origin;
std::ios _saver;
};
typedef basic_ios_format_saver<char> ios_format_saver;
typedef basic_ios_format_saver<wchar_t> wios_format_saver;
int main(int argc, char const** argv)
{
std::ofstream ofs("<insert path here>");
assert(ofs);
uint32_t const blocks_h = 64;
uint32_t const blocks_v = blocks_h;
uint32_t const block_size = 8;
uint32_t const seed = 1;
ofs << "<DOCTYPE html>\n"
"<html>\n"
" <head>\n"
" <meta charset=\"UTF-8\">\n"
" <title>map test</title>\n"
" <script style=\"text/javascript\">\n"
" function draw_map() {\n"
" // Map layout.\n"
" var blocks_h = " << blocks_h << ";\n"
" var blocks_v = " << blocks_v << ";\n"
" var block_size = " << block_size << ";\n"
" \n"
" var canvas = document.getElementById('map_canvas');\n"
" canvas.width = blocks_h * block_size;\n"
" canvas.height = blocks_v * block_size;\n"
" \n"
" var context = canvas.getContext('2d');\n"
" \n"
" // Fill background.\n"
" context.fillStyle = '#000';\n"
" context.fillRect(0, 0, canvas.width, canvas.height);\n"
" \n"
" function draw_block(x, y, style) {\n"
" // Upscale block coordinates to pixels.\n"
" x *= block_size;\n"
" y *= block_size;\n"
" \n"
" // Draw a red block.\n"
" context.fillStyle = style;\n"
" context.fillRect(x, y, block_size, block_size);\n"
" }\n"
" \n"
" function pad_string(str, length, pad) {\n"
" while (str.length < length) {\n"
" str = pad + str;\n"
" }\n"
" return str;\n"
" }\n"
" \n"
" function value_to_css_color(value) {\n"
" var c = pad_string(value.toString(16), 2, '0');\n"
" return '#' + c + c + c;\n"
//" var c = pad_string(value.toString(16), 6, '0');\n"
//" return '#' + c;\n"
" }\n"
" \n"
" var blocks = [\n";
{ // ios_format_saver scope
ios_format_saver ofs_format(ofs);
ofs << std::hex << std::setfill('0');
std::mt19937 engine(static_cast<uint_fast32_t>(seed));
engine.discard(10);
perlin_noise pn(engine());
perlin_noise pn_r(engine());
perlin_noise pn_g(engine());
perlin_noise pn_b(engine());
for (uint32_t v = 0; v < blocks_v; ++v) {
ofs << " [";
for (uint32_t h = 0; h < blocks_h; ++h) {
double x = static_cast<double>(h) / blocks_h;
double y = static_cast<double>(v) / blocks_v;
double n = pn.noise(x, y, 0.8) * 20;
double r = pn_r.noise(x, y, 0.8) * 20;
double g = pn_g.noise(x, y, 0.8) * 20;
double b = pn_b.noise(x, y, 0.8) * 20;
n -= std::floor(n);
r -= std::floor(r);
g -= std::floor(g);
b -= std::floor(b);
uint32_t color = static_cast<uint32_t>(std::floor(0x100 * n));
ofs << " 0x" << std::setw(2) << color << ",";
//uint32_t color = (static_cast<uint32_t>(std::floor(0x100 * r)) << 16)
// | (static_cast<uint32_t>(std::floor(0x100 * g)) << 8)
// | (static_cast<uint32_t>(std::floor(0x100 * b)) << 0);
//ofs << " 0x" << std::setw(6) << color << ",";
}
ofs << " ],\n";
}
}
ofs << " ];\n"
" \n"
" for (var y = 0; y < blocks.length; ++y) {\n"
" var row = blocks[y];\n"
" for (var x = 0; x < row.length; ++x) {\n"
" draw_block(x, y, value_to_css_color(row[x]));\n"
" }\n"
" }\n"
" };\n"
" </script>\n"
" </head>\n"
" <body onload=\"javascript:draw_map();\">\n"
" <canvas id=\"map_canvas\"></canvas>\n"
" </body>\n"
"</html>\n";
return 0;
}
<DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>map test</title>
<script style="text/javascript">
function draw_map() {
// Map layout.
var blocks_h = 64;
var blocks_v = 64;
var block_size = 8;
var canvas = document.getElementById('map_canvas');
canvas.width = blocks_h * block_size;
canvas.height = blocks_v * block_size;
var context = canvas.getContext('2d');
// Fill background.
context.fillStyle = '#000';
context.fillRect(0, 0, canvas.width, canvas.height);
function draw_block(x, y, style) {
// Upscale block coordinates to pixels.
x *= block_size;
y *= block_size;
// Draw a red block.
context.fillStyle = style;
context.fillRect(x, y, block_size, block_size);
}
function pad_string(str, length, pad) {
while (str.length < length) {
str = pad + str;
}
return str;
}
function value_to_css_color(value) {
var c = pad_string(value.toString(16), 2, '0');
return '#' + c + c + c;
}
var blocks = [
[ 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, ],
[ 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb6, 0xb6, 0xb5, 0xb5, 0xb4, 0xb3, 0xb3, 0xb2, 0xb0, 0x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f, 0xe4, 0x09, 0x30, 0x57, 0x7e, 0xa6, 0xcd, 0xf5, 0x1d, 0x44, 0x6b, 0x92, 0xb7, 0xdc, 0xff, 0x22, 0x43, 0x63, 0x81, 0x9e, 0xb9, 0xd2, 0xe9, 0xff, 0x12, 0x24, 0x34, 0x41, 0x4d, 0x58, 0x60, 0x67, 0x6c, 0x70, 0x73, 0x75, 0x76, 0x76, ],
[ 0x35, 0x35, 0x35, 0x36, 0x38, 0x3b, 0x3f, 0x44, 0x4b, 0x53, 0x5d, 0x69, 0x77, 0x86, 0x98, 0xab, 0xc0, 0xd7, 0xf0, 0x0a, 0x27, 0x45, 0x64, 0x85, 0xa6, 0xca, 0xee, 0x13, 0x39, 0x5f, 0x86, 0xad, 0xd4, 0xfc, 0x23, 0x4a, 0x70, 0x96, 0xbb, 0xdf, 0x02, 0x24, 0x45, 0x64, 0x82, 0x9e, 0xb9, 0xd1, 0xe8, 0xfe, 0x11, 0x22, 0x32, 0x40, 0x4b, 0x55, 0x5e, 0x65, 0x6a, 0x6e, 0x70, 0x72, 0x73, 0x73, ],
[ 0x49, 0x49, 0x49, 0x4a, 0x4b, 0x4e, 0x52, 0x57, 0x5e, 0x66, 0x70, 0x7b, 0x89, 0x98, 0xa9, 0xbc, 0xd1, 0xe7, 0x00, 0x1a, 0x35, 0x53, 0x71, 0x91, 0xb3, 0xd5, 0xf9, 0x1d, 0x42, 0x67, 0x8e, 0xb4, 0xda, 0x01, 0x27, 0x4d, 0x73, 0x98, 0xbc, 0xe0, 0x02, 0x24, 0x44, 0x62, 0x80, 0x9b, 0xb5, 0xce, 0xe4, 0xf9, 0x0c, 0x1d, 0x2c, 0x3a, 0x45, 0x4f, 0x57, 0x5e, 0x63, 0x67, 0x69, 0x6b, 0x6c, 0x6c, ],
[ 0x5f, 0x5f, 0x5f, 0x60, 0x62, 0x65, 0x68, 0x6d, 0x74, 0x7c, 0x85, 0x91, 0x9e, 0xac, 0xbd, 0xd0, 0xe4, 0xfa, 0x12, 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0x70, 0x77, 0x7d, 0x82, 0x86, 0x89, 0x8b, 0x8d, 0x8e, 0x8e, 0x8e, ],
];
for (var y = 0; y < blocks.length; ++y) {
var row = blocks[y];
for (var x = 0; x < row.length; ++x) {
draw_block(x, y, value_to_css_color(row[x]));
}
}
};
</script>
</head>
<body onload="javascript:draw_map();">
<canvas id="map_canvas"></canvas>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment