浏览代码

Merge pull request #1287 from Unity-Technologies/stacklit

Stacklit
/main
GitHub 7 年前
当前提交
acb97536
共有 9 个文件被更改,包括 1172 次插入79 次删除
  1. 18
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/BSDF.hlsl
  2. 12
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/CommonMaterial.hlsl
  3. 47
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/StackLit/StackLitUI.cs
  4. 44
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.cs
  5. 83
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.cs.hlsl
  6. 966
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.hlsl
  7. 14
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.shader
  8. 61
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLitData.hlsl
  9. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLitProperties.hlsl

18
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/BSDF.hlsl


// Conversion FO/IOR
TEMPLATE_2_REAL(IorToFresnel0, transmittedIor, incidentIor, return Sq((transmittedIor - incidentIor) / (transmittedIor + incidentIor)) )
real IorToFresnel0(real transmittedIor, real incidentIor = 1.0)
real IorToFresnel0(real transmittedIor)
return Sq((transmittedIor - incidentIor) / (transmittedIor + incidentIor));
return IorToFresnel0(transmittedIor, 1.0);
// Note: Don't handle the case fresnel0 == 1
real Fresnel0ToIor(real fresnel0)
{
real sqrtF0 = sqrt(fresnel0);
return (1.0 + sqrtF0) / (1.0 - sqrtF0);
}
// Note: We don't handle the case fresnel0 == 1
//real Fresnel0ToIor(real fresnel0)
//{
// real sqrtF0 = sqrt(fresnel0);
// return (1.0 + sqrtF0) / (1.0 - sqrtF0);
//}
TEMPLATE_1_REAL(Fresnel0ToIor, fresnel0, return ((1.0 + sqrt(fresnel0)) / (1.0 - sqrt(fresnel0))) )
// This function is a coarse approximation of computing fresnel0 for a different top than air (here clear coat of IOR 1.5) when we only have fresnel0 with air interface
// This function is equivalent to IorToFresnel0(Fresnel0ToIor(fresnel0), 1.5)

12
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/CommonMaterial.hlsl


roughnessB = roughness * (1 - anisotropy);
}
real RoughnessToAnisotropy(real roughnessT, real roughnessB)
{
return ((roughnessT - roughnessB) / (roughnessT + roughnessB + 0.0001));
}
// Same as ConvertAnisotropyToRoughness but
// roughnessT and roughnessB are clamped, and are meant to be used with punctual and directional lights.
void ConvertAnisotropyToClampRoughness(real perceptualRoughness, real anisotropy, out real roughnessT, out real roughnessB)

roughnessT = ClampRoughnessForAnalyticalLights(roughnessT);
roughnessB = ClampRoughnessForAnalyticalLights(roughnessB);
}
// Same as ConvertAnisotropyToClampRoughness, but without anisotropy.
void ConvertPerceptualRoughnessToClampRoughness(real perceptualRoughness, out real roughness)
{
roughness = PerceptualRoughnessToRoughness(perceptualRoughness);
roughness = ClampRoughnessForAnalyticalLights(roughness);
}
// Use with stack BRDF (clear coat / coat)

47
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/StackLit/StackLitUI.cs


protected const string k_EmissiveIntensity = "_EmissiveIntensity";
protected const string k_AlbedoAffectEmissive = "_AlbedoAffectEmissive";
// Coat
protected const string k_CoatEnable = "_CoatEnable";
protected const string k_CoatSmoothness = "_CoatSmoothness";
protected const string k_CoatIor = "_CoatIor";
protected const string k_CoatThickness = "_CoatThickness";
protected const string k_CoatExtinction = "_CoatExtinction";
// SSS
protected const string k_DiffusionProfile = "_DiffusionProfile";
protected const string k_SubsurfaceMask = "_SubsurfaceMask";

protected const string k_Smoothness2Range = "_SmoothnessBRange";
protected const string k_LobeMix = "_LobeMix";
// Anisotropy
protected const string k_Anisotropy = "_Anisotropy";
//// transparency params
//protected MaterialProperty transmissionEnable = null;

new Property(this, k_AlbedoAffectEmissive, "Albedo Affect Emissive", "Specifies whether or not the emissive color is multiplied by the albedo.", false),
}),
//new GroupProperty(this, "_Coat", "Coat", new BaseProperty[]
//{
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "SmoothnessCoat", "smoothnessCoat", false, false),
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Index Of Refraction", "iorCoat", false, false),
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Normal", "normal Coat", false, false),
//}),
new GroupProperty(this, "_Coat", "Coat", new BaseProperty[]
{
new Property(this, "_CoatEnable", "Coat Enable", "Enable coat layer with true vertical physically based BSDF mixing", false),
new Property(this, "_CoatSmoothness", "Coat Smoothness", "Top layer smoothness", false),
new Property(this, "_CoatIor", "Coat IOR", "Index of refraction", false),
new Property(this, "_CoatThickness", "Coat Thickness", "Coat thickness", false),
new Property(this, "_CoatExtinction", "Coat Absorption", "Coat absorption tint (the thicker the coat, the more that color is removed)", false),
}),
new GroupProperty(this, "_SSS", "Sub-Surface Scattering", new BaseProperty[]
{

new Property(this, k_LobeMix, "Lobe Mix", "Lobe Mix", false),
}),
//new GroupProperty(this, "_Anisotropy", "Anisotropy", new BaseProperty[]
//{
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Anisotropy Strength", "anisotropy strength", false),
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Rotation", "rotation", false),
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Tangent", "tangent", false),
//}),
new GroupProperty(this, "_Anisotropy", "Anisotropy", new BaseProperty[]
{
new Property(this, k_Anisotropy, "Anisotropy", "Anisotropy of base layer", false),
}),
new GroupProperty(this, "_Transmission", "Transmission", new BaseProperty[]
{

//CoreUtils.SetKeyword(material, "_USE_UV2", requireUv2);
//CoreUtils.SetKeyword(material, "_USE_UV3", requireUv3);
CoreUtils.SetKeyword(material, "_USE_TRIPLANAR", requireTriplanar);
bool anisotropyEnabled = material.HasProperty(k_Anisotropy) && (material.GetFloat(k_Anisotropy) != 0.0f);
// TODO: When we have a map, also test for map for enable. (This scheme doesn't allow enabling from
// neutral value though, better to still have flag and uncheck it in UI code when reach neutral
// value and re-enable otherwise).
bool coatEnabled = material.HasProperty(k_CoatEnable) && (material.GetFloat(k_CoatEnable) > 0.0f);
bool dualLobeEnabled = material.HasProperty(k_LobeMix) && (material.GetFloat(k_LobeMix) > 0.0f);
// Note that we don't use the materialId (cf Lit.shader) mechanism in the UI
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_ANISOTROPY", anisotropyEnabled);
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_COAT", coatEnabled);
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_DUAL_LOBE", dualLobeEnabled);
}
}
} // namespace UnityEditor

44
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.cs


using System;
using UnityEngine.Rendering;
//using System.Runtime.InteropServices;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{

public enum MaterialFeatureFlags
{
LitStandard = 1 << 0
StackLitStandard = 1 << 0,
StackLitAnisotropy = 1 << 4,
StackLitCoat = 1 << 6,
};
//-----------------------------------------------------------------------------

[SurfaceDataAttributes("Material Features")]
public uint materialFeatures;
// Standard
// Bottom interface (2 lobes BSDF)
// Standard parametrization
[SurfaceDataAttributes("Base Color", false, true)]
public Vector3 baseColor;

[SurfaceDataAttributes("Metallic")]
public float metallic;
// Anisotropic
[SurfaceDataAttributes("Tangent", true)]
public Vector3 tangentWS;
[SurfaceDataAttributes("Anisotropy")]
public float anisotropy; // anisotropic ratio(0->no isotropic; 1->full anisotropy in tangent direction, -1->full anisotropy in bitangent direction)
// Top interface and media (clearcoat)
[SurfaceDataAttributes("Coat Roughness")]
public float coatPerceptualSmoothness;
[SurfaceDataAttributes("Coat IOR")]
public float coatIor;
[SurfaceDataAttributes("Coat Thickness")]
public float coatThickness;
[SurfaceDataAttributes("Coat Extinction Coefficient")]
public Vector3 coatExtinction;
};
//-----------------------------------------------------------------------------

{
public uint materialFeatures;
// Bottom interface (2 lobes BSDF)
// Standard parametrization
[SurfaceDataAttributes("", false, true)]
public Vector3 diffuseColor;
public Vector3 fresnel0;

public float perceptualRoughnessA;
public float perceptualRoughnessB;
public float lobeMix;
// Anisotropic
[SurfaceDataAttributes("", true)]
public Vector3 tangentWS;
[SurfaceDataAttributes("", true)]
public Vector3 bitangentWS;
public float coatRoughness;
// Top interface and media (clearcoat)
public float coatPerceptualRoughness;
public float coatIor;
public float coatThickness;
public Vector3 coatExtinction;
//could use something like that:
//[MarshalAs(UnmanagedType.ByValArray, SizeConst=5)]
//public float[] test;
};

83
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.cs.hlsl


//
// UnityEngine.Experimental.Rendering.HDPipeline.StackLit+MaterialFeatureFlags: static fields
//
#define MATERIALFEATUREFLAGS_LIT_STANDARD (1)
#define MATERIALFEATUREFLAGS_STACK_LIT_STANDARD (1)
#define MATERIALFEATUREFLAGS_STACK_LIT_ANISOTROPY (16)
#define MATERIALFEATUREFLAGS_STACK_LIT_COAT (64)
//
// UnityEngine.Experimental.Rendering.HDPipeline.StackLit+SurfaceData: static fields

#define DEBUGVIEW_STACKLIT_SURFACEDATA_SMOOTHNESS_B (1305)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_LOBE_MIXING (1306)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_METALLIC (1307)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_TANGENT (1308)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_ANISOTROPY (1309)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_ROUGHNESS (1310)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_IOR (1311)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_THICKNESS (1312)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_EXTINCTION_COEFFICIENT (1313)
//
// UnityEngine.Experimental.Rendering.HDPipeline.StackLit+BSDFData: static fields

#define DEBUGVIEW_STACKLIT_BSDFDATA_NORMAL_VIEW_SPACE (1404)
#define DEBUGVIEW_STACKLIT_BSDFDATA_PERCEPTUAL_ROUGHNESS_A (1405)
#define DEBUGVIEW_STACKLIT_BSDFDATA_PERCEPTUAL_ROUGHNESS_B (1406)
#define DEBUGVIEW_STACKLIT_BSDFDATA_LOBE_MIXING (1407)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_AT (1408)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_AB (1409)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_BT (1410)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_BB (1411)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ANISOTROPY (1412)
#define DEBUGVIEW_STACKLIT_BSDFDATA_LOBE_MIX (1407)
#define DEBUGVIEW_STACKLIT_BSDFDATA_TANGENT_WS (1408)
#define DEBUGVIEW_STACKLIT_BSDFDATA_BITANGENT_WS (1409)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_AT (1410)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_AB (1411)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_BT (1412)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_BB (1413)
#define DEBUGVIEW_STACKLIT_BSDFDATA_COAT_ROUGHNESS (1414)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ANISOTROPY (1415)
#define DEBUGVIEW_STACKLIT_BSDFDATA_COAT_PERCEPTUAL_ROUGHNESS (1416)
#define DEBUGVIEW_STACKLIT_BSDFDATA_COAT_IOR (1417)
#define DEBUGVIEW_STACKLIT_BSDFDATA_COAT_THICKNESS (1418)
#define DEBUGVIEW_STACKLIT_BSDFDATA_COAT_EXTINCTION (1419)
// Generated from UnityEngine.Experimental.Rendering.HDPipeline.StackLit+SurfaceData
// PackingRules = Exact

float perceptualSmoothnessB;
float lobeMix;
float metallic;
float3 tangentWS;
float anisotropy;
float coatPerceptualSmoothness;
float coatIor;
float coatThickness;
float3 coatExtinction;
};
// Generated from UnityEngine.Experimental.Rendering.HDPipeline.StackLit+BSDFData

float perceptualRoughnessA;
float perceptualRoughnessB;
float lobeMix;
float3 tangentWS;
float3 bitangentWS;
float coatRoughness;
float coatPerceptualRoughness;
float coatIor;
float coatThickness;
float3 coatExtinction;
};
//

case DEBUGVIEW_STACKLIT_SURFACEDATA_METALLIC:
result = surfacedata.metallic.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_TANGENT:
result = surfacedata.tangentWS * 0.5 + 0.5;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_ANISOTROPY:
result = surfacedata.anisotropy.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_ROUGHNESS:
result = surfacedata.coatPerceptualSmoothness.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_IOR:
result = surfacedata.coatIor.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_THICKNESS:
result = surfacedata.coatThickness.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_EXTINCTION_COEFFICIENT:
result = surfacedata.coatExtinction;
break;
}
}

case DEBUGVIEW_STACKLIT_BSDFDATA_PERCEPTUAL_ROUGHNESS_B:
result = bsdfdata.perceptualRoughnessB.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_LOBE_MIXING:
case DEBUGVIEW_STACKLIT_BSDFDATA_LOBE_MIX:
case DEBUGVIEW_STACKLIT_BSDFDATA_TANGENT_WS:
result = bsdfdata.tangentWS * 0.5 + 0.5;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_BITANGENT_WS:
result = bsdfdata.bitangentWS * 0.5 + 0.5;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_AT:
result = bsdfdata.roughnessAT.xxx;
break;

case DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_BB:
result = bsdfdata.roughnessBB.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_COAT_ROUGHNESS:
result = bsdfdata.coatRoughness.xxx;
break;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_COAT_PERCEPTUAL_ROUGHNESS:
result = bsdfdata.coatPerceptualRoughness.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_COAT_IOR:
result = bsdfdata.coatIor.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_COAT_THICKNESS:
result = bsdfdata.coatThickness.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_COAT_EXTINCTION:
result = bsdfdata.coatExtinction;
break;
}
}

966
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.hlsl
文件差异内容过多而无法显示
查看文件

14
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.shader


[HideInInspector] _SmoothnessBRange("SmoothnessB Range", Vector) = (0, 1, 0, 0)
_LobeMix("Lobe Mix", Range(0.0, 1.0)) = 0
// TODO: TangentMap, AnisotropyMap and CoatIorMap (SmoothnessMap ?)
_Anisotropy("Anisotropy", Range(-1.0, 1.0)) = 0.0
[ToggleUI] _CoatEnable("Coat Enable", Float) = 0.0 // UI only
_CoatSmoothness("Coat Smoothness", Range(0.0, 1.0)) = 1.0
_CoatIor("Coat IOR", Range(1.0, 2.0)) = 1.5
_CoatThickness("Coat Thickness", Range(0.0, 0.99)) = 0.0
_CoatExtinction("Coat Extinction Coefficient", Color) = (1,1,1,1) // in thickness^-1 units
[HideInInspector] _NormalMapShow("NormalMap Show", Float) = 0.0
_NormalMap("NormalMap", 2D) = "bump" {} // Tangent space normal map
_NormalMapUV("NormalMapUV", Float) = 0.0

#pragma shader_feature _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY
#pragma shader_feature _BLENDMODE_PRESERVE_SPECULAR_LIGHTING // easily handled in material.hlsl, so adding this already.
#pragma shader_feature _ENABLE_FOG_ON_TRANSPARENT
// MaterialFeature are used as shader feature to allow compiler to optimize properly
#pragma shader_feature _MATERIAL_FEATURE_ANISOTROPY
#pragma shader_feature _MATERIAL_FEATURE_COAT
#pragma shader_feature _MATERIAL_FEATURE_DUAL_LOBE
//enable GPU instancing support
#pragma multi_compile_instancing

61
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLitData.hlsl


// We forbid scale in case of object space as it make no sense
// Decompress normal ourselve
float3 normalOS = SampleTexture2DTriplanarScaleBias(TEXTURE2D_PARAM(textureName, samplerName), textureNameUV, textureNameUVLocal, textureNameST, uvMapping) * 2.0 - 1.0;
float3 normalOS = SampleTexture2DTriplanarScaleBias(TEXTURE2D_PARAM(textureName, samplerName), textureNameUV, textureNameUVLocal, textureNameST, uvMapping).xyz * 2.0 - 1.0;
// no need to renormalize normalOS for SurfaceGradientFromPerturbedNormal
return SurfaceGradientFromPerturbedNormal(uvMapping.vertexNormalWS, TransformObjectToWorldDir(normalOS));
}

surfaceData.perceptualSmoothnessA = lerp(_SmoothnessARange.x, _SmoothnessARange.y, surfaceData.perceptualSmoothnessA);
surfaceData.perceptualSmoothnessA = lerp(_SmoothnessA, surfaceData.perceptualSmoothnessA, _SmoothnessAUseMap);
surfaceData.perceptualSmoothnessB = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_SmoothnessBMap), _SmoothnessBMapChannelMask);
surfaceData.perceptualSmoothnessB = lerp(_SmoothnessBRange.x, _SmoothnessBRange.y, surfaceData.perceptualSmoothnessB);
surfaceData.perceptualSmoothnessB = lerp(_SmoothnessB, surfaceData.perceptualSmoothnessB, _SmoothnessBUseMap);
// TODOSTACKLIT: lobe weighting
surfaceData.lobeMix = _LobeMix;
// TODO: As we add features, or-set the flags eg MATERIALFEATUREFLAGS_LIT_* with #ifdef
// TODO: As we add features, or-set the flags eg MATERIALFEATUREFLAGS_STACK_LIT_* with #ifdef
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_STACK_LIT_STANDARD;
#ifdef _MATERIAL_FEATURE_ANISOTROPY
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_STACK_LIT_ANISOTROPY;
#endif
#ifdef _MATERIAL_FEATURE_COAT
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_STACK_LIT_COAT;
#endif
// Not used for now aside from here in GetSurfaceAndBuiltinData
//#ifdef _MATERIAL_FEATURE_DUAL_LOBE
//#endif
// -------------------------------------------------------------
// Feature dependent data
// -------------------------------------------------------------
// TODO: #ifdef _TANGENTMAP, object space, etc.
surfaceData.tangentWS = normalize(input.worldToTangent[0].xyz); // The tangent is not normalize in worldToTangent for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
#ifdef _MATERIAL_FEATURE_DUAL_LOBE
surfaceData.lobeMix = _LobeMix;
surfaceData.perceptualSmoothnessB = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_SmoothnessBMap), _SmoothnessBMapChannelMask);
surfaceData.perceptualSmoothnessB = lerp(_SmoothnessBRange.x, _SmoothnessBRange.y, surfaceData.perceptualSmoothnessB);
surfaceData.perceptualSmoothnessB = lerp(_SmoothnessB, surfaceData.perceptualSmoothnessB, _SmoothnessBUseMap);
#else
surfaceData.lobeMix = 0.0;
surfaceData.perceptualSmoothnessB = 1.0;
#endif
// TODO: #ifdef _ANISOTROPYMAP
surfaceData.anisotropy = 1.0;
#ifdef _MATERIAL_FEATURE_ANISOTROPY
surfaceData.anisotropy *= _Anisotropy;
#endif
#ifdef _MATERIAL_FEATURE_COAT
surfaceData.coatPerceptualSmoothness = _CoatSmoothness;
surfaceData.coatIor = _CoatIor;
surfaceData.coatThickness = _CoatThickness;
surfaceData.coatExtinction = _CoatExtinction; // in thickness^-1 units
#else
surfaceData.coatPerceptualSmoothness = 0.0;
surfaceData.coatIor = 1.0;
surfaceData.coatThickness = 0.0;
surfaceData.coatExtinction = float3(1.0, 1.0, 1.0);
#endif
// -------------------------------------------------------------
// Surface Data Part 2 (outsite GetSurfaceData( ) in Lit shader):

builtinData.opacity = alpha;
// TODO:
builtinData.bakeDiffuseLighting = float3(0.0, 0.0, 0.0);
// Emissive Intensity is only use here, but is part of BuiltinData to enforce UI parameters as we want the users to fill one color and one intensity

// TODO:
builtinData.velocity = float2(0.0, 0.0);
//NEWLITTODO: shader feature SHADOWS_SHADOWMASK not there yet.

6
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLitProperties.hlsl


float4 _SmoothnessBRange;
float _LobeMix;
float _Anisotropy;
float _CoatSmoothness;
float _CoatIor;
float _CoatThickness;
float4 _CoatExtinction;
float _NormalScale;
float _NormalMapUV;
float _NormalMapUVLocal;

正在加载...
取消
保存