Search Unity

In 5.6 CommandBuffer seems to have broken for BuiltinRenderTextureType.CurrentActive

Discussion in 'Image Effects' started by headlessstudio, Apr 10, 2017.

  1. headlessstudio

    headlessstudio

    Joined:
    Feb 25, 2016
    Posts:
    83
    In previous Unity releases (pre 5.6), we used a simple CommandBuffer to capture screen contents at each frame, using something like this on Start.
    Code (csharp):
    1.  
    2. var buf = new CommandBuffer {name = BufferName};
    3. cam.AddCommandBuffer(CameraEvent.AfterEverything, buf)
    4. buf.Blit(BuiltinRenderTextureType.CurrentActive, ElementFrameBuffer);
    5.  
    This worked great and with a single time setup, we goted an updated RenderTexture (ElementFrameBuffer) each frame. Now it seems that RenderTexture.active when in Deferred rendering is always null, and this doesn't work any more. We know ways around this, like grabbing OnRenderImage, but isn't so clean as a CommandBuffer.
    So is this a bug, or now in deferred the active rendertexture is never set by default by unity, as in previous versions?

    Best regards,
    Daniel Santana
    Technical Director/Co-founder
    You can do it! VFX
     
  2. wilberforce

    wilberforce

    Joined:
    Aug 29, 2016
    Posts:
    92
    Bump. Any news on this? We need to get format of BuiltinRenderTextureType.CurrentActive to fix our asset.