Search Unity

RenderTexture.isVolume obsolet what to use now ?

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

  1. Tamanoir

    Tamanoir

    Joined:
    Aug 1, 2017
    Posts:
    13
    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:
    625
  3. Tamanoir

    Tamanoir

    Joined:
    Aug 1, 2017
    Posts:
    13
    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:
    625
    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:
    13
    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:
    13
    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 ...
     
unityunity