-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vulkan: ReflectionProbe consumes far too much VRAM #64683
Comments
@lyuma looks like MRP link is broken |
A number like 2048 or 1024 feels like it should take 16 to 64 megabytes of whatever kind of RAM, not gigabytes. We need to measure this differently, or with an additional number in the setting mentioning VRAM size, i feel. |
So it looks like it is using about 1.2 GB's. The expected size of a 1024 reflection probe is: |
@arkology Uploaded the MRP again. Can I ask why there are 8 array layers allocated at a time? If this is really the case, I think it shows why compressed reflection probes are necessary. 512x512 reflection probes just don't cut it for some scenes, and I shouldn't have to pay 500MB to have a single 1024x1024 reflection probe. |
It matches the 8 roughness_layers which is the default amount in project settings. You need a layer for each different roughness level. This is what allows you to smoothly blend between 0 and 1 roughness. To use a mipmapped single texture instead of a texture array you can set texture-array-reflections to false. |
I think a satisfactory resolution to this issue would be for us to raise the quality of non-array reflections to the point that we could make it default. Non-array reflections are significantly faster to generate and take up much less space (one eighth as much by default), but the quality suffers |
@lyuma The Discord download link for the MRP is no longer working, as Discord prevented all old download links from working outside of Discord. Could you reupload the MRP somewhere else? |
there was a second github link hidden next to the discord one. I diffed them and can confirm they are the same so I removed the broken discord link to avoid confusion (it seems you can paste a dead discord link into a discord message, and the client will resolve it into a working link. that's how I re-gained access to it. it might have to be the same server, in this case V-Sekai) |
I can reproduce this on 4.3.beta1. I stepped through RenderDoc and didn't find anything obvious about accidentally duplicating the reflection atlas or something. Here's the system VRAM utilization difference1 with various settings and the default window size of 1152x648. This encapsules the entire project's VRAM utilization (the editor is not running in the background). Texture arrays are always enabled:
The same with 1x1 window size (to rule out any framebuffer VRAM usage based on viewport size):
The issue is in the Reflection Count project setting. It defaults to 64 to allow for 64 reflection probes to be drawn at a time. (Note that if you set it to If you decrease it to 1, VRAM usage is much more reasonable and in line with what I'd expect. If you use high-resolution reflection probes, you'll probably use fewer of them – especially in a racing game where you generally use a single probe for all cars centered around the player's. I guess we should document this caveat about reflection resolutions higher than the default: if you want lower VRAM utilization, you should decrease reflection count at the same time you're increasing resolution. PC specifications
Footnotes
|
Godot version
4.0.dev 11abffb + patches
System information
Windows 10, Vulkan Nvidia Rtx 2080 Ti
Issue description
I've been noticing extraordinarily huge VRAM usage when playing a test scene in my game, upwards of 5GB.
This issue is about Reflection Probes having an effect on memory usage. There's a sister issue #64677 about WorldEnvironment radiance size.
The test project I use has reflection size set to 1024. This causes half my VRAM to be consumed. Normally a 1024x1024x6 reflection probe should only take about 25MB or so.
Godot's default reflection size is 256, which is 16 times less VRAM, but even at 256, it is taking way more than it should be (you can still see a spike when toggling on the reflection probe).
Here is a screenshot of task manager
Steps to reproduce
Minimal reproduction project
reflectionprobe_vram.zip
The text was updated successfully, but these errors were encountered: