Search Unity

  1. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice

Unity Feedback Wanted: Streaming Virtual Texturing

Discussion in 'Graphics Experimental Previews' started by AljoshaD, Mar 18, 2020.

  1. passeridaepc

    passeridaepc

    Joined:
    Jun 16, 2019
    Posts:
    115
    Hi!

    I want to add two "sample virtual texture" nodes inside my shader graph, but the second of them is intended to be optional. I'm planning to feed a set of custom lightmaps (4 texture maps) into each of these nodes and lerp between them in runtime in some situations. The thing is, I will fill both of the sampler nodes (with 8 textures in total) for some materials and only one node for the others. So one of the samplers may remain empty in some cases. Is it a bad approach? Is it better to create a separate shader with only one VT sampler for such scenarios?

    Also, If you use more than 8 regular texture 2D samplers in shader graph, you'll get an error "Maximum ps_4_0 sampler register index (16) exceeded". And you'll have to reuse sampler states. How does it apply to VT samplers, since they take 4 texture maps each? Do they count as 4 samplers? Or if they don't, does it mean, I can use 8 VT samplers (32 texture maps in total) without running into this error?

    And is it okay to use both VT samplers and regular 2D/3D samplers inside the same graph?

    Thanks!
     
  2. AljoshaD

    AljoshaD

    Unity Technologies

    Joined:
    May 27, 2019
    Posts:
    69
    Hi,

    currently, all texture slots need to be assign for each VT property or this will not work in the player.
    The number of samplers indeed rapidly increases with each texture sample. You have per VT sample 1 + NumberOfLayers amount of samplers.
    You can mix VT and regular texture samples in one graph.
     
  3. passeridaepc

    passeridaepc

    Joined:
    Jun 16, 2019
    Posts:
    115
    So, if one 4-layered vt sampler = 5 samplers, then I can use only three 4-layered vt samplers per graph (12 texture maps in total). What do I do if I need more virtual texture maps? I'm aware of only two solutions for regular samplers in this case: use a texture array or use a sampler state node. VT Sampler, however, doesn't have a sampler state input and can't take texture array as far as I understand.
     
  4. TekHK

    TekHK

    Joined:
    Jul 30, 2014
    Posts:
    18
    I am getting an editor crash on build every time. It is a very simple test project - 32 x 4k textures, all set to VT only on import. One layer in the shader. HDRP, raytracing set to on. Virtual texturing enabled. Works fine in the editor I can see the virtual texturing profiler loading and unloading (although I see in the memory profiler that it is using texture memory which is wierd considering I set the textures to VT and applied). It basically crashes every time I do a build when it gets to "build player". Version is 2020.2.6. Everything is updated to the latest versions via package manager. Is this a known bug?
     

    Attached Files:

  5. ValentinHume

    ValentinHume

    Unity Technologies

    Joined:
    Dec 10, 2020
    Posts:
    1
    Hi,

    could you please file a bug report for this and attach a small repro project to it ? So we can try to reproduce it with the exact same settings as you.

    Here's the link for more informations about bug reporting: https://unity3d.com/unity/qa/bug-reporting
     
  6. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    548
    Hello there, with VT active, LOD crossfade doesn't seem to be working. Is this the intended behavior?
     
  7. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    70
    Ooo Interesting, have you checked the VT debug section in the RP debug menu? It may give you some clues.
     
  8. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    548
    I did and while VT works just fine, the LOD transition (dithered crossfade) is gone. It is a pop in pop out with VT involved.
     
  9. NicoLeyman

    NicoLeyman

    Unity Technologies

    Joined:
    Jun 18, 2019
    Posts:
    9
    Hi,
    You need to enable LOD Cross Fade support in your custom shader through ShaderGraph's Graph Inspector window:
    LODCrossFade.PNG
     
  10. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    548
    Thanks! Wasn't aware that LOD was a checkable list.

    Thanks for the quick rep!
     
  11. Onat-H

    Onat-H

    Joined:
    Mar 11, 2015
    Posts:
    133
    Hi, do you have any news about Adressables support for VT? Ist this still going to happen in the 2021 tech cycle?
     
  12. AljoshaD

    AljoshaD

    Unity Technologies

    Joined:
    May 27, 2019
    Posts:
    69
    Hi,
    assetbundles/adressables support for VT will not land in 2021.
     
  13. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    1,995
  14. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    101
    And transparent VTs. I'm making due with multiple cameras and overlaying them on top of each other but that is a performance cost I would prefer not to incur.
     
  15. ali_mohebali

    ali_mohebali

    Unity Technologies

    Joined:
    Apr 8, 2020
    Posts:
    52
    Hi @rz_0lento, we intend to expose the roadmap for the core graphics area as well and we are working on that. So yes VT and texturing area-related roadmaps will be exposed as well.

    Just to give an update, PVT, Addressables, and support for URP are not part of our roadmap in 2021, but we do have them in our backlogs. The team has put the majority of their effort and focus on quality and stability in texturing area in 2021. As for URP, the focus this year is similarly improving quality and performance next to bringing the pipeline closer to parity with the Built-in renderer. SVT support for URP will be a new feature and will not be the focus area for URP in 2021.
     
    JoNax97 and rz_0lento like this.
unityunity