Will the HDPipeline completely change the way shaders work?

I was looking at Amplify Shader Editor and ShaderForge, and I was wondering… will these become completely unusable once the HDPipeline arrives? (unless they get converted by the authors… which is highly likely to happen)

How much does the HDPipeline change the way shaders are written? I thought I heard somewhere in these forums that the whole ShaderLab thing was going away, but I can’t remember where

3 Likes

I wonder the same, I hope all my current made shaders don’t render useless (pun intended :P)

“I was looking at Amplify Shader Editor and ShaderForge, and I was wondering… will these become completely unusable once the HDPipeline arrives”

No and Yes.

No:
When you import all of your models that use current standard shader… they are just pink, You need to convert them to their new default HD shader:

Yes:
In SRP you can convert all of your old shaders to the new one automatically by just clicking 1 button:

1 Like

Can someone shoot me a link to the “how why and whens” of this? Not a huge fan of Shader Lab myself. So this could be a nice development.

We don’t have any real info on this.

However, looking at the HDPipeline/Lit shader in the SRP project, it definitely seems like C# will be fulfilling the role shaderlab once had.

Lit.cs

using UnityEngine.Rendering;

namespace UnityEngine.Experimental.Rendering.HDPipeline
{
    public partial class Lit : RenderPipelineMaterial
    {
        [GenerateHLSL(PackingRules.Exact)]
        public enum MaterialId
        {
            LitSSS          = 0,
            LitStandard     = 1,
            LitAniso        = 2,
            LitClearCoat    = 3,
            // LitSpecular (DiffuseColor/SpecularColor) is an alternate parametrization for LitStandard (BaseColor/Metal/Specular), but it is the same shading model
            // We don't want any specific materialId for it, instead we use LitStandard as materialId. However for UI purpose we still define this value here.
            // For material classification we will use LitStandard too
            LitSpecular     = 4,
        };

        // If change, be sure it match what is done in Lit.hlsl: MaterialFeatureFlagsFromGBuffer
        // Material bit mask must match LightDefinitions.s_MaterialFeatureMaskFlags value
        [GenerateHLSL]
        public enum MaterialFeatureFlags
        {
            LitSSS          = 1 << MaterialId.LitSSS,
            LitStandard     = 1 << MaterialId.LitStandard,
            LitAniso        = 1 << MaterialId.LitAniso,
            LitClearCoat    = 1 << MaterialId.LitClearCoat,
        };

        [GenerateHLSL]
        public class StandardDefinitions
        {
            public static int s_GBufferLitStandardRegularId = 0;
            public static int s_GBufferLitStandardSpecularColorId = 1;

            public static float s_DefaultSpecularValue = 0.04f;
            public static float s_SkinSpecularValue = 0.028f;
        }

        //-----------------------------------------------------------------------------
        // SurfaceData
        //-----------------------------------------------------------------------------

        // Main structure that store the user data (i.e user input of master node in material graph)
        [GenerateHLSL(PackingRules.Exact, false, true, 1000)]
        public struct SurfaceData
        {
            [SurfaceDataAttributes("Base Color", false, true)]
            public Vector3 baseColor;
            [SurfaceDataAttributes("Specular Occlusion")]
            public float specularOcclusion;

            [SurfaceDataAttributes("Normal", true)]
            public Vector3 normalWS;
            [SurfaceDataAttributes("Smoothness")]
            public float perceptualSmoothness;
            [SurfaceDataAttributes("Material ID")]
            public MaterialId materialId; // matId above 3 are store in standard material gbuffer (2bit reserved)

            [SurfaceDataAttributes("Ambient Occlusion")]
            public float ambientOcclusion;

            // MaterialId dependent attribute

            // standard
            [SurfaceDataAttributes("Tangent", true)]
            public Vector3 tangentWS;
            [SurfaceDataAttributes("Anisotropy")]
            public float anisotropy; // anisotropic ratio(0->no isotropic; 1->full anisotropy in tangent direction)
            [SurfaceDataAttributes("Metallic")]
            public float metallic;

            // SSS
            [SurfaceDataAttributes("Subsurface Radius")]
            public float subsurfaceRadius;
            [SurfaceDataAttributes("Thickness")]
            public float thickness;
            [SurfaceDataAttributes("Subsurface Profile")]
            public int subsurfaceProfile;

            // SpecColor
            [SurfaceDataAttributes("Specular Color", false, true)]
            public Vector3 specularColor;

            // ClearCoat
            [SurfaceDataAttributes("Coat Normal", true)]
            public Vector3 coatNormalWS;
            [SurfaceDataAttributes("Coat coverage")]
            public float coatCoverage;
            [SurfaceDataAttributes("Coat IOR")]
            public float coatIOR; // Value is [0..1] for artists but the UI will display the value between [1..2]
        };

        //-----------------------------------------------------------------------------
        // BSDFData
        //-----------------------------------------------------------------------------

        [GenerateHLSL(PackingRules.Exact)]
        public enum TransmissionType
        {
            None = 0,
            Regular = 1,
            ThinObject = 2,
        };

        [GenerateHLSL(PackingRules.Exact, false, true, 1030)]
        public struct BSDFData
        {
            [SurfaceDataAttributes("", false, true)]
            public Vector3 diffuseColor;

            public Vector3 fresnel0;

            public float specularOcclusion;

            [SurfaceDataAttributes("", true)]
            public Vector3 normalWS;
            public float perceptualRoughness;
            public float roughness;
            public int materialId;

            // MaterialId dependent attribute

            // standard
            [SurfaceDataAttributes("", true)]
            public Vector3 tangentWS;
            [SurfaceDataAttributes("", true)]
            public Vector3 bitangentWS;
            public float roughnessT;
            public float roughnessB;
            public float anisotropy;

            // fold into fresnel0

            // SSS
            public float   subsurfaceRadius;
            public float   thickness;
            public int     subsurfaceProfile;
            public bool    enableTransmission; // Read from the SSS profile
            public bool    useThinObjectMode;  // Read from the SSS profile
            public Vector3 transmittance;

            // SpecColor
            // fold into fresnel0

            // ClearCoat
            public Vector3 coatNormalWS;
            public float coatCoverage;
            public float coatIOR; // CoatIOR is in range[1..2] it is surfaceData + 1
        };

        //-----------------------------------------------------------------------------
        // RenderLoop management
        //-----------------------------------------------------------------------------

        [GenerateHLSL(PackingRules.Exact)]
        public enum GBufferMaterial
        {
            // Note: This count doesn't include the velocity buffer. On shader and csharp side the velocity buffer will be added by the framework
            Count = (ShaderConfig.k_PackgbufferInU16 == 1) ? 2 : 4
        };

        //-----------------------------------------------------------------------------
        // GBuffer management
        //-----------------------------------------------------------------------------

        public override int GetMaterialGBufferCount() { return (int)GBufferMaterial.Count; }

        public override void GetMaterialGBufferDescription(out RenderTextureFormat[] RTFormat, out RenderTextureReadWrite[] RTReadWrite)
        {
            RTFormat = new RenderTextureFormat[(int)GBufferMaterial.Count];
            RTReadWrite = new RenderTextureReadWrite[(int)GBufferMaterial.Count];

            if (ShaderConfig.s_PackgbufferInU16 == 1)
            {
                // TODO: Just discovered that Unity doesn't support unsigned 16 RT format.
                RTFormat[0] = RenderTextureFormat.ARGBInt; RTReadWrite[0] = RenderTextureReadWrite.Linear;
                RTFormat[1] = RenderTextureFormat.ARGBInt; RTReadWrite[1] = RenderTextureReadWrite.Linear;
            }
            else
            {
                RTFormat[0] = RenderTextureFormat.ARGB32; RTReadWrite[0] = RenderTextureReadWrite.sRGB;
                RTFormat[1] = RenderTextureFormat.ARGB2101010; RTReadWrite[1] = RenderTextureReadWrite.Linear;
                RTFormat[2] = RenderTextureFormat.ARGB32; RTReadWrite[2] = RenderTextureReadWrite.Linear;
                RTFormat[3] = RenderTextureFormat.RGB111110Float; RTReadWrite[3] = RenderTextureReadWrite.Linear;
            }
        }

        //-----------------------------------------------------------------------------
        // Init precomputed texture
        //-----------------------------------------------------------------------------

        bool m_isInit;

        // For image based lighting
        Material      m_InitPreFGD;
        RenderTexture m_PreIntegratedFGD;

        // For area lighting - We pack all texture inside a texture array to reduce the number of resource required
        Texture2DArray m_LtcData; // 0: m_LtcGGXMatrix - RGBA, 2: m_LtcDisneyDiffuseMatrix - RGBA, 3: m_LtcMultiGGXFresnelDisneyDiffuse - RGB, A unused

        const int k_LtcLUTMatrixDim  =  3; // size of the matrix (3x3)
        const int k_LtcLUTResolution = 64;


        // Load LUT with one scalar in alpha of a tex2D
        void LoadLUT(Texture2DArray tex, int arrayElement, TextureFormat format, float[] LUTScalar)
        {
            const int count = k_LtcLUTResolution * k_LtcLUTResolution;
            Color[] pixels = new Color[count];

            for (int i = 0; i < count; i++)
            {
                pixels[i] = new Color(0, 0, 0, LUTScalar[i]);
            }

            tex.SetPixels(pixels, arrayElement);
        }

        // Load LUT with 3x3 matrix in RGBA of a tex2D (some part are zero)
        void LoadLUT(Texture2DArray tex, int arrayElement, TextureFormat format, double[,] LUTTransformInv)
        {
            const int count = k_LtcLUTResolution * k_LtcLUTResolution;
            Color[] pixels = new Color[count];

            for (int i = 0; i < count; i++)
            {
                // Both GGX and Disney Diffuse BRDFs have zero values in columns 1, 3, 5, 7.
                // Column 8 contains only ones.
                pixels[i] = new Color((float)LUTTransformInv[i, 0],
                        (float)LUTTransformInv[i, 2],
                        (float)LUTTransformInv[i, 4],
                        (float)LUTTransformInv[i, 6]);
            }

            tex.SetPixels(pixels, arrayElement);
        }

        // Special-case function for 'm_LtcMultiGGXFresnelDisneyDiffuse'.
        void LoadLUT(Texture2DArray tex, int arrayElement, TextureFormat format,   float[] LtcGGXMagnitudeData,
            float[] LtcGGXFresnelData,
            float[] LtcDisneyDiffuseMagnitudeData)
        {
            const int count = k_LtcLUTResolution * k_LtcLUTResolution;
            Color[] pixels = new Color[count];

            for (int i = 0; i < count; i++)
            {
                // We store the result of the subtraction as a run-time optimization.
                // See the footnote 2 of "LTC Fresnel Approximation" by Stephen Hill.
                pixels[i] = new Color(LtcGGXMagnitudeData[i] - LtcGGXFresnelData[i],
                        LtcGGXFresnelData[i], LtcDisneyDiffuseMagnitudeData[i], 1);
            }

            tex.SetPixels(pixels, arrayElement);
        }

        public Lit() {}

        public override void Build(RenderPipelineResources renderPipelineResources)
        {
            m_InitPreFGD = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/PreIntegratedFGD");

            // For DisneyDiffuse integration values goes from (0.5 to 1.53125). GGX need 0 to 1. Use float format.
            m_PreIntegratedFGD = new RenderTexture(128, 128, 0, RenderTextureFormat.RGB111110Float, RenderTextureReadWrite.Linear);
            m_PreIntegratedFGD.filterMode = FilterMode.Bilinear;
            m_PreIntegratedFGD.wrapMode = TextureWrapMode.Clamp;
            m_PreIntegratedFGD.hideFlags = HideFlags.DontSave;
            m_PreIntegratedFGD.Create();

            m_LtcData = new Texture2DArray(k_LtcLUTResolution, k_LtcLUTResolution, 3, TextureFormat.RGBAHalf, false /*mipmap*/, true /* linear */)
            {
                hideFlags = HideFlags.HideAndDontSave,
                wrapMode = TextureWrapMode.Clamp,
                filterMode = FilterMode.Bilinear
            };

            LoadLUT(m_LtcData, 0, TextureFormat.RGBAHalf,   s_LtcGGXMatrixData);
            LoadLUT(m_LtcData, 1, TextureFormat.RGBAHalf,   s_LtcDisneyDiffuseMatrixData);
            // TODO: switch to RGBA64 when it becomes available.
            LoadLUT(m_LtcData, 2, TextureFormat.RGBAHalf,   s_LtcGGXMagnitudeData, s_LtcGGXFresnelData, s_LtcDisneyDiffuseMagnitudeData);

            m_LtcData.Apply();

            m_isInit = false;
        }

        public override void Cleanup()
        {
            Utilities.Destroy(m_InitPreFGD);

            // TODO: how to delete RenderTexture ? or do we need to do it ?
            m_isInit = false;
        }

        public override void RenderInit(CommandBuffer cmd)
        {
            if (m_isInit)
                return;

            using (new Utilities.ProfilingSample("Init PreFGD", cmd))
            {
                Utilities.DrawFullScreen(cmd, m_InitPreFGD, new RenderTargetIdentifier(m_PreIntegratedFGD));
            }
            m_isInit = true;
        }

        public override void Bind()
        {
            Shader.SetGlobalTexture("_PreIntegratedFGD", m_PreIntegratedFGD);
            Shader.SetGlobalTexture("_LtcData", m_LtcData);
        }
    }
}

…and this generates an hlsl file:

Lit.cs.hlsl

//
// This file was automatically generated from Assets/ScriptableRenderLoop/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.cs.  Please don't edit by hand.
//

#ifndef LIT_CS_HLSL
#define LIT_CS_HLSL
//
// UnityEngine.Experimental.Rendering.HDPipeline.Lit+MaterialId:  static fields
//
#define MATERIALID_LIT_SSS (0)
#define MATERIALID_LIT_STANDARD (1)
#define MATERIALID_LIT_ANISO (2)
#define MATERIALID_LIT_CLEAR_COAT (3)
#define MATERIALID_LIT_SPECULAR (4)

//
// UnityEngine.Experimental.Rendering.HDPipeline.Lit+MaterialFeatureFlags:  static fields
//
#define MATERIALFEATUREFLAGS_LIT_SSS (1)
#define MATERIALFEATUREFLAGS_LIT_STANDARD (2)
#define MATERIALFEATUREFLAGS_LIT_ANISO (4)
#define MATERIALFEATUREFLAGS_LIT_CLEAR_COAT (8)

//
// UnityEngine.Experimental.Rendering.HDPipeline.Lit+StandardDefinitions:  static fields
//
#define GBUFFER_LIT_STANDARD_REGULAR_ID (0)
#define GBUFFER_LIT_STANDARD_SPECULAR_COLOR_ID (1)
#define DEFAULT_SPECULAR_VALUE (0.04)
#define SKIN_SPECULAR_VALUE (0.028)

//
// UnityEngine.Experimental.Rendering.HDPipeline.Lit+SurfaceData:  static fields
//
#define DEBUGVIEW_LIT_SURFACEDATA_BASE_COLOR (1000)
#define DEBUGVIEW_LIT_SURFACEDATA_SPECULAR_OCCLUSION (1001)
#define DEBUGVIEW_LIT_SURFACEDATA_NORMAL_WS (1002)
#define DEBUGVIEW_LIT_SURFACEDATA_PERCEPTUAL_SMOOTHNESS (1003)
#define DEBUGVIEW_LIT_SURFACEDATA_MATERIAL_ID (1004)
#define DEBUGVIEW_LIT_SURFACEDATA_AMBIENT_OCCLUSION (1005)
#define DEBUGVIEW_LIT_SURFACEDATA_TANGENT_WS (1006)
#define DEBUGVIEW_LIT_SURFACEDATA_ANISOTROPY (1007)
#define DEBUGVIEW_LIT_SURFACEDATA_METALLIC (1008)
#define DEBUGVIEW_LIT_SURFACEDATA_SUBSURFACE_RADIUS (1009)
#define DEBUGVIEW_LIT_SURFACEDATA_THICKNESS (1010)
#define DEBUGVIEW_LIT_SURFACEDATA_SUBSURFACE_PROFILE (1011)
#define DEBUGVIEW_LIT_SURFACEDATA_SPECULAR_COLOR (1012)
#define DEBUGVIEW_LIT_SURFACEDATA_COAT_NORMAL_WS (1013)
#define DEBUGVIEW_LIT_SURFACEDATA_COAT_COVERAGE (1014)
#define DEBUGVIEW_LIT_SURFACEDATA_COAT_IOR (1015)

//
// UnityEngine.Experimental.Rendering.HDPipeline.Lit+TransmissionType:  static fields
//
#define TRANSMISSIONTYPE_NONE (0)
#define TRANSMISSIONTYPE_REGULAR (1)
#define TRANSMISSIONTYPE_THIN_OBJECT (2)

//
// UnityEngine.Experimental.Rendering.HDPipeline.Lit+BSDFData:  static fields
//
#define DEBUGVIEW_LIT_BSDFDATA_DIFFUSE_COLOR (1030)
#define DEBUGVIEW_LIT_BSDFDATA_FRESNEL0 (1031)
#define DEBUGVIEW_LIT_BSDFDATA_SPECULAR_OCCLUSION (1032)
#define DEBUGVIEW_LIT_BSDFDATA_NORMAL_WS (1033)
#define DEBUGVIEW_LIT_BSDFDATA_PERCEPTUAL_ROUGHNESS (1034)
#define DEBUGVIEW_LIT_BSDFDATA_ROUGHNESS (1035)
#define DEBUGVIEW_LIT_BSDFDATA_MATERIAL_ID (1036)
#define DEBUGVIEW_LIT_BSDFDATA_TANGENT_WS (1037)
#define DEBUGVIEW_LIT_BSDFDATA_BITANGENT_WS (1038)
#define DEBUGVIEW_LIT_BSDFDATA_ROUGHNESS_T (1039)
#define DEBUGVIEW_LIT_BSDFDATA_ROUGHNESS_B (1040)
#define DEBUGVIEW_LIT_BSDFDATA_ANISOTROPY (1041)
#define DEBUGVIEW_LIT_BSDFDATA_SUBSURFACE_RADIUS (1042)
#define DEBUGVIEW_LIT_BSDFDATA_THICKNESS (1043)
#define DEBUGVIEW_LIT_BSDFDATA_SUBSURFACE_PROFILE (1044)
#define DEBUGVIEW_LIT_BSDFDATA_ENABLE_TRANSMISSION (1045)
#define DEBUGVIEW_LIT_BSDFDATA_USE_THIN_OBJECT_MODE (1046)
#define DEBUGVIEW_LIT_BSDFDATA_TRANSMITTANCE (1047)
#define DEBUGVIEW_LIT_BSDFDATA_COAT_NORMAL_WS (1048)
#define DEBUGVIEW_LIT_BSDFDATA_COAT_COVERAGE (1049)
#define DEBUGVIEW_LIT_BSDFDATA_COAT_IOR (1050)

//
// UnityEngine.Experimental.Rendering.HDPipeline.Lit+GBufferMaterial:  static fields
//
#define GBUFFERMATERIAL_COUNT (4)

// Generated from UnityEngine.Experimental.Rendering.HDPipeline.Lit+SurfaceData
// PackingRules = Exact
struct SurfaceData
{
    float3 baseColor;
    float specularOcclusion;
    float3 normalWS;
    float perceptualSmoothness;
    int materialId;
    float ambientOcclusion;
    float3 tangentWS;
    float anisotropy;
    float metallic;
    float subsurfaceRadius;
    float thickness;
    int subsurfaceProfile;
    float3 specularColor;
    float3 coatNormalWS;
    float coatCoverage;
    float coatIOR;
};

// Generated from UnityEngine.Experimental.Rendering.HDPipeline.Lit+BSDFData
// PackingRules = Exact
struct BSDFData
{
    float3 diffuseColor;
    float3 fresnel0;
    float specularOcclusion;
    float3 normalWS;
    float perceptualRoughness;
    float roughness;
    int materialId;
    float3 tangentWS;
    float3 bitangentWS;
    float roughnessT;
    float roughnessB;
    float anisotropy;
    float subsurfaceRadius;
    float thickness;
    int subsurfaceProfile;
    bool enableTransmission;
    bool useThinObjectMode;
    float3 transmittance;
    float3 coatNormalWS;
    float coatCoverage;
    float coatIOR;
};

//
// Debug functions
//
void GetGeneratedSurfaceDataDebug(uint paramId, SurfaceData surfacedata, inout float3 result, inout bool needLinearToSRGB)
{
    switch (paramId)
    {
        case DEBUGVIEW_LIT_SURFACEDATA_BASE_COLOR:
            result = surfacedata.baseColor;
            needLinearToSRGB = true;
            break;
        case DEBUGVIEW_LIT_SURFACEDATA_SPECULAR_OCCLUSION:
            result = surfacedata.specularOcclusion.xxx;
            break;
        case DEBUGVIEW_LIT_SURFACEDATA_NORMAL_WS:
            result = surfacedata.normalWS * 0.5 + 0.5;
            break;
        case DEBUGVIEW_LIT_SURFACEDATA_PERCEPTUAL_SMOOTHNESS:
            result = surfacedata.perceptualSmoothness.xxx;
            break;
        case DEBUGVIEW_LIT_SURFACEDATA_MATERIAL_ID:
            result = GetIndexColor(surfacedata.materialId);
            break;
        case DEBUGVIEW_LIT_SURFACEDATA_AMBIENT_OCCLUSION:
            result = surfacedata.ambientOcclusion.xxx;
            break;
        case DEBUGVIEW_LIT_SURFACEDATA_TANGENT_WS:
            result = surfacedata.tangentWS * 0.5 + 0.5;
            break;
        case DEBUGVIEW_LIT_SURFACEDATA_ANISOTROPY:
            result = surfacedata.anisotropy.xxx;
            break;
        case DEBUGVIEW_LIT_SURFACEDATA_METALLIC:
            result = surfacedata.metallic.xxx;
            break;
        case DEBUGVIEW_LIT_SURFACEDATA_SUBSURFACE_RADIUS:
            result = surfacedata.subsurfaceRadius.xxx;
            break;
        case DEBUGVIEW_LIT_SURFACEDATA_THICKNESS:
            result = surfacedata.thickness.xxx;
            break;
        case DEBUGVIEW_LIT_SURFACEDATA_SUBSURFACE_PROFILE:
            result = GetIndexColor(surfacedata.subsurfaceProfile);
            break;
        case DEBUGVIEW_LIT_SURFACEDATA_SPECULAR_COLOR:
            result = surfacedata.specularColor;
            needLinearToSRGB = true;
            break;
        case DEBUGVIEW_LIT_SURFACEDATA_COAT_NORMAL_WS:
            result = surfacedata.coatNormalWS * 0.5 + 0.5;
            break;
        case DEBUGVIEW_LIT_SURFACEDATA_COAT_COVERAGE:
            result = surfacedata.coatCoverage.xxx;
            break;
        case DEBUGVIEW_LIT_SURFACEDATA_COAT_IOR:
            result = surfacedata.coatIOR.xxx;
            break;
    }
}

//
// Debug functions
//
void GetGeneratedBSDFDataDebug(uint paramId, BSDFData bsdfdata, inout float3 result, inout bool needLinearToSRGB)
{
    switch (paramId)
    {
        case DEBUGVIEW_LIT_BSDFDATA_DIFFUSE_COLOR:
            result = bsdfdata.diffuseColor;
            needLinearToSRGB = true;
            break;
        case DEBUGVIEW_LIT_BSDFDATA_FRESNEL0:
            result = bsdfdata.fresnel0;
            break;
        case DEBUGVIEW_LIT_BSDFDATA_SPECULAR_OCCLUSION:
            result = bsdfdata.specularOcclusion.xxx;
            break;
        case DEBUGVIEW_LIT_BSDFDATA_NORMAL_WS:
            result = bsdfdata.normalWS * 0.5 + 0.5;
            break;
        case DEBUGVIEW_LIT_BSDFDATA_PERCEPTUAL_ROUGHNESS:
            result = bsdfdata.perceptualRoughness.xxx;
            break;
        case DEBUGVIEW_LIT_BSDFDATA_ROUGHNESS:
            result = bsdfdata.roughness.xxx;
            break;
        case DEBUGVIEW_LIT_BSDFDATA_MATERIAL_ID:
            result = GetIndexColor(bsdfdata.materialId);
            break;
        case DEBUGVIEW_LIT_BSDFDATA_TANGENT_WS:
            result = bsdfdata.tangentWS * 0.5 + 0.5;
            break;
        case DEBUGVIEW_LIT_BSDFDATA_BITANGENT_WS:
            result = bsdfdata.bitangentWS * 0.5 + 0.5;
            break;
        case DEBUGVIEW_LIT_BSDFDATA_ROUGHNESS_T:
            result = bsdfdata.roughnessT.xxx;
            break;
        case DEBUGVIEW_LIT_BSDFDATA_ROUGHNESS_B:
            result = bsdfdata.roughnessB.xxx;
            break;
        case DEBUGVIEW_LIT_BSDFDATA_ANISOTROPY:
            result = bsdfdata.anisotropy.xxx;
            break;
        case DEBUGVIEW_LIT_BSDFDATA_SUBSURFACE_RADIUS:
            result = bsdfdata.subsurfaceRadius.xxx;
            break;
        case DEBUGVIEW_LIT_BSDFDATA_THICKNESS:
            result = bsdfdata.thickness.xxx;
            break;
        case DEBUGVIEW_LIT_BSDFDATA_SUBSURFACE_PROFILE:
            result = GetIndexColor(bsdfdata.subsurfaceProfile);
            break;
        case DEBUGVIEW_LIT_BSDFDATA_ENABLE_TRANSMISSION:
            result = (bsdfdata.enableTransmission) ? float3(1.0, 1.0, 1.0) : float3(0.0, 0.0, 0.0);
            break;
        case DEBUGVIEW_LIT_BSDFDATA_USE_THIN_OBJECT_MODE:
            result = (bsdfdata.useThinObjectMode) ? float3(1.0, 1.0, 1.0) : float3(0.0, 0.0, 0.0);
            break;
        case DEBUGVIEW_LIT_BSDFDATA_TRANSMITTANCE:
            result = bsdfdata.transmittance;
            break;
        case DEBUGVIEW_LIT_BSDFDATA_COAT_NORMAL_WS:
            result = bsdfdata.coatNormalWS;
            break;
        case DEBUGVIEW_LIT_BSDFDATA_COAT_COVERAGE:
            result = bsdfdata.coatCoverage.xxx;
            break;
        case DEBUGVIEW_LIT_BSDFDATA_COAT_IOR:
            result = bsdfdata.coatIOR.xxx;
            break;
    }
}


#endif

…and I cannot wait to play around with this!

Other things I’ve noticed is that there is also a Lit.shader file that still seems to have some shaderlab in it. And hlsl seems to be replacing CG entirely (CGPROGRAM is now HLSLPROGRAM). In total, there are 4 files for the Lit shader:

  • Lit.cs
  • Lit.cs.hlsl
  • Lit.hlsl
  • Lit.shader

It’d be great if a dev could explain all this, It looks really interesting

1 Like

Ugh, about damned time. Down with shader lab, up with bubbles.

they planning to add a built in shader node editor for SRP so we don’t have to deal with all of that

Where did you get this info from?

here
https://discussions.unity.com/t/664083 page-3#post-3257061

Ah no eta, I will try to erase this from my memory

1 Like

there’s a branch for shader graph since months ago actually, but i doubt it would work with the public unity release

What is HDPipeline ?

Unity’s new WIP renderer made specifically for high-tier hardware such as PC/PS4/X1.
https://github.com/Unity-Technologies/ScriptableRenderPipeline/tree/master/ScriptableRenderPipeline/HDRenderPipeline

It has async compute, clustered tiled lighting (or some variant of it), subsurface scattering, volumetric lighting, deferred decals, and all that good stuff

1 Like

It’ll be generally faster than a dx9-era engine at doing the same workloads as well, and Unity is still a dx9-era engine, that is, it’s authored for around that tech. There’s work been done to drag it screaming and kicking up to date but smart people realised it couldn’t be done and would only get worse long term so

Scriptable Render Pipeline solves that by allowing a kind of “pluggable graphics engine” - this is a simple way to describe it but it’s really a better way to organise how Unity renders and add features of your own. It will ship with two plugin renderers to start with, these are called “Scriptable Render Pipeline Assets” and the two you get are the

HDRenderPipeline and LDRenderPipeline, with the latter being good for webgl, mobile, even VR in some cases and the former being good for the same, but obviously heavier performance and higher quality.

This way people can much better choose the engine that fits their game. In the end we’ll see asset authors supplying Scriptable Render Pipeline “bricks” so we can pull different features together to better tailor Unity to our games.

I used a lot of laymans terms as I don’t know the technical ability of who reads this, but I hope I got the point across.

2 Likes

WIll Scriptable Render Pipeline still use Monodevelop ?

It still uses C# yeah, you can use the language you’re used to tweak it or add stuff.

See the manual page to get started https://docs.unity3d.com/Manual/ScriptableRenderPipeline.html in addition to forums.

1 Like

Is it possible to get realtime lighting like in Cryengine ?

Depends on what you mean.
Will it come with the same tech as cryengine? Most likely no.
Will you be able to create similar (read: conceptually the same) render methods? Yeah, definitely.

1 Like

The HD path is all I could ask for from an engine setup. It looks great. But I have concerns about the performance, and the performance that worries me is Unity side more than the shaders. Unity is still hauling around a lot of monolithic baggage but I hope one day they can cut all that out and we only have SRP.

2 Likes