Announcement

Collapse
No announcement yet.

Landscape Virtual Texturing (Since UE 4.23)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Landscape Virtual Texturing (Since UE 4.23)

    Looks like we are getting Virtual Texturing support with 4.23.

    I want to dedicate this thread specifically to landscapes where VT will probably be a big gain. From what I've heard is that huge landscapes with many layers (10+) is a bottleneck in UE with the old Texture Streaming method.

    I've already done some tests (in 4.23 preview 1) but I'm unsure if this way actually gets the most out of VT for landscapes.

    So what I've done is enabling the "Virtual Texturing Streaming" on each landscape Texture.

    Click image for larger version  Name:	VirtualTexture1.png Views:	1 Size:	30.8 KB ID:	1641435

    After that I went through the landscape material and switched the Sampler Type of any Texture Sampler to Virtual Color/Normal.

    Click image for larger version  Name:	VirtualTexture2.png Views:	1 Size:	87.6 KB ID:	1641436

    So as I said, I don't know if this is actually sufficient to fully take advantage of VT or if there needs to be a lot more work to be done on the landscape material.


    There are also some new material nodes like Runtime Virtual Texture Sample. I couldn't figure out it's usage yet.

    Click image for larger version  Name:	D_QYj7mVUAAHCaa.png_large Views:	1 Size:	16.0 KB ID:	1641437

    #2
    do virtual textures act like megatextures? https://en.wikipedia.org/wiki/Talk%3AMegaTexture
    or amplify textures? https://amplify.pt/unity/amplify-texture-2/
    where we can potentially use a **** ton of textures? with limited mesh space?

    Comment


      #3
      That's very interesting.
      I'm also not sure about the advantages, I hope they'll explain that feature more in the final release notes.
      For example, if we have a landscape material with a couple of 4k textures (counting things like splatmaps, global normal maps, etc.), will that improve the performance in this case?

      Comment


        #4
        To my understanding, this should go much further with the landscape textures getting rendered into a virtual texture (using decals and potentially complex layering) and then the landscape and static meshes would simply sample that runtime generated texture. This would avoid the high costs of constantly recalculating the often expensive landscape material for every visible pixel at the cost of some memory and especially import make it much easier for other static meshes to use that landscape material as well.
        The only issue with a system like that is that I have no clue how it would handle triplanar texture mapping, but I can do without triplanar mapping if there is a simple way to use the landscape material in static meshes to cover steep areas, that would result in better looking environments anyway.
        Randomized tiling function to eliminate repeating patterns in textures.

        Comment


          #5
          From what I understand, it seems like virtual texturing is just a more efficient (depending on the circumstances) streaming algorithm, where the algorithm doesn't need to stream in the entire texture but only the texels requested by the engine. My immediate thought was how useful this would be for HLODs and merged material atlases created by the engine's built-in tools, as the pixels will be streamed in as needed.

          However, it seems like VTs often have their own inherent issues. Here's a link to a stack exchange post that I think discusses it really well:

          https://computergraphics.stackexchan...y-be-efficient

          I'm excited for what VTs can do, but I don't think they'll completely replace traditional textures anytime soon, but I certainly hope they'll find their place as something to offset issues that traditional texturing methods have difficulty with.

          Comment


            #6
            Now that 4.23 was released and we have some documentation I still wonder how to use VT for landscapes.

            What if we create an 8k texture atlas that combines all landscape textures? We could then just have two virtual samplers (1 for color, 1 for normal) instead of having dozens of shared wrap samplers.

            Comment


              #7
              I'm trying to use this new Virtual Texturing system and I'm running into a myriad of problems. Hopefully someone can help. To start with, Here's my full image in Photoshop. It's 24576x40960. It's broken up into 15 tiles of 8192x8192, saved at PNG files and numbered with the UDIM pattern.

              Click image for larger version

Name:	20190909_173141.jpg
Views:	1
Size:	64.6 KB
ID:	1662802Click image for larger version

Name:	20190909_173807.jpg
Views:	1
Size:	24.0 KB
ID:	1662801

              First problem is that I can't get UE 4.23 to import the 8k images, it crashes during import. I have been able to get a set of 4k resamples to import. The imported texture map asset shows the file paths for all 15 images, and Virtual Texture Streaming is checked. I see 12 MIP map levels, but this is where the weirdness begins. The tiles are all in random places, and in different places on different MIP levels.

              Click image for larger version

Name:	20190909_174402.jpg
Views:	2
Size:	52.2 KB
ID:	1662804Click image for larger version

Name:	20190909_174414.jpg
Views:	1
Size:	54.9 KB
ID:	1662803Click image for larger version

Name:	20190909_174423.jpg
Views:	1
Size:	45.9 KB
ID:	1662798Click image for larger version

Name:	20190909_174437.jpg
Views:	1
Size:	36.5 KB
ID:	1662800

              This is MIP levels 1, 2, 3, and 4. Why? Why are they not in the right order and why are they in a different pattern for each MIP level? When I place this on an object in the scene, it looks the same as the texture display, and then zooming in and out shows the MIP map levels changing and the tiles animate from one pattern to the next.

              I'm concerned about not being able to import the 8K maps, because some of my other images would be 8 tiles wide at 8k resolution, and I don't see a way with UDIM to get more than 10 images across. Is there another file naming schema that would allow for a larger grid of images?

              Help!

              Ray
              NC3D.com
              Attached Files

              Comment


                #8
                Bump!

                I've spent a day on this so far and I'm really stumped as to how to use the Virtual Texture. I can't get it to arrange the tiles in the correct order.

                Comment


                  #9
                  I can't actually get a virtual texture to import either. My tileset had poor numbering at one point and started at 1011 and that imported a virtual texture. But when the numbering scheme is correct it just imports a single UDIM tile as a regular texture.

                  I've gone through the factory and UDIM naming function and it all seems fine, so I had no idea what's up.



                  Edit: oooh, I just figured it out. The base names before the UDIM ID all have to be the same.

                  Comment


                    #10
                    Originally posted by Antidamage View Post
                    Edit: oooh, I just figured it out. The base names before the UDIM ID all have to be the same.
                    My texture file names were all the same and it made a Virtual Texture, but the tiles were all mixed up. Are you getting all of your tiles in the correct places on every MIP level?

                    Click image for larger version

Name:	20190916_170505.png
Views:	1
Size:	3.9 KB
ID:	1665432


                    Comment

                    Working...
                    X