Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Getting "Surface Options" in Custom GUI in URP 12.0+

Discussion in 'Shaders' started by TheMarshmallowBear, Mar 23, 2022.

  1. TheMarshmallowBear

    TheMarshmallowBear

    Joined:
    Jul 1, 2017
    Posts:
    3
    How does one get the "Material Override" surface options to show up in a custom GUI that inherits from "ShaderGUI".

    I'm at a complete loss as I cannot find any references to this online.
     
  2. Hyralys

    Hyralys

    Joined:
    Mar 12, 2020
    Posts:
    2
    Hey, I have the same problem so I wonder if you found a nice solution.

    I'm trying to use a custom GUI with a Shader Graph material, and the closest I could find is that you can write by hand all these options (surface type, render face, etc..) in the custom GUI script using the properties references that you see in the shader graph inspector (orange frame on my screenshot).
    Edit : I forgot to mention you have to check "allow material override" to see and access those properties
    The problem here is that they all appear as floats, and so you have to find yourself which value equals which mode


    ShaderProperties.png Script.png MaterialView.png
     
  3. pixelChisel

    pixelChisel

    Joined:
    May 19, 2016
    Posts:
    17
    Having the same problem here :(
    I'm rewriting everything by hand for now, with some help from the built-in shader source files (StandardShaderGUI.cs)
     
  4. roger_peng

    roger_peng

    Joined:
    Sep 19, 2015
    Posts:
    5
    try BaseShaderGUI