Search Unity

Assertion failed on expression: Blit to screen in OnRenderImage

Discussion in 'Image Effects' started by AlexTemina, Jan 3, 2017.

  1. AlexTemina

    AlexTemina

    Joined:
    Feb 19, 2014
    Posts:
    44
    Hi!

    I am mixing 2 cameras to be able to blur a light renderer (Light is meshes with color gradients) and I'm getting this assertion error

    Assertion failed on expression: 'depthSurface == NULL || rcolorZero->backBuffer == depthSurface->backBuffer'


    This error happens when calling Blit to null in OnRenderImage, here:

    Code (CSharp):
    1. private void OnRenderImage( RenderTexture src, RenderTexture dst )
    2.     {
    3.         if( _cam )
    4.         {
    5.             _cam.targetTexture = null;
    6.         }
    7.         Graphics.Blit( src, dst );
    8.         Graphics.Blit( dst, null, Material ); //HERE
    9.     }
    everything works correctly, just the error is very annoying. Do you know why it's happening?

    Thanks!

    EDIT: The full log error is
    Assertion failed on expression: 'depthSurface == NULL || rcolorZero->backBuffer == depthSurface->backBuffer'
    0x0000000141509B9B (Unity) StackWalker::GetCurrentCallstack
    0x000000014150B84E (Unity) StackWalker::ShowCallstack
    0x00000001414DA963 (Unity) GetStacktrace
    0x00000001411DCBFA (Unity) DebugStringToFile
    0x00000001411DD06C (Unity) DebugStringToFile
    0x0000000140979724 (Unity) IndexBufferD3D11::~IndexBufferD3D11
    0x000000014097ADC2 (Unity) GfxDeviceD3D11Base::SetRenderTargetsImpl
    0x00000001409E6089 (Unity) GfxDeviceWorker::RunCommand
    0x00000001409EBE5F (Unity) GfxDeviceWorker::Run
    0x00000001409CF91D (Unity) GfxDeviceWorker::RunGfxDeviceWorker
    0x0000000140F8804C (Unity) Thread::RunThreadWrapper
    0x00007FF989798364 (KERNEL32) BaseThreadInitThunk
    0x00007FF98B7F70D1 (ntdll) RtlUserThreadStart
     
    Last edited: Jan 3, 2017
  2. malcolmchalmers

    malcolmchalmers

    Joined:
    Nov 27, 2016
    Posts:
    6
    I'm having this issue as well, only when I play it on an Android device I think though.
    Having trouble finding a solution.....