Search Unity

[URP]Why does URP draw A "fullscreen Quad" instead of A "fullsceen Triangle" in postprocessing?

Discussion in 'Universal Render Pipeline' started by EminemJ, Aug 10, 2021.

  1. EminemJ

    EminemJ

    Joined:
    Mar 10, 2020
    Posts:
    45
    I found that in URP(7.5) , they draw a fullscreen quad to do postprocessing, while in HDRP and PPSV2, A Triangle is used for postprocessing。AFAIK, use a Triangle is more performance friendly, I wonder why URP doesn't use that Triangle version?
     
    rz_0lento likes this.
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
  3. EminemJ

    EminemJ

    Joined:
    Mar 10, 2020
    Posts:
    45
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    7.5 is quite old, did you check a newer URP? 2021.x versions of Unity control what version of URP is installed. I wonder if it has been addressed? 12 is the current.
     
  5. DrewFitz

    DrewFitz

    Joined:
    Dec 9, 2016
    Posts:
    30
    Either way the performance difference will be extremely negligible. You're talking a single vertex and triangle.
     
  6. xgonzal2

    xgonzal2

    Joined:
    Jul 3, 2012
    Posts:
    62
    The fullscreen triangle isn't really about optimizing the number of vertices rendered. It's about optimizing the small 2x2 (sometimes bigger) tile the GPU executes fragment shaders in. With a typical fullscreen quad you get a diagonal where the two triangles meet which causes the GPU tile to run fragment shaders on fragments that have already been processed so it does more work. With the fullscreen triangle you don't have that issue which means fragment shaders would run an optimal amount of times. This can make a measurable difference on mid to low end hardware and VR also. In my experience, a fullscreen triangle is no worse than a fullscreen quad but can be a decent improvement over it depending on what shaders are running.
     
  7. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Indeed and it's never usually in isolation. A post effect stack can do 10-20 blits without breaking sweat, and that could add up quite a lot for a VR or switch title as you say.
     
  8. DrewFitz

    DrewFitz

    Joined:
    Dec 9, 2016
    Posts:
    30
    oh wow, that's wild, i'm a bit surprised that modern GPU hardware can't optimize around that but it's probably a hard problem