Skip to content

Commit

Permalink
Added documentation and production fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinleguillou committed Jan 10, 2021
1 parent 7e3a710 commit c946781
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 702 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
![A cityscape generated using the Displacement Cities project](https://github.com/kevinleguillou/displacement-cities/blob/develop/dist/header.jpg)

# Displacement Cities

Generating a cityscape from a 2D noise pattern.

## Generating the city mesh by interpreting the pattern as a heightmap
Inspired by [/u/ckinggfx on /r/Blender](https://www.reddit.com/r/blender/comments/k05280/sprawling_city_from_a_single_plane/).

## Generating the city mesh by interpreting a noise pattern as a heightmap

We create simple plane with subdivisions higher or equal to the noise pattern width in pixels.
We create simple plane with subdivisions higher or equal to the [noise pattern](https://github.com/kevinleguillou/displacement-cities/blob/develop/assets/noise.png) width in pixels.

## Apply a patchwork texture of city buildings

The main issue here is to correctly project the texture on the displaced geometry, since the regular UVs would just stretch the texture. We define a specific projection in the fragment shader that assumes a side projection.
The main issue here is to correctly project [the texture](https://github.com/kevinleguillou/displacement-cities/blob/develop/assets/skyscrappers.jpg) on the displaced geometry, since the regular UVs would just stretch the texture. We define a specific projection in the [fragment shader](https://github.com/kevinleguillou/displacement-cities/blob/develop/src/DisplacementCity/DisplacementCity.frag) that assumes a side projection.
699 changes: 1 addition & 698 deletions dist/bundle.js

Large diffs are not rendered by default.

Binary file added dist/header.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require('path');

module.exports = {
mode: "development",
mode: "production",
entry: './src/index.js',
resolve: {
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
Expand Down

0 comments on commit c946781

Please sign in to comment.