advanced

#30 FBM Terrain

Raymarched terrain with FBM heightmap

Generate terrain by using FBM noise as a heightmap. The raymarcher steps along the ray and checks if p.y < fbm(p.xz) to detect the ground. Use smaller steps near the surface for precision. Compute the normal from the FBM gradient for lighting, and add fog for depth. Coloring by height and slope creates grass, rock, and snow zones.

Key Concepts

Try this shader live in the Shader Sandbox editor with real-time preview.
Open in Sandbox

Source Code


    
← Previous 3D Domain Repetition

All Tutorials