This project is a proof-of-concept for GPU driven terrain system made for Unity engine. This is NOT a production ready package, just a demo project.
Supports Unity 2022.3, built-in render pipeline.
- Adaptive Virtual Texturing
- Uses job system for multithreaded feedback analysis & page update
- Cache textures are BC1 compressed
- GPU driven LOD selection
- LOD is controlled by pixel-error metric similar to built-in Unity terrain
- Stitches vertices between terrain patches (stitching between terrain tiles coming later)
- GPU driven LOD quad-tree generation as well
- 6ms to recompute 2049x2049 terrain LOD tree
- GPU driven cross-terrain tile painting, doesn't rely on CPU readback
- Painting remains responsive no matter the brush size
- Simple Undo/Redo system for render textures integrated with Unity editor
- Splat mapping using texture arrays
- 1 draw call instead of multi-pass
- Supports blending based on heightmap
- Includes tools that combines multiple textures into Tex2DArray on import with limited auto-reformat functionality
- Triplanar mapping
- Terrain works with scene picking (no outline though)
Anyway if you want to poke at it, go to TestScene.unity
.
For render loop implementation check PhotoTerrainBuiltInCamera
code.
- Shadows suck!
- Terrain isn't visible when viewing scene in wireframe or looking at camera preview in scene window
- AMD GPUs might act funny with virtual texture. I think I fixed it, but it may still be there
- When using brush, first stroke might randomly produce incorrect result
- When using brushes, use alt+lmb and move mouse up/down to change opacity, left/right to change size. Alt + scroll will rotate the brush.
- If you modify material palette and want to make a build, use context menu -> "Create Texture Array" on palette asset. Texture arrays can't be created at runtime
- 'Betsy' GPU compressor
- meshoptimizer
- LightProbeUtility by keijiro
- Unity's Terrain Tools (Icons)
- Terrain Sample Asset Pack (Terrain textures)
- GPUDrivenTerrainLearn
- Terrain Rendering in Far Cry 5
- Landscape creation and rendering in REDengine 3
- Boots on the Ground: The Terrain of Call of Duty
- Large Scale Terrain Rendering in Call of Duty
- J.M.P. van Waveren - Software Virtual Textures
- Adaptive Virtual Texture Rendering in Far Cry 4
- Virtual Texturing - Andreas Neu
- Normal Mapping for a Triplanar Shader - Ben Golus