Jump to content
  • Advertisement
Sign in to follow this  

Calculating smooth normals in a destructible voxel terrain?

This topic is 722 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm building a voxel engine for a destructible chunked (split into same-sized rectangular blocks) voxel terrain.

Previously, I've written a simple voxel engine based on Dual Contouring, but it requires crack patching/stitching (even between chunks with the same LoD/resolution) which is messy and slows down processing.


I'd like to avoid having to deal with that crap by using conformal tetrahedral meshes which require no crack patching at all

(see Longest Edge Bisection, BDAM, Hierarchy of Right Triangles, Diamonds/TetraPuzzles),

e.g. as written in "Real-Time Isosurface Extraction With View-Dependent Level of Detail and Applications" [2015] and "Level of Detail for Real-Time Volumetric Terrain Rendering" [2013].


But calculation of "continuous" normals (to avoid "sharp" lighting artifacts on chunk boundaries) completely ruins the "chunk independence" idea,

because for each boundary vertex I need to know all the triangles sharing this vertex, including the triangles from adjacent chunks.


Is there a way to calculate smooth normals across chunk borders without touching adjacent chunks?


(If the terrain is static, the normals can be precalculated. If the terrain is procedurally generated, the normals can be plausibly estimated.)


Share this post

Link to post
Share on other sites

There is no way to produce smooth normals across chunk borders without some knowledge of the voxels in the surrounding chunks.


Common solutions are to have adjacent chunks share the edge voxels between them, or to duplicate the edge voxels in adjacent chunks (doesn't really work with user-editable terrain, for obvious reasons).


More interesting solutions involve getting rid of the notion of chunks for voxel storage - you can still use chunks for mesh extraction and rendering, but store all the voxel data in a single sparse data structure, so that querying neighboring voxels is not expensive.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!