Search Unity

CommandBuffer, Blit and MipMaps

Discussion in 'Shaders' started by MaT227, Aug 29, 2017.

  1. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    Hi there, I am currently using CommandBuffer to do some Image Effects.
    For the moment I am using some Blit commands to do my operations but it seems that the Blit doesn't allows to write in mips of a RenderTexture or RenderTarget.

    As a workaround I tried to use the DrawProceduralMesh to draw a full screen quad or triangle in my current RenderTarget without any success, I can access the mips but I think that there's something wrong in the way I am drawing this stuff.

    My questions are :
    • How could I write in specific mip using CommandBuffer ?
    • How could I render a procedural full screen quad/triangle using CommandBuffer ?
    Thanks a lot !
     
  2. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
  3. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    Thanks for the answer @jvo3dc but it doesn't seem to work. Defining a RenderTarget and then using Blit doesn't write into the mipmaps.

    Using DrawProceduralMesh allows to define a RenderTarget with its Mip and then drawing the full screen quad inside this defined RT.
    But I am not able to see anything using DrawProceduralMesh...
     
  4. ViniciusGraciano

    ViniciusGraciano

    Joined:
    May 19, 2013
    Posts:
    13
    Blit sets the rendertarget to the parametrized dst target identifier. That's why changing the rendertarget prior to calling blit does not work. You should implement your own custom blit by rendering a full-screen quad while targeting the desired mip level.