Lightmap popping with virtual texture lightmaps

Can someone tell me what is causing this weird lightmap popping after enabling “virtual texture lightmaps” ? Depending on my moves and camera angel, all lightmaps are moving and popping around all over the scene.

With popping and moving around, im talking about those dark spots “areas” which look the same like baking issues. Depending on the camera angel they change and switch all the time.

Virtual texturing is trying to optimize the textures that are used on screen so that it more closely matches the detail level that you need to see, so it could be that the lightmap texture is changing as you’re moving around and that those dark edges are due to bleeding from the lightmap around the edges of the lightmap UV’s, where the pixels of the lightmap aren’t lining up exactly with the UV’s.

1 Like

Thanks for the answer, those dark edges are not light bleeding problems… Screenshot one and two are the same scene, just the camera angel was changed a little bit. Those dark edges come and disappear depending on the camera angel and movement.

Is there a way to fix this popping and dark edges issues ? If i turn Virtual texture lightmaps off, everything looks just fine by the way “after a rebake”.

They are bleeding, look into what Virtual Texturing actually does because the textures you see on-screen are going to be changing depending on your camera. What you’re seeing there is that the resolution of the lightmaps are changing and the edges of the pixels of the lightmap are causing the dark edges there.

1 Like

ouh ok sorry my bad, i was thinking about “simple” lightmap bleeding, like when you have bad lightmaps UV’s or a bad mesh. Hmm so whats the solution ? Is there even a solution ?

1 Like

If it’s not loading enough textures to look good, you can try increasing the size of the texture pools, and making sure the LOD is marked as “important enough” for things near the camera.

hey, thanks for your answer. Sorry I’m not sure what you mean by “size of the texture pool” and "LOD is marked as important enough. Are we are talking about the general texture streaming pool, if so it’s far far from being reached… it’s like 500MB from 2000MB

There are also no LOD’s in the scene, if you are talking about LOD’s for my assets ?

Yes, the r.Streaming.PoolSize needs to be big enough.
You can also try turning off streaming (r.TextureStreaming 0)
Another good debug tool is r.Streaming.Boost – make it 2.0 and then 0.5 and compare to the 1.0 to see if it changes.

As for LODs, yes, make sure that the priority and LOD levels of all your assets are appropriate for your use. You may want to enable LOD visualization and see if there’s a noticeable seam close to the bad areas.

Of course this could be something totally different – just suggesting what’s been trouble for me before.

1 Like

The Problem is, my streaming pool is higher than what is used currently in my scenen and i’m not using LOD’s at all.

This problem comes exclusively with the virtual textures feature being enabled, if i turn virtual textures for lightmaps off, everything works just fine.

Does MIP map or LOD coloring in the viewport show you anything?
What other visualization tools have you tried?

Did you find a solution to the light maps popping in when turning around? I am having the same issue. The responses on this thread seem related to normal texture streaming, not Virtual texture streaming. There’s a lot of console commands that come up when you type r.VT, but I’m a bit lost from there. I assume its something to do with a pool size, or how long its keeping them in memory after they are off screen? Nothing I’ve tried has worked yet though.

Sadly all the suggestions haven’t helped, i had to turn off virtual texture streaming for lightmaps. I played a bit around with tweeking some values here and there but the result was always the same.

Maybe it’s a better question for answerhub ?

I actually just found a solution for this! On the documentation page for Runtime Virtual Texturing: Runtime Virtual Texturing | Unreal Engine Documentation there is this section:

Memory Pools

The Memory Pool Sizes for virtual texturing are set up in the BaseEngine.ini configuration file. The pools are set up per-texture format group and tile size. Configuration of the pool size is driven by specifying the maximum memory budget for your project. You’ll find these settings under the [/Script/Engine.VirtualTexturePoolConfig].

Here’s whats in that section in the file:
; Configure VT physical memory pools. Usefull commands to set these
; “stat virtualtexturing” show dynamic use of the VT system including the cache loads
; “r.VT.ListPhysicalPool” list in-depth details on the allocated physical pools
; The upper allocation limit for a pool is caluclated by matching a size and format from the list below or falling back to the default
+Pools=(SizeInMegabyte=64, MinTileSize=0, MaxTileSize=9999, Formats=(PF_DXT1, PF_DXT5))
+Pools=(SizeInMegabyte=512, MinTileSize=0, MaxTileSize=9999, Formats=(PF_A32B32G32R32F))

I copied this to my DefaultEngine.ini in the project files and change the two “64” values to 512. (which could be overkill and probably requires tuning)
Now the textures pop in once the first time they are on screen, but persist after that.

Having it store all the light maps in memory like this probably makes it no different to turning off Virtual textures, but at least this way you still get the real-time preview with GPU Lightmass.