Page 2 of 2

Re: Virtual Textures are broken in the latest version

Posted: Sat Jul 01, 2017 5:07 pm
by Ricardo Teixeira
Hello,

Thank you for the additional information, we would be happy to help.
currently there is only one virtual texture. I haven't tried forced update, but I will try that and let you know if it helped. I am not sure about how to get that sample to you because, the project is huge (~100GB). If the force material update won't be successful I will try to make a lightweight version with necessary minimum.
Looking forward to your feedback or a sample project.
If you don't mind I have few questions which are not related to this problem. Do you have any plans/ETA for dx12 or vulkan support? Unity's Vulkan implementation is quite unstable right now, but dx12 runs well in the latest unity versions.
It will be available at a later stage, unfortunately we don't have an exact estimate.
We would like to use amplify texture for more efficient texture atlasing in order to reduce material count, so correct me if I am mistaken, but for AT there is no performance difference between multiple 4k textures and one 8k, because in the end they are all in one big virtual texture and the amplified shader takes the mesh uv and works with that small portion of the texture, so using one 8k atlas which combines multiple 4k textures will have no negative impact during the fragment shader since it will sample only that 4k texture defined by UVs and it won't be sampling 8k texture. Am I right or amplify texture works differently?
You are correct, using 4 4k textures is the same as using 1 8K texture. After virtualization, the original textures are no longer used, actual texture size stops being a factor. However, I should point out that single larger texture could help you reduce overall draw calls.
Also would it be possible to add something like texture quality in unity's quality settings? I mean that now the objects near you are getting the full source texture quality (4k), but if you have a small VRAM (1GB) then other objects which won't fit in to the memory get the lowest quality which leads to frequent reloading, so it would be good if you could limit the max texture quality which you can get (half -> 2k instead of 4k etc.) and thanks to this the objects wouldn't look that nice, but it would take less vram and therefor the loading/streaming would be less noticeable on slower computers and you could still have that full quality for faster PCs/Consoles
The way Amplify Texture 2 works, you never go over the VRAM Cache size(adjustable in the camera and manager component), regardless of the amount of textures, or original resolution, displayed simultaneously. You could literally view a scene with over 100GB of texture data without any video memory issues. Your texture data is always stored in the highest resolution possible and streamed at the required MIP resolution automatically.

Are you running into any specific issues regarding VRAM use? What do you mean by frequent reloading?
but it would take less vram and therefor the loading/streaming would be less noticeable on slower computers and you could still have that full quality for faster PCs/Consoles
Are you referring exclusively to streaming performance? If so, although size does not impact performance, there are several parameters that you can adjust to improve it.

CPU performance could be affected by:
  • A pre-pass, to a small RT and using a very simple shader, is required for page detection. The efficiency of this pre-pass is affected by draw call count. A high Pre Pass Width / Height - see ATCamera - could cause a large impact; auto-mode is usually well balanced, however.
  • Page/texture uploading to GPU, in Unity, is the slowest part due to being synchronous (on main thread) and rather inefficient overall - this should be fixed in future Unity versions(hopefully). You can modify this value in the "Pages Per Frame" property of AT Camera. Our default value is very low and you could safely increase it to 10 or 15 pages per frame. Please increase this in small increments as well on your target hardware spec, until it feels right. It should be kept as low as possible, however. This value should be inversely proportional to to texel density and unique detail - when using a lot of repeated textures, this number can be kept low. Increasing "Pages Per Frame" should be combined with incremental "Streaming Threads" for every 8-10 pages.
  • In Amplify Texture Manager (AT Manager), use Culling Mask to hide from the pre-pass any non-virtualized and transparent layers.
  • Running inside the editor is much slower than running a compiled build, this is due to overhead caused by AT background tasks.
  • Streaming efficiency can be highly affected by inconsistent UVs: small and fragmented UVs are not recommended.
GPU performance could be affected by:
  • Pre-pass renders the virtualized parts of the scene in a separate low-res/low-complexity shader pass so the impact may vary depending on the resolution of the meshes. (optional) To avoid paying a high cost for this tile detection pass we recommend using simplified versions of the meshes for the pre-pass only. This approach is described in detail in our "Amplify Your Game - Optimization Techniques 101" video.
  • Surface shaders - AT compatible shaders are slightly more complex; Highly complex shaders will hide the performance hit of virtual texture addressing, while simpler shader will make them more apparent. Added complexity can range up to 15-20% on very simple shaders (e.g. Unlit).
  • Multiple virtual textures - add a little bit to the complexity of the shader, but not a lot. When only one VT is used, AT will activate a simpler shader path.
  • Larger tile sizes, or virtual texture hardware levels High and Very High, were introduced mostly for non-performance critical applications and we recommend Standard hardware level for most applications, including VR and games.
General Tips:
  • DirectX 11 is recommended for maximum performance.
  • Take advantage of Dynamic and Static batching.
  • Use multi-tile texture collections on new assets. Merge and adjust individual objects in your modeling software whenever possible in order to take advantage of multi-tile uv texture collection optimizations; regardless of the number of texture tiles each collection will be considered to be a single texture and will only require one material.
Did the Force Update Materials help?

Thanks!