You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Layered portraits load all it's variants into memory causing a huge spike in vram when one is displayed
Describe the bug
To display a layered portrait, Dialogic uses a scene that contains all the layers as children. The issue is that when this scene is loaded, every child is loaded into memory, even if it’s not used. Since textures are stored uncompressed in VRAM (by default), showing a default idle character causes VRAM usage to spike by about 500 MB (all the elements in our portraits are 1800x2500 for easy layering). This means that having two of these layered characters on screen uses roughly a gigabyte of VRAM just for portraits, which is unacceptable. This also causes a huge lag spike for people running on low end devices, especially people using integrated graphics which have notoriously low video memory, this might be related to #2354
To Reproduce
Steps to reproduce the behavior:
Create a layered character with different options.
Display one of the options.
In the Godot editor while the game is running go to Debugger > Video Ram.
Observe that all the options are loaded into memory, bloating it.
Expected behavior
If the neutral emotion is displayed only the elements needed to display that neutral emotion should be loaded into memory
Screenshots
Screenshot from the Video Ram section inside Godot, only her neutral expression is used but the rest are loaded anyways
System (please complete the following information):
OS: Windows
Godot Version: 4.3 Stable
Dialogic Version: 2.0 Alpha 15
Solutions
Workaround
Enabling vram compression for the assets does reduce the vram usage and mitigates the slow down when a character is displayed on screen but it also reduces the quality of the images which is not acceptable.
Possible fixes
Due to the whole "loading a scene also loads all it's children and textures" being behavior that comes with Godot this issue might not be easy to tackle, one solution I have in mind would be to store the layer information inside the dialogic character and then have Dialogic add the children for the screen of the portrait as different emotions/options are requested while freeing the old ones (instead of just hiding them, which still keeps them in memory)
The text was updated successfully, but these errors were encountered:
Layered portraits load all it's variants into memory causing a huge spike in vram when one is displayed
Describe the bug
To display a layered portrait, Dialogic uses a scene that contains all the layers as children. The issue is that when this scene is loaded, every child is loaded into memory, even if it’s not used. Since textures are stored uncompressed in VRAM (by default), showing a default idle character causes VRAM usage to spike by about 500 MB (all the elements in our portraits are 1800x2500 for easy layering). This means that having two of these layered characters on screen uses roughly a gigabyte of VRAM just for portraits, which is unacceptable. This also causes a huge lag spike for people running on low end devices, especially people using integrated graphics which have notoriously low video memory, this might be related to #2354
To Reproduce
Steps to reproduce the behavior:
Expected behavior
If the neutral emotion is displayed only the elements needed to display that neutral emotion should be loaded into memory
Screenshots
Screenshot from the Video Ram section inside Godot, only her neutral expression is used but the rest are loaded anyways
System (please complete the following information):
Solutions
Workaround
Enabling vram compression for the assets does reduce the vram usage and mitigates the slow down when a character is displayed on screen but it also reduces the quality of the images which is not acceptable.
Possible fixes
Due to the whole "loading a scene also loads all it's children and textures" being behavior that comes with Godot this issue might not be easy to tackle, one solution I have in mind would be to store the layer information inside the dialogic character and then have Dialogic add the children for the screen of the portrait as different emotions/options are requested while freeing the old ones (instead of just hiding them, which still keeps them in memory)
The text was updated successfully, but these errors were encountered: