A few questions regarding Runtime Virtual Textures

I’m exploring different optimization techniques for my mobile game and at the moment and decided to try out RVTs. Thus, I have a few questions regarding them to be sure if this feature is worth using for my project or not. For the context, I’m using RVT for the landscape shader.

As far as I understand, RVT is converting all logic from the shader and renders it into a texture when I build the project. And in packaged game, instead of rendering the shader (without RVT) each frame, it just loads data from RVT once the level is loaded. In simple terms (I understand that there’s much more, like mipmaps, texture streaming and so on).

  1. So, my first question is about shader complexity. I noticed that after I added RVT functionality to my shader It became even worse (it became red in shader complexity view mode but was green without RVT). Does it really means that it will harm performance in a packaged game or it’s just how editor shows the amount of shader instructions?

  2. RVT compression. It compresses it as hell and the surface looks as a 8-bit gif image (even with YCoCg):


    But I managed to achieve acceptable result without compression but with reduced RVR settings:

    And when I check disc size (while hovering on this RVT in asset browser) it shows that its size is 16,384 (KB, MB, what’s the metric?). Does it mean that everything is OK and I can proceed without compression or I have to look somewhere else to see the real impact on performance?
    image

  3. And the last question is about defying landscape shader restrictions for mobile. There are some restrictions regarding amount of texture samplers and layers for mobile devices. I personally never faced any problems even when I was using up to 10 LS layers, but I tested just on a couple iPhones, so, I’m not sure whether It will work OK on other devices. Anyway, my current LS shader has only 4 layers and 2 texture samplers.
    So, the question is. With RVTs, does it mean that I can craft a heavy LS shader with more layers\textures (like if I was targeting desktop platform), and with RVT it will be cheap and work flawlessly on a mobile device?

I will be grateful for any answers and comments.

Did you ever get any answers on this? I’m having similar questions exploring the use of RVT for my landscape for Mobile VR

Hi, unfortunately no. Frankly speaking I dropped the idea of using RVT in my project.

Hi @Slydex44, thanks for pointing out the compression issue. This is what really destroys texture quality on mobile devices (the texture may be being compressed twice, once by BC and again by ASTC).
By turning off compression, I was able to significantly improve the quality of my landscape.

To compensate for the performance that is lost when using textures without compression, I did the following:
After many tests, I discovered that the smaller the tile, the better the device processes them, so the best option is to leave it at 64 (0), and increase the number of tiles to the resolution that best balances performance and quality in the project. (If you make the tile larger, you can see the delay the device has in processing the change in mipmaps).
My landscape is about 20km2, the best option in my case was: 1024 (10) and 64 (0). (Since it is a flying game, I don’t need a lot of resolution on the ground, just removing the compression artifacts was enough). But If your land is smaller, you can increase the number of tiles and have a great resolution.

Another thing that helped me a lot with performance was setting the RVT as Base color only and “baking” the normal map inside the material. (but it only works if you are using only static light)

1 Like