Canvas Cache Streaming

Since there’s an on-disk canvas cache, could it in theory be possible to implement some kind of process of generating mipmaps for said canvases in the background and hooking them up to the texture streaming system? (Perhaps in another thread or with the GPU, and/or gradually over time to prevent hitching)

I’m just trying to think of ways to make it so that lots of canvases don’t devour your VRAM like a fat boy in a golden corral when they’re not in view. (Often causing the entire map to turn blurry, unless you turn texture streaming off entirely, which is bad for obvious reasons.)

If possible, a similar thing for workshop models would be great too, especially considering there’s a lot of models with ridiculous texture resolutions.

Can any devs perhaps comment on the feasibility of something like this? (Fingers crossed)

Here’s a couple posts on the discord server from devs about it:
image
image

2 Likes

Hmm, wonder if when being cached, some processing can be done to pad them up to the nearest power of two (rounding up) before storing? Also, I thought modern GPUs allowed for non-power-of-two textures and mipmaps already. Guessing more of a UE4 limitation?

Gosh, at least having only canvases in some radius loading for you would already improve the disaster happening when joining a condo with hundreds, if not thousands of them

Everything I’m reading so far about UE4 seems to indicate padding up (never down lest you want to kill quality, though this could be useful as an option for those with extremely low VRAM) to the nearest power of two is probably the best route to take here. It would allow the engine to generate the appropriate mipmaps. Dunno however, which would look cleaner: Padding with full alpha, or using the color/alpha of the edges. Probably the latter.

Not to be a pain in the ass, but SOMETHING needs to be done about the VRAM consumption. I have only around 100mb of Canvas data, I have 8gb of VRAM (with INI tweaks to make sure the game actually uses most of it, otherwise it gets blurry even sooner), and textures are set to Ultra, but I get this:

How the fuck is this even considered acceptable?

that can be fixed by putting -notexturestreaming in your launch options on steam

It helps, but unfortunately it has major problems of it’s own, like poor stability, and potentially thrashing your page file if the memory usage ends up being absolutely insane.

Unfortunately we cannot generate mipmaps in real time and canvases are real time.

No passive process that could be done to the cache after the fact? (Load the image from the website, cache it, then do some form of padding to nearest power of two on another thread, saving it back to the cache, then using that? Or if that can’t be done, what about a way to do this manually, or an option to automatically do this process during load screens?)

Not without significant changes to the engine, and on top of that we can’t use any of the editor code (that has mipmap generation in it) as it’s a closed source license (unlike the engine itself).

2 Likes

It would be pretty dope if canvases (and possibly workshops items), or even all the furniture could load during the load screen

Upon further inspection, it looks like UE4 allows you to set a texture’s mips in realtime via pointers to raw pixel data, but you’re going to need to generate said data yourself. If you have a reasonable level of knowledge of C++, this isn’t too terrible of a task. Mind you, you’re going to be limited to powers of two still. (Even that is better than nothing. Honestly hate that UE4 has this limitation, I’ve worked with ancient (by today’s standards) game engines that handle NPOT mipmapped textures without issue.)

There’s some useful information here: No mipmap support for Dynamic Texture 2D - UE4 AnswerHub

Hope this helps to some degree. My UE4 knowledge is extremely limited (not a fan of it, so I moved on after experimenting with it a little), but I do have some amount of experience with writing my own renderer (specifically an OpenGL renderer for a source port of Hellbender), so I’ve had to deal with loading and converting texture data, procedural generation of textures in realtime, among other things, so if there’s anything about that particular aspect that I can shed a light on, feel free to ask.