Skip to content

Work in progress voxel tracer. This is intended to be an offline solution for generating lighting/volumetrics.

Notifications You must be signed in to change notification settings

frostbone25/Unity-Voxel-Tracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity Voxel Tracer

Work in progress voxel tracer. This is intended to be an offline solution for generating scene lighting and volumetrics.

Features

  • Direct Lighting (Directional, Spot, Point, Area)
  • Multi-Bounce Lighting
  • Emissive Lighting
  • Environment Lighting
  • Volumetric Lighting

TODO / Notes / Ideas:

  • Geometry thickening to solve problems with light leakage (conservative rasterization perhaps?)
  • Improving scene albedo/emissive buffer capture by using the "Meta" pass rather than a replacement shader to support custom shaders.
  • Optimizing Scene Voxelization even further.
  • Would like to look into methods for potentially blurring and averaging results to improve quality. Something like a bilaterial blur that is "voxel aware" perhaps?

Screenshots

a1 Voxel Trace: Final Lighting

d Voxel Trace: Direct Lighting

e Voxel Trace: Single Bounce Environment Lighting.

b Voxel Trace: Scene Albedo Buffer

c Voxel Trace: Scene Normals Buffer

g Voxel Trace: Emissive Lighting

h Voxel Trace: Scene Emissive Buffer

i Voxel Trace: Volumetric Emissive Lighting.

j Voxel Trace: Final Volumetric Lighting.

l Voxel Trace: Volumetric Direct Lighting Only.

m Voxel Trace: Volumetric Bounced Lighting Only.

k Voxel Trace: Volumetric Environment Lighting Only.

Why?

This tool came about with the need to make the Baked Volumetrics effect no longer dependent on sampling from light probes in a scene. So building a voxel-based raytracer was necessary, and here we are. The raytracer is implemented all with Compute Shaders (NO RAYTRACING HARDWARE UTILIZED), so as long as the hardware supports compute shaders (most hardware now does) it should work on any GPU regardless of vendor which is the goal. It's worth noting that this tool serves as a foundation for potentially more things to come in the future (Real-time Voxel Based GI, Voxel Based Specular Reflections, Voxel Lightmaps, Scene To Voxel Mesh, etc.)

Sources / References / Credits