Announcement

Collapse
No announcement yet.

Virtual Texturing Feedback

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

    Going to remind, that while not really important for virtual texture, being able to sample runtime virtual texture in domain/vertex shader is very much needed for a whole range of effects.

    Comment


      Hi, I am having issues with Unreal crashing when I import 16UDIM images to use as Virtual Textures, I have updated to the latest 4.24.2 version, and restarted both the engine and my computer several times.
      When I first got the 4.23 release, the Virtual Textures imported just fine, but then this problem started happening and I have not found a solution since then.

      This is the message I get after the crash occurs:



      Unhandled Exception: EXCEPTION_ACCESS_VIOLATION writing address 0x00000000

      UE4Editor_UnrealEd
      UE4Editor_UnrealEd
      UE4Editor_UnrealEd
      UE4Editor_UnrealEd
      UE4Editor_UnrealEd
      UE4Editor_AssetTools
      UE4Editor_AssetTools
      UE4Editor_UnrealEd
      UE4Editor_UnrealEd
      UE4Editor_Engine
      UE4Editor_Engine
      UE4Editor_UnrealEd
      UE4Editor_UnrealEd
      UE4Editor
      UE4Editor
      UE4Editor
      UE4Editor
      UE4Editor
      kernel32
      ntdll


      Any idea what is going wrong?

      thanks

      Comment


        Hi, I am not able to properly import UDIM textures. VT is enabled and it is a low res 4x4 tile.

        Originally posted by ElephantFury View Post
        Right, I understand that UV origin is different for DirectX and OpenGL however the UDIM standard has been around for almost 10 years now and users expect their textures to read from bottom to top. Even softwares that support both APIs like Substance Painter and Designer have adapted to this unified standard.

        I've attached my example files here for you to test.
        These are just a few plane meshes (2x2, 10x10, etc) and 100 labeled udim textures.
        If you load the textures on the 10x10 plane mesh, you'll see that the images unfortunately don't load upside-down and compensate for the different UV origin, as you describe.

        Thanks for looking into this
        I also tested with those files, but the texture 1001 is constantly repeated.
        The expected size is 1024x1024 and is correct in the content browser, but when opened it is 256x256, so only 1 texture. But the path to other textures is also good.

        Click image for larger version

Name:	UDIM.png
Views:	373
Size:	357.8 KB
ID:	1730681

        Tested in 4.23.1 and 4.24.1

        What am I doing wrong ?

        Comment


          Anyways this is just happening in linux, works fine for windows

          Comment


            Is Virtual Texturing enabled out of the box? Tried the official 4.24 version but trying to convert a texture to virtual texture does nothing. The same happens when downloading the code from dev-rendering branch.

            If you look at the code in FAssetTypeActions_Texture::ConvertVTTexture you see that the code was disabled like this: #if 0.

            Do I need to enable something in the code of compile it somehow to have VT working?

            Comment


              Originally posted by JesusGumbau View Post
              Is Virtual Texturing enabled out of the box? Tried the official 4.24 version but trying to convert a texture to virtual texture does nothing. The same happens when downloading the code from dev-rendering branch.

              If you look at the code in FAssetTypeActions_Texture::ConvertVTTexture you see that the code was disabled like this: #if 0.

              Do I need to enable something in the code of compile it somehow to have VT working?
              Check the posts from beningram into this thread and his comments on user questions. You need to enable "Virtual Texture Streaming" in your project settings. There was also a Live Streaming about the feature that you should check out aswel. I think the documentations is already a thing for the feature, so check this link and the other links inside the page: https://docs.unrealengine.com/en-US/...ing/index.html
              Nilson Lima
              Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
              Join us at Discord: https://discord.gg/FUwTvzr

              UE4 Marketplace: Cloudscape Seasons
              supporting: Community FREE Ocean plugin

              Comment


                Ok thanks. I was able to enable VT for a texture in the project.

                I wonder how they implemented VT on D3D11 if the D3D11 headers that come in the ThirdParty folder do not support D3D11.2 (don't contain the definitions for tiled resources or tile pools).

                Aren't they using D3D11 tiled resources?

                Comment


                  jgp80 That is a good question, lets hope beningram is able to answer that for ya! I didn't get into the source code for this particular part, mainly because it is still Beta and there are quite an amount of fixes for few issues and of course a good point to test the feature will be currently 4.25, because two major features are becoming production ready with 4.25: Real-time Raytracing and Niagara, which must be stable enough for any new feature dependent on them, like virtual texturing.
                  Nilson Lima
                  Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
                  Join us at Discord: https://discord.gg/FUwTvzr

                  UE4 Marketplace: Cloudscape Seasons
                  supporting: Community FREE Ocean plugin

                  Comment


                    I'd say they are NOT using D3D11 native virtual textures (tiled resources) because:
                    - The version of D3D11 included in the engine does not support D3D 11.2.
                    - There is no trace of the D3D11 Tile resouce API calls in the code.
                    - In a video, they mentioned that this were introducing a performance cost (extra texture sample) for an extra indirection (perhaps to map UVs to the actual textures).

                    So, if this is the case I'd ask: why aren't they using native tiled resoruces for this?? (maybe to develop a unified virtual texturing solution once at a higher level, not depending on the underlaying graphcis API?)

                    Hopew beningram or someone else at Epic can give us some answers

                    Comment


                      Originally posted by jgp80 View Post
                      I'd say they are NOT using D3D11 native virtual textures (tiled resources) because:
                      - The version of D3D11 included in the engine does not support D3D 11.2.
                      - There is no trace of the D3D11 Tile resouce API calls in the code.
                      - In a video, they mentioned that this were introducing a performance cost (extra texture sample) for an extra indirection (perhaps to map UVs to the actual textures).

                      So, if this is the case I'd ask: why aren't they using native tiled resoruces for this?? (maybe to develop a unified virtual texturing solution once at a higher level, not depending on the underlaying graphcis API?)

                      Hopew beningram or someone else at Epic can give us some answers
                      This is usually how they worked. They implemented their own SharedRef and SharedPtr architecture as well for example to be able to maintain cross-platform compatibility. Can't say if this why they 've done it with VTs but that's my guess.

                      Comment


                        > I'd say they are NOT using D3D11 native virtual textures
                        Yes this is correct, we're not using native tiled textures anywhere at the moment.

                        > So, if this is the case I'd ask: why aren't they using native tiled resoruces for this??
                        You're pretty much correct, in that we wanted an implementation that would work everywhere, even on platforms that had no/poor support for tiled resources. We do have plans to take advantage of native tiled resources at some point on platforms where it makes sense, but this can happen as an implementation detail. It shouldn't change how anything works, it can just provide some performance/memory improvements when supported.

                        I should note that even using native tiled functionality adds some overhead compared to regular non-virtual textures. You still need some way to provide feedback on missing tiles, and you still need some way to handle displaying lower resolution texture data when the require high-res data isn't streamed in yet.

                        Comment


                          Hey beningram , thanks a lot for the clarification.

                          In my case I don't want to read the feedback of missing tiles. I just want to be able to update "tiles" or texture portions "at will" from C++ code. Is this possible with the current implementation? In case it is... could you point us to the functions / APIs that would allow to do that?

                          So if I have a virtual FTexture2D.. where's a way to update tiles into it from C++ code so that the system automatically takes care of the min mips per region? (to avoid sampling "unmapped" tiles)

                          Comment


                            IRendererModule::RequestVirtualTextureTilesForRegion() should have the functionality you need. It may take some work to set this up the way you need however. To get an IAllocateVirtualTexture*, you'll need to go through UMaterial rather than UTexture, since material allocate virtual texture space for stacks of virtual textures.

                            As far as calling RequestVirtualTextureTilesForRegion(), parameters work like this:
                            InTextureRegion: Region of texture you want to load, empty rectangle for entire texture.
                            InMipLevel: Mip level of texture to load
                            InScreenSpaceSize: If InMipLevel < 0, then this will be the size of texture on screen, used to automatically compute the proper mip level, ignored if InMipLevel >= 0

                            There is a CVAR to disable VT feedback 'r.VT.EnableFeedBack'. If this is 0, feedback buffer will be skipped (although currently it's still rendered). This is mostly intended for debugging at the moment, so you may need to do some cleanup if you intend to use it for production.

                            Comment


                              Hi!

                              I am doing some tests, but I guess I am doing something wrong, I hope you can help

                              - In Maya, I have one object with a UV shell ocuping more than one udim tile, and in Unreal I can see a black line where the UV tile "cuts" the UV shell, is this expected? (I baked the texture with Octane) I would love this to work so I can do this big with chunks of photogametry, both geo and textures.

                              - Also, the textures donĀ“t line up perfectly, the line up good in the classic uv space, tile 1001, but not in the others.


                              Thanks in advance for your help and time, much appreciated ))


                              Attached Files

                              Comment


                                beningram Looks like the composite texture workflow for character roughness maps doesn't work with virtual textures. Can you look into it? Thx!

                                Click image for larger version  Name:	VT_N_Rough.jpg Views:	0 Size:	143.6 KB ID:	1741972
                                ArtStation - Portfolio

                                Comment

                                Working...
                                X