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

CopyTexture into cubemap rendertarget does not work

Discussion in 'General Graphics' started by Cristian76, Oct 30, 2017.

  1. Cristian76

    Cristian76

    Joined:
    Feb 9, 2017
    Posts:
    4
    Hi,

    I'm trying to copy and modity the current shadowmap for point light using RenderBuffer.
    I would like to use AfterShadowmap event to copy, modify and put back my custom shadow.

    No problem copying the current shadowmap into a cubemap rendertexture using CopyTexture.

    However when I copy my custom cubemap into the BuiltinRenderType.Active, nothing happen, like the CopyTexture fails or simply does something invalid.
    Other operations, like ClearRenderTarget work fine (on each face).

    I tried also to copy each individual face: Not work
    Any suggestions ? Is that the wanted behavior or just a bug ?

    PS:
    What it is left are:
    - copy each face separately and maybe using CommandBuffer.Blit on the different cubeface (by setting the correct rendertarget options before calling it). But I suspect it is not going to work.
    - use ShadowmapPass events and blit the texture into the current active render target (but again, I think is not going to work)
     
  2. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
    Why not add the custom shadow pass to the material shader itself? That prevents the need to use a CommandBuffer (and the script that sets up the CommandBuffer.) Or is it a general modification to the shadowmap?