This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * generates an array of blue noise points using poisson discs | |
| * @param {real} width the width of the region of points | |
| * @param {real} height the height of the region of points | |
| * @param {real} radius the poisson disc radius, or space between each point | |
| * @param {real} rejections the number of attempts made to generate a point before moving on | |
| */ | |
| function bluenoise(width, height, radius = 4, rejections = 30) constructor { | |
| static sample = function(x, y) constructor { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function rerand() constructor { | |
| state = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; | |
| g_nRandSeed = 0; | |
| g_RndIndex = 0; | |
| s_nRandomPoly = $DA442D24; | |
| RND_MAX = $FFFFFFFF; | |
| s_nStateAndMask = RND_MAX; | |
| InitRandom = function(/*uint*/ _seed) { | |
| var uVar3 = _seed; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * MIT License | |
| * | |
| * Copyright (c) 2021-2022 John "Nielk1" Klein | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |