Search Unity

Custom Render Textures VS Multiple Blits

Discussion in 'General Graphics' started by DouglasPotesta, Oct 4, 2019.

  1. DouglasPotesta

    DouglasPotesta

    Joined:
    Nov 6, 2014
    Posts:
    109
    I am contemplating whether to use Blit over Custom Render Textures built in update systems.

    Use Case
    I would like to do a material pass every frame on a render texture that is applied to an objects material. Many different objects in a scene will utilize this effect, with different render textures.

    Concerns
    Are there performance differences that make custom render textures update system better or worse than calling Blit through script?
    How about for scaling up?
    Are there workflows that handle the use case better?

    Current Understanding
    BLIT

    Blit is a very useful method for simple texture copying with shaders/materials.
    Provide an IN Texture, an OUT Render Texture along with a material and you get an easy effect.

    CUSTOM RENDER TEXTURE

    Custom Render Textures can be given a material and have an update mode set for updating every frame.
    The shaders need to be written in a special manner. Link (explained towards the bottom of the page)

    From what it seems Graphics.Blit is just more flexible than the update system in Custom Render Textures.
    The big upside to Custom Render Textures seems to be that the behavior is tied to the texture asset instead of a script. This black boxes the system a bit more and seems to leverage built in functionality.

    Conclusion
    Will fill in later when I come to a conclusion on which one to use.