Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Wave Function Collapse Algorithm - Overlapping Model Implementation in JavaScript

Coding Train via YouTube

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn to implement the overlapping model of the Wave Function Collapse algorithm for procedural image generation in this comprehensive JavaScript coding tutorial. Master the process of extracting tiles from source images, calculating adjacency rules, implementing entropy reduction, and handling pixel color overlaps using p5.js. Follow along with step-by-step instructions that cover creating a Cell class, debugging tile adjacencies, optimizing performance, and managing tile rotations and reflections. Explore practical solutions for common challenges like redundant tiles, entropy reduction, and performance optimization while building a functional procedural generation system. Access complete source code, references, and additional resources to deepen your understanding of this powerful algorithmic approach to creative coding.

Syllabus

Introduction
The Nature of Code book!
WFC Resources and References
Extracting tiles from a source image
Calculating adjacency rules for tiles
Checking for overlapping pixel colors
Debugging tile adjacencies
Creating a Cell class
Incorporate code from WFC tile model
Reduce entropy of neighboring tiles
Rendering the center pixel for each tile
Cross checking valid tile options
Recursive entropy reduction
Limit recursion depth
Challenge complete?
Bugs found between Day 1 and Day 2
Starting Day 2
Correcting pixel color if statement
Refactoring redundant code
Running out of tile options
Optimizing the code
Rendering average pixel color of remaining tile options
How to handle redundant tiles?
More tiles with rotations and reflections
Additional performance optimizations
Thanks for watching!

Taught by

The Coding Train

Reviews

Start your review of Wave Function Collapse Algorithm - Overlapping Model Implementation in JavaScript

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.