Looooong / Unity-SRP-VXGI

Voxel-based Global Illumination using Unity Scriptable Render Pipeline
MIT License
766 stars 62 forks source link

Rework mipmap filtering algorithm #44

Closed Looooong closed 4 years ago

Looooong commented 4 years ago

Currently, the volume resolution of each mipmap texture is 2n+1. This ugly number was chosen because it was implemented using 3x3x3 Gaussian kernel.

image

image

However, I think that choosing 3x3x3 Gaussian kernel was a poor decision. I suspect that the 2n+1 resolution doesn't fit nicely on the GPU memory architecture, which may impact GPU read/write performance.

Instead, we can perform mipmap filtering using 4x4x4 Gaussian kernel on light texture with the resolution of 2n. Beside fitting nicely on GPU memory, we can also divide the compute shader thread groups equally. Voila!

image

image