Search Unity

Enabling and disabling tessellation in a shader

Discussion in 'Shaders' started by wlad_s, Sep 2, 2020.

  1. wlad_s

    wlad_s

    Joined:
    Feb 18, 2011
    Posts:
    148
    Hello, I'm shader-noobish and I'm wondering if it's possible to somehow easily turn tessellation on or off in a shader. I've tried with a global shader keyword but it didn't work. (Built-in RP)

    Thanks for any advice!
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    It’s not possible with keywords. At least not unless you’re on 2020.1 or newer where I think they changed how that stuff works, but it might still not be possible as I haven’t tried it yet.

    The most common way to do it was using multiple
    SubShader
    s, and abusing shader LODs to enable or disable it.
     
    wlad_s likes this.
  3. wlad_s

    wlad_s

    Joined:
    Feb 18, 2011
    Posts:
    148
  4. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,014
    We don't yet support excluding or including a shader stage based on a keyword. We might in the future :)
     
    wlad_s and bgolus like this.