Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved Diffusion profile property drawer

Discussion in 'High Definition Render Pipeline' started by BOXOPHOBIC, Dec 31, 2020.

  1. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    519
    Hi,

    Are there any plans to add a diffusion profile property drawer or at least make the diffusion profile api public for people who don't use shader graph or the hdrp shader GUI (for instance amplify shaders). We need to rely on custom solutions to make it work.

    Thanks
     
  2. antoinel_unity

    antoinel_unity

    Unity Technologies

    Joined:
    Jan 7, 2019
    Posts:
    267
    Hello,

    I guess you are talking about a material property drawer?
    If that's the case, it has already been added in HDRP 10 and above: https://github.com/Unity-Technologi...aph/DiffusionProfileMaterialPropertyDrawer.cs

    You can use it like this in a shader:

    Code (CSharp):
    1. Shader "New Shader Graph"
    2. {
    3.     Properties
    4.     {
    5.         [DiffusionProfile]_Profile("Diffusion Profile", Float) = 0
    6.         [HideInInspector]_Profile_Asset("Diffusion Profile", Vector) = (0, 0, 0, 0)
    7. ...
    8.  
    Note that you need to have two properties for the material drawer, the first needs to be a float and the second one a vector. For the naming, you can do what you want as long as the second variable name is the same as the first one with "_Asset" added at the end.
     
  3. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    519
    Hi. Awesome! I'm glad it was finally added. Will it be backported to older HDRP versions as well?
     
  4. antoinel_unity

    antoinel_unity

    Unity Technologies

    Joined:
    Jan 7, 2019
    Posts:
    267
    Unfortunately no, it was part of a bigger work task to allow to expose diffusion profiles in the ShaderGraph, and features are not backported on packages, only bugfix.
     
  5. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    519
    Alright, thanks for the info!
     
  6. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,481
    I'm glad I found this thread. How can I expose the parameters in my skin shaders directly?