Something is certainly wrong with VT and landscape, but I can not figure out, what exactly. Here is the comparison image. On the left, I use large 16384x16384 texture; On the right, same texture, bus stream from 2048x2048 chunks (using fix supplied above to fix Y rotation); Now, on the left, single 16384 texture is applied normaly. On the right, one stream as chunks, is applied with some odd offset.
Thanks for the answers here! Any chance you could briefly describe how cache eviction policy works? Does VT unload tiles after some time? For example, when we donāt need specific texture mips anymore? Is it implemented at all?
UPD: After some investigation I ended up thinking that cache eviction is implicit i.e. we just reusing parts of textures (allocated in FVirtualTexturePhysicalSpace).How true is that?
I skimmed through the Issues and I would like to get some more info on couple of things Iāve selected. To understand my usage case, we are doing in engine cinematics, using tons of high-res textures (mostly 8K) and we donāt care too much about running on high fps, as we are focused on the final render.
-
First a broader question, looking at our use case, is VT something we should definitely consider or are we fine not switching to it?
-
Iāve heard that UDIMās were fixed for FBX, what about Alembics?
-
Ben Said
"Virtual textures are not currently supported in ray-traced shaders "
So we cannot use raytracing, if we use VT Textures?
- Ben Mentioned:
"In general switching textures to VT will save memory, but increase the cost of materials. However since VT enables much higher texture resolutions to be used, materials can often beā¦ "
Is this about being able to import higher resolution textures or did I miss something?
- Ben said:
āLarger than 8k textures should import correctly, but UE4 texture import code currently keeps everything in working memory, so large textures will eat a ton of ram. Iām not sure if this will be addressed for the initial release, but weāll see.ā
Is this still an issue, we have tonās of large textures (90%are 8K)
Thanks a lot for helping out here!
Iām using virtual texturing (VT texture streaming objects, not udim or the landscape VT one)
with ray tracing, sometimes i have to turn off raytracing with switching to DX11 in order to work without crashing, then just turn on dx12 when i want to light with raytracing
Iām using 4.25.1 and my landscape textures are super blurry when using RVT. I even shrunk the volume down to 200x200x200 and it still is really blurry. What can I do to fix this?
Hi, there is an issue with tiles not streamed for a material on a mesh that is occluded by a mesh that has a translucent material with VT textures. It seems like a translucent material with VT is effectively occluding any VT that is behind. This issue does not occur when using regular textures on a translucent material.
Your textures are probably set as Virtual Textures. Right click and convert them to normal textures.
I am using tiled landscape (with World Composition), and I am trying to use VT. It worked great with one, āsolidā landscape, but 8129x8129 landscape is never a good idea, so I switched to tiled landscape. The problem is that when my terrain tiles are not loaded in the editor, landscape in game is just black. When I load them - the textures are correct in game, but when I unload them again, terrain in game is black again. Whatās going on with it? Thanks!
Edit: I have noticed that when I build my game while all tiles are loaded, it actually works. But only for landscape, and not for landscape LOD meshes (my LOD meshes are using the same material and virtual texture as landscape). Those LODās are just black. At least it is a progressā¦
@Actuss Read my work around a few posts above. each tile needs itās own material with itās own VT reference.
i can confirm that the āruntime virtual texture sample parameterā does not take the instance linked RVT. it always renders the RVT that is set inside the āvirtual texture sample parameterā-node. this is a pretty big dealbreaker for my project since i use a quite complex landscape shader and many, many worldcomposition sublevels.
is epic aware of this issue?
I reported it, but due to the pandemic I have yet to hear anything about it.
Hello,
WorldHeight is said to be storing data in 16Bit but it doesnāt.
Iām using world position B channel to create a gradient on the landscape along Z axis and storing that into WorldHeight, when I sample from it, itās 8Bit. Step like artifacts are quite obvious.
Have you been aware of this?
To everyone having a problem with runtime virtual textures on tiled landscapes in PIE:
I discovered that the Runtime Virtual Texture Component (which is the component attached to a Runtime Virtual Texture Volume) has an incorrect decorator on the RuntimeVirtualTexture property. It is set to DuplicateTransient, instead of NonPIEDuplicateTransient.
When you press play in the editor, all scenes currently open are copied to a PIE version, so that moving things around in the scene isnāt permanent. Unfortunately, due to the DuplicateTransient decorator on the aforementioned property, this will reset that field in the PIE version of all scenes that were open when you pressed play, and all scenes that are streamed in during PIE will have no bounds to assign from.
Changing the above decorator will fix this issue, and I have submitted a pull request for it.
A couple of workarounds that I can think of now:
(Note: i have not tested any of these workarounds, as i simply fixed the decorator in my own custom version of 4.25 )
-
Have your perisistent level be an empty level that loads a sublevel via blueprint which contains the Runtime Virtual Texture Volume in it, and that sublevel contains all of your world composition tiles as sublevels, and make sure that this sublevel is not open in the editor when you press play.
-
Reassign the runtime virtual texture componentās VirtualTexture property after the level containing it loads. This looks like it will need manually calling some code present in the RuntimeVirtualTextureās PostEditChangeProperty, in the actor whose job it is to reassign the property on load:
#if WITH_EDITOR //the notify functions are only available in the editor, which is ensured if you are in PIE anyway, where the bug happens.
runtimeVirtualTextureComponent->VirtualTexture = runtimeVirtualTexture;
RuntimeVirtualTexture::NotifyComponents(runtimeVirtualTexture);
RuntimeVirtualTexture::NotifyPrimitives(runtimeVirtualTexture);
#endif
I hope this helps
> Does VT unload tiles after some time? For example, when we donāt need specific texture mips anymore? Is it implemented at all?
VT tiles are stored in a fixed size cache. Once the cache fills up, tiles are evicted using a simple LRU scheme to make room for new tiles.
> Iāve heard that UDIMās were fixed for FBX, what about Alembics?
The latest UDIM fix should work for all mesh import formats.
> So we cannot use raytracing, if we use VT Textures?
Raytracing shaders wonāt update the VT feedback buffer. So I think itās possible for ray-tracing passes to sample from VT, but they wonāt cause higher resolution tiles to stream in. This might be OK if youāre using RT reflections combined with normal rasterization for other rendering (since the raster passes will trigger VT feedback). You may end up with low-res VT for reflected objects that are not present in the base pass though.
> Is this about being able to import higher resolution textures or did I miss something?
Right, I was making the point that if you have higher resolution textures, you may not need as many texture layers inside your material. Separate tiling detail textures may not be needed for example, since you can just bake the detail into the main (virtual) texture if resolution is high enough.
> Is this still an issue, we have tonās of large textures
Texture import code should all be properly using 64bit sizes now, but everything is still kept in memory. So large VTs are possible if you have lots of ram. 8k textures should not be a problem.
> Hi, there is an issue with tiles not streamed for a material on a mesh that is occluded by a mesh that has a translucent material with VT textures
Yeah there have been a few bugs related to this. I think Iāve fixed them all, but Iām not sure if all the fixes have made it into the 4.25.x stream yet.
Thank you for all the answers!
I have another problem with RVT. When I open my project, some of the textureās mip maps are black. When I move my runtime virtual texture volume actor, or change it in some way, it usually goes back to normal, but not allways or not everywhere. Interesting thing is that the my roads that are also baked onto the same RVT works fine. When I move my camera around, it seems to finally bake. Also. I have noticed that when I have this RVT on, it causes hitches during the game.
I see some people telling theyāre using RVT with tiled landscapes, can someone explain their setup please?
You might loose your mind currently. Each tile needs its own material. Each material needs to specify the rtvt. Each tile needs to render to the correct rtv.
It works, but on anything large enough to require world composition it is a massive amount of work and needless files.
if/when they patch the instances to accept interchangeable rtvs, then the process would be a little easier. Create an instance for each tile and set it up on the tile itself.
Ok, thatās what I thought, each tile would need its own RVT. Yes, that would be a lot of work for 1000+ tiles (Iām just reminding that Novigrad map of The Witcher 3 is made of 2116 tiles :rolleyes: )
We should be able to use only one RVT on the main landscape actor but then we go back to this point and thereās no more news about this :
2116 tiles equals 2116 impostor/lod drawcalls. Thats a lot of wasted calls.
performance would be better with something closer to 8km tiles. Less tiles, less draw calls.