About this project
# WaveFunctionCollapse
This program generates bitmaps that are locally similar to the input bitmap. Local similarity means that the output contains only those NxN patterns of pixels present in the input, and the distribution of patterns in the output is similar to that in the input. The algorithm initializes the output in a superposition of possible states, then iteratively observes regions with the lowest Shannon entropy and propagates constraints, eventually collapsing to a definite state. It may encounter contradictions, which is NP-hard to avoid, but in practice this is rare.
The repository includes the core algorithm, examples, and documentation. It supports both overlapping and simple tiled models, with options for symmetry, constraints, and higher dimensions. The code is a console application written in C# using .NET Core, with no external dependencies. It can be built with `dotnet run` or `dotnet publish`. The project has inspired numerous ports to other languages (C++, Python, Rust, JavaScript, etc.) and adaptations to game engines like Unity, Unreal Engine, and Godot. It has been used in commercial games such as Bad North, Caves of Qud, and Townscaper, and has led to academic research. The README also discusses related algorithms like ConvChain and texture synthesis, and provides a detailed algorithm description and references to prior work.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.