Search Unity

What #pragma exclude_renderers nomrt does?

Discussion in 'Shaders' started by YJack, Feb 10, 2021.

  1. YJack

    YJack

    Joined:
    Apr 7, 2010
    Posts:
    44
    I'm pretty sure that I saw that answer somewhere but I'm not finding today. So I'm posting here this question for everyone and myself of the future come back when questioning this again.

    What #pragma exclude_renderers nomrt does?
     
  2. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    I believe adding it ensures the shader doesn't compile for platforms/devices that don't support multiple render targets (MRT). Which I think mainly boils down to deferred rendering?
     
    YJack likes this.
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    Deferred is certainly the most common use case for MRT, and the only built in use case Unity has by default. But there are plenty of other rendering techniques that make use of MRT as well. For example, there are a handful of advanced transparency rendering techniques that require rendering to multiple render targets and combining the results.
     
    YJack likes this.