godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.43k stars 20.24k forks source link

Vulkan: VoxelGI VRAM size estimation is inaccurate #55641

Open Calinou opened 2 years ago

Calinou commented 2 years ago

Godot version

4.0.dev (2a9dd654b)

System information

Fedora 34, GeForce GTX 1080 (NVIDIA 470.74)

Issue description

VoxelGI VRAM size estimation in the editor appears to be too conservative. Actual VRAM usage seems much higher.

In the testing project linked below, these are the VRAM size deltas I measured from my system:

Mode Estimated Actual Estimated → Actual factor
No VoxelGI N/A 0 MB N/A
VoxelGI Subdiv 64 0.25 MB 5 MB 20 times larger
VoxelGI Subdiv 128 2 MB 260 MB 130 times larger
VoxelGI Subdiv 256 16 MB 510 MB ~31.88 times larger
VoxelGI Subdiv 512 128 MB 2260 MB ~17.66 times larger

The delta is measured from the "No GI" VRAM size mentioned in the absolute VRAM usage values below:

GPU has 8192 MB of VRAM.

Engine not running: 750 MB
No GI: 970 MB
64 subdiv: 975 MB
128 subdivisions: 1230 MB
256 subdivisions: 1480 MB
512 subdivisions: 3230 MB

Antialiasing and other effects were disabled, and the project is running at the default window size of 1024×600. All other setting were left to their default values.

It seems there is no singular amplification value that would be reliable in all cases. From the above testing, we can conclude that the average amplification factor across all subdivision sizes is 50. However, the testing project uses mostly horizontal VoxelGI extents, which means the Y axis has 4 times less voxels than in a VoxelGI with fully cubic extents (Y axis as tall as others). This can likely influence the amplification factor.

Steps to reproduce

Minimal reproduction project

test_voxelgi_large.zip

KoBeWi commented 2 years ago

Is this still valid in newest alpha?

Calinou commented 2 years ago

Is this still valid in newest alpha?

Yes (tested on 4.0.alpha 184709427). The amplification factor seems similar, and is pretty much always greater than 16 (even when vertical extents are identical to horizontal extents).