{{ message }}

Instantly share code, notes, and snippets.

# KdotJPG

Last active Jul 12, 2021
K.jpg's Idea Dump
View K.jpg's Idea Dump.md

# K.jpg's Idea Dump

Programming-related ideas that I come up with and want to make sure others can consider as well. I try to cover a lot of the details / use cases that come to mind, but it would be difficult to cover them all. Not all of these ideas are fully thought through, but they might still be pretty close to usable implementation descriptions. If you use one of these ideas directly, and you got it here first, credit is appreciated but certainly not required! I'll try to update this whenever I think of something to add to it.

## Noise Generation

### Union of reciprocal lattices

• Generate procedural noise, or perform another function on a particular lattice in N-dimensions, by constructing the lattice as a union of copies of its reciprocal lattice.
• Look at the points that each reciprocal lattice misses on the original lattice. Keep placing reciprocal lattices until those are covered.
Last active Jun 26, 2021
Visually isotropic coherent noise algorithm based on the simplectic honeycomb.
View OpenSimplexNoise.java
 /* * 2014 OpenSimplex Noise in Java. * by Kurt Spencer * * Updated Dec 2019 and Feb 2020: * - New lattice-symmetric gradient sets * - Optional alternate lattice orientation evaluators * * This implementation has been updated to slightly improve its output, but it is recommented to first * try the newer OpenSimplex2S or OpenSimplex2F noise. These are located in the OpenSimplex2 repo:
Created Dec 25, 2014
Tileable 3D OpenSimplex Noise
View OpenSimplexNoiseTileable3D.java
 /* * OpenSimplex Noise in Java. * by Kurt Spencer * * Tileable 3D version, preliminary release. * Could probably use further optimization. * * w6, h6, and d6 are each 1/6 of the repeating period. * for x, y, z respectively. If w6 = 2, h6 = 2, d6 = 2, * then the noise repeats in blocks of (0,0,0)->(12,12,12)
Last active Sep 21, 2020 — forked from digitalshadow/OpenSimplexNoise.cs
OpenSimplex Noise Refactored for C# (with updated gradient sets)
View OpenSimplexNoise.cs
 /* OpenSimplex Noise in C# * Ported from https://gist.github.com/KdotJPG/b1270127455a94ac5d19 * and heavily refactored to improve performance. * Updated Dec 2019, Feb 2020: New Gradients, XYBeforeZ + XZBeforeY 3D functions. */ using System; using System.Runtime.CompilerServices; namespace NoiseTest {
Last active Jan 29, 2020
Sample code for only generating enough noise octaves to know the sign of the final value (simplified from a small WIP MC mod of mine)
View computeGoodEnoughNoise.java
 private double computeGoodEnoughNoise(int worldX, int worldY, int worldZ, double startingValue) { // Final noise value begins with the threshold. double value = startingValue; // e.g. -heightThreshold (negative) double freq = BASE_FREQUENCY; // e.g. 1.0/256.0 double amp = BASE_AMPLITUDE; // e.g. 64.0 for (int i = 0; i < nOctaves && actualValue > -uncertaintyBounds[i] && actualValue < uncertaintyBounds[i]; i++) { value += octaves[i].noise3_XZBeforeY(worldX * hScale * freq, worldY * vScale * freq, worldZ * hScale * freq) * amp; freq *= 2.0;
Last active Jan 10, 2020

View Description 不要授予专利“用于转换数字图像的方法” CN110264409A CN201910160651.XA
 I cannot find the Web Link to submit Prior Art against a patent application in China. So the best that I can do is post this, and hope that the patent examiner in China will find it. Keywords: noise vertex lattice simplex image parameter novaquark range quadrangle quadrilateral non-local gradient matrix 我找不到该Web链接来提交针对中国专利申请的现有技术。 因此，我能做的最好的就是发布这篇文章，并希望中国的专利审查员能够找到它。 关键字：噪声，顶点，晶格，单纯形，图像，参数，novaquark，范围，四边形，非局部，梯度，矩阵 Note to others who read this: I have heard recommendations not to review unexpired patents without a lawyer present. Take from that what you will (not legal advice).
Last active Dec 6, 2019
Coherent noise algorithm based off of C2-continuous polynomial spline on a triangular grid.
View SimplexValueSplineNoise.java
 /* * SimplexValue Noise in Java. * by Kurt Spencer * * v1.0.1 * - Slight change to seed RNG * - Removed default permutation array in favor of * default seed. */
Created Oct 13, 2014
Coherent noise algorithm based on value-multiplied kernels on a triangular grid.
View SimplexValueNoise.java
 /* * SimplexValue Noise in Java. * by Kurt Spencer * * Public Domain */ public class SimplexValueNoise { private static final double SQUISH_CONSTANT = 0.366025403784439; //(Math.sqrt(2+1)-1)/2;