Renders real-time shadows on a landscape of Perlin noise
Find a file
Michael Bradley 9a7969b63a
Some checks failed
Build / Format (push) Successful in 20s
Build / Lint (push) Failing after 1m35s
Build / Build (push) Failing after 33s
Incorporate clangd recommendations
2025-02-28 20:46:42 -05:00
.forgejo/workflows Fix typo in CMake cache 2025-02-23 13:25:38 -05:00
img [ImgBot] Optimize images 2024-04-01 21:57:53 +00:00
src Incorporate clangd recommendations 2025-02-28 20:46:42 -05:00
.clang-format Make sun rotate around geography 2024-03-31 15:48:04 -04:00
.clang-tidy Add clang tools configuration files and format 2024-03-04 02:43:29 -05:00
.gitignore Ignore clangd cache 2025-02-28 17:14:36 -05:00
CMakeLists.txt Update standard to C++23 2025-02-28 19:02:14 -05:00
README.md Embed shaders directly into executable 2025-01-01 20:50:30 +13:00
TODO.md Move TODOs to separate file 2024-04-06 02:40:54 -04:00

Real-time Shadow Simulator

Generates several tiles of grids containing Perlin noise, and then renders them with shadows.

Control

Sample from console output:

Mouse control:
	Click and drag to rotate camera

Keyboard control (case-insensitive):
	x, q, [ESC]: Quit program
	r: Regenerate terrain

	wasd: Move forward/left/backward/right relative to the camera
	cz: Move up/down relative to the world

	k: Toggle point light following camera
	l: Toggle phong light simulation
	m: Toggle shadows
	n: Toggle ground/normal colour
	p: Toggle day/night cycle

Example Outputs

Sunset

This image shows a "sunset". Contains 4x4 tiles each containing (1<<9)^2 points, for a total of 4,194,304 vertices. Shadows update in real-time with sun position.

Detailed heightmap resembling a mountain range is lit softly from the side.

Stress Test

Putting as many vertices as we can on the shader. Contains 32x64 tiles each containing (1<<8)^2 points for a total of 134,217,728 vertices. Renders at several frames per second on a 6950XT and uses roughly 7.7GiB of VRAM.

Large heightmap from far away, looking almost like an ocean.