Skip to content
This repository has been archived by the owner. It is now read-only.
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

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

About

Midpoint displacement algorithm

Resources

License

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.