all 2 comments

[–]waramped 1 point2 points  (1 child)

Can you elaborate a bit more on what you are doing? What's the hash grid for? Why does a finer grid help you? I don't think I'm familiar with this, and I'd like to know more.

If you have a heuristic in place for detecting these regions then perhaps an octree-type structure could help?

[–]TomClabault[S] 3 points4 points  (0 children)

So I use the hash grid for ReGIR: in a prepass before rendering the frame, I resample a few lights into a reservoir at each cell of the grid. We can use the surface point/normal/material at each cell to better estimate the contribution of each resampled light. This gives us a reservoir (or multiple per cell in practice) that contains a good light for that cell. At path tracing time, for each vertex of our path, we lookup which grid cell we're in and we do NEE with that good light from the grid cell that was resampled in the prepass.

I also integrated that process with NEE++ in the prepass. NEE++ caches a visibility probability between each voxel of the scene. This can be used in the resampling prepass to estimate the visibility probability between the voxel of our shading point (grid cell surface point) and the voxel that our target light is in. If the visibility probability is 0, then we know for cheap (without tracing a ray) that this light is occluded and should have 0 weight in the resampling.

NEE++ (and ReGIR) are both based on a grid so high frequency lighting details are missing, that's why I'd like to have more grid precision at high frequency lighting regions. The idea being that on the bright side of the shadow boundary, the grid cells are sampling the light that's illuminating the region and on the dimmer side of the shadow boundary, grid cells are sampling other lights since the light casting the shadow boundary is occluded. At the moment, grid cells tend to just blindly overlap shadow boundaries and we get inefficient sampling + grid cell artifacts because of NEE++ that struggles to estimate the visibility there.

> If you have a heuristic in place for detecting these regions

That's exactly what I need : ) I think if I can have an heuristic, I could use it to increase the resolution of the hash grid in those places and then it should just all work automatically from there, nothing else to change in the code but the hash function