Sign in to follow this  

Calculating smooth normals in a destructible voxel terrain?

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this