Giter VIP home page Giter VIP logo

dla_terraingeneration's Introduction

Terrain generation using Diffusion Limited Aggregation (DLA)

functionality

Diffusion Limited Aggregation

  1. generate random crisp image
  2. upscale crisp image
  3. create blurry copy of upscaled image
  4. add crisp version onto blurry image
  5. repeat on generated crisp and blurry image

random Aggregation

  1. place pixel in middle of matrix
  2. generate set amout of pixels:
    • place random pixel
    • move pixel util it touches another placed pixel

"crisp" upscaling

  1. keep track of which pixels got connected to which pixels
  2. upscale by redrawing connections on bigger image

add weights to each pixel

  1. assign each pixel different weight
    • outside pixels get value 1
    • weight of pixel = max weight of a pixel downstream + 1
    • to avoid peaks that are too high, use 1-1/(1+h)

linear interpolation (smooth upscaling)

  1. find equivalent position in original image
  2. find distance to 4 nearest pixels
  3. new pixel value = sum of near pixels, weighted by distance

convolution (blurring)

  1. create empty image of same size
  2. each pixel gets average of 4 sorrounding pixels

sum crisp and blurry image

  1. add crisp image onto blurry image
  2. keep crisp version for further dla steps
  3. blur blurry image further and upscale it

dla_terraingeneration's People

Contributors

teschl avatar

Stargazers

 avatar

Watchers

 avatar

dla_terraingeneration's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.