Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to send a Texture2DArray to a VisualEffect Component?

Discussion in 'Visual Effect Graph' started by randomdragon, Aug 19, 2021.

  1. randomdragon

    randomdragon

    Joined:
    Feb 11, 2020
    Posts:
    31
    I got this in my display system.
    upload_2021-8-19_11-27-32.png

    Every texture inside will be initialized in the script
    upload_2021-8-19_11-29-13.png

    And I want to bind the array just like I did with the single texture to the VFXGraph.
    upload_2021-8-19_11-29-42.png
     
  2. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    324
    Hi, There's a difference between a Texture2DArray and an array of Texture2D.

    A Texture2DArray is a GPU type reprensenting a single texture object with several 2D slices. So it's a 3D representation of data like Texture3D but with interpolation an mipmap chain performed in 2D instead of 3D.

    An array of Texture2D is simply a C# array containing several Texture2D objects.

    VFX graph handles Texture2DArray not array of Texture2D. A Texture2DArray is a single resource object, so it's wrapped by a single RenderTexture, not an array of RenderTexture. Check the RenderTexture.dimension and RenderTexture.volumeDepth.
     
    randomdragon and Vita- like this.