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

SV_COVERAGE in surface shaders.

Discussion in 'Shaders' started by slembcke2, Apr 9, 2019.

  1. slembcke2

    slembcke2

    Joined:
    Jun 26, 2013
    Posts:
    270
    Hardware defined coverage masks for alpha to coverage are really mediocre and seems to differ significantly between GPUs. I made an inexpensive pattern using SV_COVERAGE and R3 noise that I'm quite happy with, but it seems that it's not possible to use output semantics with surface shaders. There are a couple of externally provided shaders for the VR project I'm working on, and I can't significantly rewrite them as vert/frag shaders without a lot of work.

    Is there a workaround I'm missing?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    Sadly, no.
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    The fastest solution is to modify the generated shader code.
     
  4. slembcke2

    slembcke2

    Joined:
    Jun 26, 2013
    Posts:
    270
    Eh. I was afraid of that. I guess it works, but is kind of a huge pain.