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 Blit Render Texture not working on Oculus Quest

Discussion in 'VR' started by Lamamour, Nov 3, 2020.

  1. Lamamour

    Lamamour

    Joined:
    Oct 31, 2020
    Posts:
    5
    Hello Everyone,

    I'm trying to create a shader to "paint" on a texture and for this I use:

    Code (CSharp):
    1.     private void UpdateDrawing(Vector2 position)
    2.     {
    3.         RenderTexture temp = RenderTexture.GetTemporary(paperRenderTexture.width, paperRenderTexture.height, 24);
    4.         Graphics.SetRenderTarget(temp.colorBuffer, paperRenderTexture.depthBuffer);
    5.         Graphics.Blit(paperRenderTexture, temp);
    6.         Graphics.Blit(temp, paperRenderTexture, paperMat);
    7.  
    8.         RenderTexture.ReleaseTemporary(temp);
    9.     }
    10. }
    This works perfectly on exe but not for Android (Oculus Quest). I guess this has to do with the depth buffer used by the Blit, but Graphics.SetRenderTarget did not help at all.
    The only thing that I did to make it work on the Quest was to add ZTest Always to my shader but this is not the desired behaviour...
    Do you have a solution for me?
     
  2. Danielsantalla

    Danielsantalla

    Joined:
    Jan 7, 2015
    Posts:
    75
    Any news on this?