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

RenderTexture.isVolume obsolet what to use now ?

Discussion in 'Shaders' started by Tamanoir, Dec 9, 2019.

  1. Tamanoir

    Tamanoir

    Joined:
    Aug 1, 2017
    Posts:
    27
    Hi !

    As the title said, I'm trying to use 3D RenderTexture to compute, in a ComputeShader, a RWTexture2D based on the data I get from two RWTexture3D. To initialize the RWTexture3D, I used isVolume = true, but this became obsolete already a long time ago. Is there any way to do it ? I didn't find anything on that beside the isVolume thing.

    Tama,
     
  2. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
  3. Tamanoir

    Tamanoir

    Joined:
    Aug 1, 2017
    Posts:
    27
    Thank you !
    Do you know any issues related to the refresh of the layers on this kind of 3D textures ?
    I don't know why, but after the first frame rendered in my app, the textures that I'm using, are not empty anymore even if I destroy the unity RenderTexture and recreate them.
     
  4. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    I'm not sure what causes that, but I've recently experienced similar with structured buffers, even if I re-init a buffer after destroying/releasing it, I still get some junk data in there (or old data) I think I'm doing it correctly according to the docs etc. Someone more skilled than me might know, but I haven't found any solid information on the web.

    But if you're prototyping/building something, maybe you could try add a pass to your process, just make small program you dispatch every update that zeroes everything, then proceed to writing to your 3D texture in next program. I don't think it will add that much overhead, at least then you might something functioning.
     
  5. Tamanoir

    Tamanoir

    Joined:
    Aug 1, 2017
    Posts:
    27
    Yes that's exactly what I'm struggling with ! Thx for your answers I will add a pass to clear the buffers. That's a shame because even the GL.Clear thing on the texture is not working.
     
  6. Tamanoir

    Tamanoir

    Joined:
    Aug 1, 2017
    Posts:
    27
    Ok, Just to update my research on the refresh of the data on buffers, I still don't know how to deal with it, because clearing buffer is not helping. However, I noticed that if I pause the unity editor and execute some frame with the "frame by frame" button, the ghost data just disappear... I don't know how to fix this though ...