Skip to content

Prototype project for a custom terrain system in Unity engine

License

Notifications You must be signed in to change notification settings

SanielX/Hollow-TerrainSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hollow;TerrainSystem (Prototype)

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.

Features

  • 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.

Known Issues

  • 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

Notes

  • 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

3rd party

References

About

Prototype project for a custom terrain system in Unity engine

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published