Skip to content

Conversation

@Robert-K
Copy link

@Robert-K Robert-K commented Nov 7, 2025

Closes #62930

Before:

editor_screenshot_2025-11-07T192310

After:

editor_screenshot_2025-11-07T222631

What was the problem?

The GPU receives the VoxelGI transform in cell space for quicker tracing.
The bounds need to be in cell space, too, so the octree_size was passed.
That's incorrect, since for non-uniform bounds, it doesn't match the actual bounds in cell space.

Instead, we scale the bounds using the basis of the to_cell transform and pass that.
We still have to map back to world units, hence we need to pass the octree_size as well (one could also pass the cell size (1.0/octree_size) instead for further optimization)...
Conveniently, a vec3 already existed as padding in the VoxelGIData struct passed to the GPU, so I just turned that into the octree_size.

@Robert-K Robert-K requested a review from a team as a code owner November 7, 2025 21:37
@fire fire changed the title Fix: VoxelGI rendering outside of non-uniform bounds VoxelGI rendering outside of non-uniform bounds Nov 8, 2025
@fire fire changed the title VoxelGI rendering outside of non-uniform bounds VoxelGI fixed rendering outside of non-uniform bounds Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vulkan: VoxelGI displays outside the extents when its extents are not uniform

1 participant