Virtual Texturing Feedback

I thought It would be nice to have such thread, as VT is on the horizon.

I wanted to mention that this is by far the most anticipated feature for me since release of UE4, and I was really happy to try it out. First impressions are very positive.

Did you mean, it’s being worked on and available on dev-rendering branch? :wink:

Same here, most anticipated feature for a long time for us.

But i’m still less knowledgeable about the pros and cons. Can you explain what the catch is regarding having nearly no limit on texture size?

1 - Does it come as an automated feature or do we need to tweak the shaders for each object that would have this feature on?

2 - If I have 8K textures on 100 static meshes, does this mean that it will still be performant even if you are looking at 100 meshes stretching to the horizon? does it have some Auto mip mapping on per texel basis?

The more the info the merrier.

Yep, it is.

I remember devs requesting this for years and years, I honestly had no hopes it would become a reality :s

The catch is it takes more material instructions to do the texture sample. Not much, but still a notable amount.

So by default (it can be changed) any 4k or 8k textures will be set as a virtual texture on import. For existing textures, it’s just a checkbox in the texture settings that you need to enable (classifies it as a new sampler type so you will need to change your materials a tiny bit, just flipping that option).

Virtual texturing means that you have an (almost) flat memory cost for your screen resolution. It loads only tiny pieces of textures as needed, and since your screen isn’t gaining any new pixels, in a perfectly ideal scene it will never need to load more than your exact screen resolution. Obviously, reality isn’t that convenient, but you get the idea. It’s only loading the pieces it needs, making it significantly more efficient than doing it any other way. It can also potentially (not sure if the current version does or not) even omit loading the backfaces of a mesh’s texture entirely.

So when you say you have a ton of 8k textures… unless you actually -need- that full resolution, that doesn’t actually matter. At a distance (meaning, enough resolution to match the screen pixels), there is no difference between a 1k and 8k texture.

https://github.com/EpicGames/UnrealEngine/commits/dev-rendering

It’s not only a reality, but really, really good right now. Virtual texturing is, as far as I can tell, completely working (minus a few raytracing features) and there is (some) support for procedural virtual texturing as well. Getting the latter set up right now is a little difficult without documentation, but Deathrey and I were able to get it working over the weekend. Did a test scene, projecting thousands of decals down onto a landscape and it runs incredibly well.

Very happy with it so far, the only omission I can find is, it would be nice to have support for PVTs for displacement use. Otherwise, a few bugs and crashes aside, it’s wonderful.

So what happens if you change the FOV level (think of aiming with weapons and such)? Does the system stream in sharper textures or does it look the same regardless of the FOV?

It is still early, but one lump of feedback that is brewing, is how Runtime Virtual Texture is arranged. It is currently hardcoded to a set of channels (Normals, Roughness, Height and what not).
Apparently, it would be quite handy to be able to arrange individual runtime virtual textures in arbitrary layout, selecting only from available texture formats.

I’ve been having issues compiling so haven’t been able to try it out myself yet. In it’s current state, can it accept higher than 8k textures or are we still liked to an 8k max? My main interest in Virtual Texturing is for photogrammetry.

Granite was a bit clunk but once it was working I was able to have multiple 16k textures on a single mesh (UDIM) and it looked amazing. Really hoping I can achieve the same results in base UE4!

Anything higher than 8k crashes on import for me right now. And there’s no direct UDIM support, but you can just do it manually with material instances.

1 - No need to tweak shaders eventually, but right now it’s dev only branch due to some seemingly hardcoded layout rules/etc.

2 - It should perform fine

The tradeoffs are your shipping game size can just balloon to infinity, and if you actually want textures that high res you’ll probably need to ship on new gen consoles (PS5 etc. Need to find a good term for them). Anyway it eats a ton of streaming bandwidth, which is one of the reasons Doom 2016 had fairly low res textures. You can fit whatever artist defined textures you want, you get unlimited baked decals and vertex painting and baked noise functions and etc. Go nuts.

But final bake is to the same texel density on everything, so those 8k textures on a pair of dice (true story from RAGE 1, the first virtual texturing game) will be baked down to a lower res. How low a res depends on what your shipping game runs on, IE how much disc space do you have and how fast can you stream in textures? Someone should really test the to disc texture compression, as that’s often been a limiting factor with the few games that have run virtualized texturing so far. If the compression is good enough you should be able to go fairly crazy with high resolution.

Thanks for the feedback on all this!

1 - I want to know how if it would function normally when say you are “drawing on canvas” using virtual texturing as a method, lets say you have a one piece imported geometry that represents the terrain from top view (flying game), you want an explosion to happen and leave a decal via drawing on vertex color on the ground (Since using Forward rendering i can’t use decals to leave damage here) will a method like this still work with virtual texturing for this object? Or would the workflow differ?

2 - Also regarding streaming bottlenecks i assume Epic would include analytics tools to test this?

Very interested in VT, just wanna try it out, found “runtime virtual texture plane” and “runtime virtual texture” and create resources for it, but how to get runtime virtual texture plane show something as a test?

Another question about virtual texture, will it work if I applied it on a 3d mesh, not terrain/decal? thanks,

Hi everyone, I’m the main owner of the core virtual texture system (not any of the runtime VT stuff). Thanks for all the feedback so far, I’m glad to hear people are excited about this. Everything posted look mostly accurate, I have a few additional notes.

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.

Basic UDIM support should already be there. If you import a texture named like this: “whatever_1001.tga”, the current directory will be scanned for additional UDIM pages, and they’ll all be imported together. UDIM textures used in material should automatically apply the proper UV scale, so UVs from source mesh should work as-is. This feature is still very early and hasn’t been tested very much…if someone tries it out, let me know how it works.

The cost of a VT sample in material is 2 texture samples plus a bit of ALU in the base case. There is an optimization, where if multiple VTs are sampled with the same UV expression, they will be combined into a “VT stack”. So really, each VT stack costs 1 texture sample, plus 1 additional texture sample for each VT in the stack. You can see the number of generated VT stacks in the material statistics window. So for example if a material samples 4 VT all with the same UVs, the total cost will be 5 texture samples (plus some ALU).

Hello, Could you elaborate more on the UDIM support i havent seen any info on virtual texturing but i have been trying to get UDIMs in for the longest tile and while granite is good it still limits what can be done where as directly manipulating the textures in engine

When importing an image into UE4, it will automatically detect if the image is part of a set of UDIM images, and if so, all the images will be imported into a single virtual texture asset. When sampling from this texture in a material, UVs are automatically scaled such that UDIM UVs imported into UE4 should just work.

So when is the initial release for VT? Really looking forward to this.

It’s available right now in the 4.23 branch from git hub :slight_smile: