This repository has been archived by the owner. It is now read-only.

weekly_16

Midpoint displacement algorithm

Midpoint Displacement

Weekly Programming Challenge #16

TODO

  • Fix dependencies on local shard versions (raytracer / hacky_isometric / linalg)

Usage

shards install
crystal run --release hard6.cr

Dependencies

Normal mode (1, 2, 3)

Animated gif of the midpoint displacement algorithm

Hard mode (1)

Animated gif of the midpoint displacement algorithm

Hard mode (2)

Animated gif of the midpoint displacement algorithm

Hard mode (3)

TODO

Hard mode (4)

TODO

Hard mode (5)

Already implemented

Hard mode (6)

It seems like finding parameters that produce a nice image is harder than implementing the algorithm

Raytraced terrain generated with the diamond-square algorithm

Phong shading looks much better, but sadly the raytracer is not efficient enough to render images where the exponent is higher...

Raytraced terrain generated with the diamond-square algorithm

Maybe some hacky water will do the trick

Raytraced terrain generated with the diamond-square algorithm

It turned out that my implementation of the roughness parameter was not optimal, here are some images generated with the fixed version (using 0.2, 0.5 and 0.8 as roughness)

Raytraced terrain generated with the diamond-square algorithm Raytraced terrain generated with the diamond-square algorithm Raytraced terrain generated with the diamond-square algorithm

BONUS: A blocky isometric rendering of the terrain

Raytraced terrain generated with the diamond-square algorithm

Repository

weekly_16

Owner
Statistic
  • 2
  • 0
  • 0
  • 0
  • 3
  • about 5 years ago
  • November 13, 2016
License

MIT License

Links
Synced at

Thu, 07 Nov 2024 03:09:18 GMT

Languages