3 ms·
this is a pretty faithful reproduction. I like it! a lot of solid pointers to great algorithms in here. - perlin noise: https://en.wikipedia.org/wiki/Perlin_no
by swyx 9y ago
this is a pretty faithful reproduction. I like it! a lot of solid pointers to great algorithms in here.
- perlin noise: https://en.wikipedia.org/wiki/Perlin_noise https://en.wikipedia.org/wiki/Perlin_noise for generating terrain bumps
- flood fill for painting terrain on top of noise : http://lodev.org/cgtutor/floodfill.html#Scanline_Floodfill_Algorithm_With_Stack http://lodev.org/cgtutor/floodfill.html#Scanline_Floodfill_A...
- convolutions with webgl shaders https://github.com/phoboslab/WebGLImageFilter https://github.com/phoboslab/WebGLImageFilter
- dilation filter
- "closing" in image processing https://en.wikipedia.org/wiki/Closing_(morphology) https://en.wikipedia.org/wiki/Closing_(morphology)
- deciding in the hqx algorithm for anti aliasing https://en.wikipedia.org/wiki/Hqx https://en.wikipedia.org/wiki/Hqx
- texturing
- halton sequences for even distribution of worms https://en.wikipedia.org/wiki/Halton_sequence https://en.wikipedia.org/wiki/Halton_sequence
- sine wave for water
all done in the browser.
github repo at https://github.com/juliango202/TerrainVer https://github.com/juliango202/TerrainVer