浏览代码

Adding various UI for stacklit (iridescence + clean) first draft

/main
sebastienlagarde 7 年前
当前提交
2de26e3b
共有 5 个文件被更改,包括 280 次插入276 次删除
  1. 155
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/StackLit/StackLitUI.cs
  2. 67
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.cs
  3. 152
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.cs.hlsl
  4. 38
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.shader
  5. 144
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLitData.hlsl

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


protected const string k_AlbedoAffectEmissive = "_AlbedoAffectEmissive";
// Coat
protected const string k_CoatEnable = "_CoatEnable";
protected const string k_EnableCoat = "_EnableCoat";
protected const string k_CoatSmoothness = "_CoatSmoothness";
protected const string k_CoatIor = "_CoatIor";
protected const string k_CoatThickness = "_CoatThickness";

protected const string k_ThicknessMapUV = "_ThicknessMapUV";
// Second Lobe.
protected const string k_EnableDualSpecularLobe = "_EnableDualSpecularLobe";
protected const string k_Smoothness2 = "_SmoothnessB";
protected const string k_Smoothness2Map = "_SmoothnessBMap";
protected const string k_Smoothness2MapUV = "_SmoothnessBMapUV";

// Anisotropy
protected const string k_EnableAnisotropy = "_EnableAnisotropy";
protected const string k_AnisotropyMap = "_AnisotropyMap";
protected const string k_AnisotropyMapUV = "_AnisotropyMapUV";
// Iridescence
protected const string k_EnableIridescence = "_EnableIridescence";
protected const string k_IridescenceIor = "_IridescenceIor";
protected const string k_IridescenceThickness = "_IridescenceThickness";
protected const string k_IridescenceThicknessMap = "_IridescenceThicknessMap";
protected const string k_IridescenceThicknessMapUV = "_IridescenceThicknessMapUV";
// Stencil is use to control lighting mode (regular, split lighting)
//// transparency params
//protected MaterialProperty transmissionEnable = null;
//protected const string kTransmissionEnable = "_TransmissionEnable";
//protected MaterialProperty ior = null;
//protected const string kIor = "_Ior";
//protected MaterialProperty transmittanceColor = null;
//protected const string kTransmittanceColor = "_TransmittanceColor";
//protected MaterialProperty transmittanceColorMap = null;
//protected const string kTransmittanceColorMap = "_TransmittanceColorMap";
//protected MaterialProperty atDistance = null;
//protected const string kATDistance = "_ATDistance";
//protected MaterialProperty thicknessMultiplier = null;
//protected const string kThicknessMultiplier = "_ThicknessMultiplier";
//protected MaterialProperty refractionModel = null;
//protected const string kRefractionModel = "_RefractionModel";
//protected MaterialProperty refractionSSRayModel = null;
//protected const string kRefractionSSRayModel = "_RefractionSSRayModel";
#endregion
// Add the properties into an array.

private Property EnableSSS;
private Property EnableAnisotropy;
private Property EnableDualSpecularLobe;
private Property EnableIridescence;
public StackLitGUI()
{

new Property(this, k_DoubleSidedNormalMode, "Normal mode", "This will modify the normal base on the selected mode. Mirror: Mirror the normal with vertex normal plane, Flip: Flip the normal.", false),
});
//
//
EnableCoat = new Property(this, k_CoatEnable, "Coat Enable", "Enable coat layer with true vertical physically based BSDF mixing", true);
EnableCoat = new Property(this, k_EnableCoat, "Enable Coat", "Enable coat layer with true vertical physically based BSDF mixing", true);
EnableAnisotropy = new Property(this, k_EnableAnisotropy, "Enable Anisotropy", "Enable anisotropy, correct anisotropy for punctual light but very coarse approximated for reflection", true);
EnableDualSpecularLobe = new Property(this, k_EnableDualSpecularLobe, "Enable Dual Specular Lobe", "Enable a second specular lobe, aim to simulate a mix of a narrow and a haze lobe that better match measured material", true);
EnableIridescence = new Property(this, k_EnableIridescence, "Enable Iridescence", "Enable physically based iridescence layer", true);
// All material properties
_materialProperties = new GroupProperty(this, "_Material", new BaseProperty[]

EnableSSS,
EnableTransmission,
EnableCoat,
EnableAnisotropy,
EnableDualSpecularLobe,
EnableIridescence
}),
new GroupProperty(this, "_Standard", "Standard", new BaseProperty[]

new TextureProperty(this, k_AmbientOcclusionMap, k_AmbientOcclusion, "AmbientOcclusion", "AmbientOcclusion Map", false, false),
}),
new GroupProperty(this, "_Emissive", "Emissive", new BaseProperty[]
new GroupProperty(this, "_DualSpecularLobe", "Dual Specular Lobe", new BaseProperty[]
new TextureProperty(this, k_EmissiveColorMap, k_EmissiveColor, "Emissive Color", "Emissive", true, false),
new Property(this, k_EmissiveIntensity, "Emissive Intensity", "Emissive", false),
new Property(this, k_AlbedoAffectEmissive, "Albedo Affect Emissive", "Specifies whether or not the emissive color is multiplied by the albedo.", false),
}),
new TextureProperty(this, k_Smoothness2Map, k_Smoothness2, "Smoothness2", "Smoothness2", false, false),
new Property(this, k_LobeMix, "Lobe Mix", "Lobe Mix", false),
}, _ => EnableDualSpecularLobe.BoolValue == true),
new GroupProperty(this, "_Anisotropy", "Anisotropy", new BaseProperty[]
{
new Property(this, k_Anisotropy, "Anisotropy", "Anisotropy of base layer", false),
// TODO: Tangent map and rotation
}, _ => EnableAnisotropy.BoolValue == true),
new GroupProperty(this, "_Coat", "Coat", new BaseProperty[]
{

new Property(this, "_CoatExtinction", "Coat Absorption", "Coat absorption tint (the thicker the coat, the more that color is removed)", false),
}, _ =>EnableCoat.BoolValue == true),
new GroupProperty(this, "_Debug", "Debug", new BaseProperty[]
new GroupProperty(this, "_Iridescence", "Iridescence", new BaseProperty[]
new Property(this, "_DebugEnable", "Debug Enable", "Switch to a debug version of the shader", false),
new Property(this, "_DebugLobeMask", "DebugLobeMask", "xyz is Lobe 0 1 2 Enable, w is Enable VLayering", false),
new Property(this, "_DebugAniso", "DebugAniso", "x is Hack Enable, y is factor", false),
}),
new Property(this, "_IridescenceIor", "IOR", "Index of refraction of iridescence layer", false),
new Property(this, "_IridescenceThickness", "Thickness", "Iridescence thickness (Remap to 0..3000nm)", false),
}, _ => EnableIridescence.BoolValue == true),
new GroupProperty(this, "_SSS", "Sub-Surface Scattering", new BaseProperty[]
{

new GroupProperty(this, "_Lobe2", "Second Specular Lobe", new BaseProperty[]
{
new TextureProperty(this, k_Smoothness2Map, k_Smoothness2, "Smoothness2", "Smoothness2", false, false),
new Property(this, k_LobeMix, "Lobe Mix", "Lobe Mix", 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[]
{
new DiffusionProfileProperty(this, k_DiffusionProfile, "Diffusion Profile", "A profile determines the shape of the SSS/transmission filter.", false, _ => EnableSSS.BoolValue == false),

//new GroupProperty(this, "_Iridescence", "Iridescence", new BaseProperty[]
//{
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Index of Refraction", "Index of Refraction for Iridescence", false),
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Thickness", "Thickness", false),
//}),
new GroupProperty(this, "_Emissive", "Emissive", new BaseProperty[]
{
new TextureProperty(this, k_EmissiveColorMap, k_EmissiveColor, "Emissive Color", "Emissive", true, false),
new Property(this, k_EmissiveIntensity, "Emissive Intensity", "Emissive", false),
new Property(this, k_AlbedoAffectEmissive, "Albedo Affect Emissive", "Specifies whether or not the emissive color is multiplied by the albedo.", false),
}),
//new GroupProperty(this, "_Glint", "Glint", new BaseProperty[]
//{
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Density", "Density:", false),
// new TextureProperty(this, k_BaseColorMap, k_BaseColor, "Tint", "Tint", false),
//}),
new GroupProperty(this, "_Debug", "Debug", new BaseProperty[]
{
new Property(this, "_DebugEnable", "Debug Enable", "Switch to a debug version of the shader", false),
new Property(this, "_DebugLobeMask", "DebugLobeMask", "xyz is Lobe 0 1 2 Enable, w is Enable VLayering", false),
new Property(this, "_DebugAniso", "DebugAniso", "x is Hack Enable, y is factor", false),
}),
});
}

}
}
//NOTE: For SSS in forward and split lighting, obviously we don't have a gbuffer pass,
// so no stencil tagging there, but velocity? To check...
//TODO: stencil state, displacement, wind, depthoffset, tessellation
SetupMainTexForAlphaTestGI("_BaseColorMap", "_BaseColor", material);

CoreUtils.SetKeyword(material, "_NORMALMAP_TANGENT_SPACE", true);
CoreUtils.SetKeyword(material, "_NORMALMAP", material.GetTexture(k_NormalMap));
SetupTextureMaterialProperty(material, k_Metallic);
SetupTextureMaterialProperty(material, k_Smoothness1);
SetupTextureMaterialProperty(material, k_Smoothness2);

SetupTextureMaterialProperty(material, k_Anisotropy);
SetupTextureMaterialProperty(material, k_IridescenceThickness);
// Check if we are using specific UVs.
TextureProperty.UVMapping[] uvIndices = new[]

(TextureProperty.UVMapping) material.GetFloat(k_EmissiveColorMapUV),
(TextureProperty.UVMapping) material.GetFloat(k_SubsurfaceMaskMapUV),
(TextureProperty.UVMapping) material.GetFloat(k_ThicknessMapUV),
(TextureProperty.UVMapping) material.GetFloat(k_AnisotropyMapUV),
(TextureProperty.UVMapping) material.GetFloat(k_IridescenceThicknessMapUV),
// Set keyword for mapping
//bool requireUv2 = false;
//bool requireUv3 = false;
bool requireTriplanar = false;

//requireUv3 = requireUv3 || uvIndices[i] == TextureProperty.UVMapping.UV3;
requireTriplanar = requireTriplanar || uvIndices[i] == TextureProperty.UVMapping.Triplanar;
}
bool sssEnabled = material.GetFloat(k_EnableSubsurfaceScattering) > 0.0f;
bool dualSpecularLobeEnabled = material.HasProperty(k_EnableDualSpecularLobe) && material.GetFloat(k_EnableDualSpecularLobe) > 0.0f;
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_DUAL_SPECULAR_LOBE", dualSpecularLobeEnabled);
bool anisotropyEnabled = material.HasProperty(k_EnableAnisotropy) && material.GetFloat(k_EnableAnisotropy) > 0.0f;
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_ANISOTROPY", anisotropyEnabled);
bool iridescenceEnabled = material.HasProperty(k_EnableIridescence) && material.GetFloat(k_EnableIridescence) > 0.0f;
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_IRIDESCENCE", iridescenceEnabled);
bool transmissionEnabled = material.HasProperty(k_EnableAnisotropy) && material.GetFloat(k_EnableAnisotropy) > 0.0f;
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_TRANSMISSION", transmissionEnabled);
bool sssEnabled = material.HasProperty(k_EnableSubsurfaceScattering) && material.GetFloat(k_EnableSubsurfaceScattering) > 0.0f;
bool transmissionEnabled = material.GetFloat(k_EnableTransmission) > 0.0f;
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_TRANSMISSION", transmissionEnabled);
// TEMP - Remove once dev is finish
bool debugEnabled = material.HasProperty("_DebugEnable") && material.GetFloat("_DebugEnable") > 0.0f;
CoreUtils.SetKeyword(material, "_STACKLIT_DEBUG", debugEnabled);
// Set the reference value for the stencil test.
// Set the reference value for the stencil test - required for SSS
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);
bool debugEnabled = material.HasProperty("_DebugEnable") && (material.GetFloat("_DebugEnable") > 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);
CoreUtils.SetKeyword(material, "_STACKLIT_DEBUG", debugEnabled);
}
}
} // namespace UnityEditor

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


[GenerateHLSL(PackingRules.Exact)]
public enum MaterialFeatureFlags
{
StackLitStandard = 1 << 0,
StackLitSubsurfaceScattering = 1 << 2,
StackLitTransmission = 1 << 3,
StackLitAnisotropy = 1 << 4,
StackLitCoat = 1 << 6,
StackLitStandard = 1 << 0,
StackLitDualSpecularLobe = 1 << 1,
StackLitAnisotropy = 1 << 2,
StackLitCoat = 1 << 3,
StackLitIridescence = 1 << 4,
StackLitSubsurfaceScattering = 1 << 5,
StackLitTransmission = 1 << 6,
};
//-----------------------------------------------------------------------------

// Standard parametrization
[SurfaceDataAttributes("Base Color", false, true)]
public Vector3 baseColor;
[SurfaceDataAttributes("Ambient Occlusion")]
public float ambientOcclusion;
[SurfaceDataAttributes("Metallic")]
public float metallic;
// Dual specular love
[SurfaceDataAttributes("Smoothness B")]
public float perceptualSmoothnessB;

[SurfaceDataAttributes("Metallic")]
public float metallic;
// SSS
[SurfaceDataAttributes("Diffusion Profile")]
public uint diffusionProfile;
[SurfaceDataAttributes("Subsurface Mask")]
public float subsurfaceMask;
// Transmission
// + Diffusion Profile
[SurfaceDataAttributes("Thickness")]
public float thickness;
// Iridescence
[SurfaceDataAttributes("IridescenceIor")]
public float iridescenceIor;
[SurfaceDataAttributes("IridescenceThickness")]
public float iridescenceThickness;
// Top interface and media (clearcoat)
[SurfaceDataAttributes("Coat Roughness")]

[SurfaceDataAttributes("Coat Extinction Coefficient")]
public Vector3 coatExtinction;
[SurfaceDataAttributes("Ambient Occlusion")]
public float ambientOcclusion;
// SSS
[SurfaceDataAttributes("Diffusion Profile")]
public uint diffusionProfile;
[SurfaceDataAttributes("Subsurface Mask")]
public float subsurfaceMask;
// Transmission
// + Diffusion Profile
[SurfaceDataAttributes("Thickness")]
public float thickness;
};
//-----------------------------------------------------------------------------

public Vector3 diffuseColor;
public Vector3 fresnel0;
public float ambientOcclusion;
// Dual specular lobe
public float perceptualRoughnessB;
public float lobeMix;

public float roughnessAB;
public float roughnessBT;
public float roughnessBB;
public float coatRoughness;
public float coatRoughness;
// iridescence
public float iridescenceIor;
public float iridescenceThickness;
// SSS
public uint diffusionProfile;
public float subsurfaceMask;

public float thickness;
public bool useThickObjectMode; // Read from the diffusion profile
public Vector3 transmittance; // Precomputation of transmittance
public float ambientOcclusion;
};
//-----------------------------------------------------------------------------

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


// UnityEngine.Experimental.Rendering.HDPipeline.StackLit+MaterialFeatureFlags: static fields
//
#define MATERIALFEATUREFLAGS_STACK_LIT_STANDARD (1)
#define MATERIALFEATUREFLAGS_STACK_LIT_SUBSURFACE_SCATTERING (4)
#define MATERIALFEATUREFLAGS_STACK_LIT_TRANSMISSION (8)
#define MATERIALFEATUREFLAGS_STACK_LIT_ANISOTROPY (16)
#define MATERIALFEATUREFLAGS_STACK_LIT_COAT (64)
#define MATERIALFEATUREFLAGS_STACK_LIT_DUAL_SPECULAR_LOBE (2)
#define MATERIALFEATUREFLAGS_STACK_LIT_ANISOTROPY (4)
#define MATERIALFEATUREFLAGS_STACK_LIT_COAT (8)
#define MATERIALFEATUREFLAGS_STACK_LIT_IRIDESCENCE (16)
#define MATERIALFEATUREFLAGS_STACK_LIT_SUBSURFACE_SCATTERING (32)
#define MATERIALFEATUREFLAGS_STACK_LIT_TRANSMISSION (64)
//
// UnityEngine.Experimental.Rendering.HDPipeline.StackLit+SurfaceData: static fields

#define DEBUGVIEW_STACKLIT_SURFACEDATA_NORMAL (1302)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_NORMAL_VIEW_SPACE (1303)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_SMOOTHNESS_A (1304)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_SMOOTHNESS_B (1305)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_LOBE_MIXING (1306)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_METALLIC (1307)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_DIFFUSION_PROFILE (1308)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_SUBSURFACE_MASK (1309)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_THICKNESS (1310)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_TANGENT (1311)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_ANISOTROPY (1312)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_AMBIENT_OCCLUSION (1302)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_METALLIC (1303)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_NORMAL (1304)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_NORMAL_VIEW_SPACE (1305)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_SMOOTHNESS_A (1306)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_SMOOTHNESS_B (1307)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_LOBE_MIXING (1308)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_TANGENT (1309)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_ANISOTROPY (1310)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_IRIDESCENCE_IOR (1311)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_IRIDESCENCE_THICKNESS (1312)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_AMBIENT_OCCLUSION (1317)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_DIFFUSION_PROFILE (1317)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_SUBSURFACE_MASK (1318)
#define DEBUGVIEW_STACKLIT_SURFACEDATA_THICKNESS (1319)
//
// UnityEngine.Experimental.Rendering.HDPipeline.StackLit+BSDFData: static fields

#define DEBUGVIEW_STACKLIT_BSDFDATA_FRESNEL0 (1402)
#define DEBUGVIEW_STACKLIT_BSDFDATA_NORMAL_WS (1403)
#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_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_AMBIENT_OCCLUSION (1403)
#define DEBUGVIEW_STACKLIT_BSDFDATA_NORMAL_WS (1404)
#define DEBUGVIEW_STACKLIT_BSDFDATA_NORMAL_VIEW_SPACE (1405)
#define DEBUGVIEW_STACKLIT_BSDFDATA_PERCEPTUAL_ROUGHNESS_A (1406)
#define DEBUGVIEW_STACKLIT_BSDFDATA_PERCEPTUAL_ROUGHNESS_B (1407)
#define DEBUGVIEW_STACKLIT_BSDFDATA_LOBE_MIX (1408)
#define DEBUGVIEW_STACKLIT_BSDFDATA_TANGENT_WS (1409)
#define DEBUGVIEW_STACKLIT_BSDFDATA_BITANGENT_WS (1410)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_AT (1411)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_AB (1412)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_BT (1413)
#define DEBUGVIEW_STACKLIT_BSDFDATA_ROUGHNESS_BB (1414)
#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)
#define DEBUGVIEW_STACKLIT_BSDFDATA_DIFFUSION_PROFILE (1420)
#define DEBUGVIEW_STACKLIT_BSDFDATA_SUBSURFACE_MASK (1421)
#define DEBUGVIEW_STACKLIT_BSDFDATA_THICKNESS (1422)
#define DEBUGVIEW_STACKLIT_BSDFDATA_USE_THICK_OBJECT_MODE (1423)
#define DEBUGVIEW_STACKLIT_BSDFDATA_TRANSMITTANCE (1424)
#define DEBUGVIEW_STACKLIT_BSDFDATA_AMBIENT_OCCLUSION (1425)
#define DEBUGVIEW_STACKLIT_BSDFDATA_COAT_ROUGHNESS (1416)
#define DEBUGVIEW_STACKLIT_BSDFDATA_COAT_PERCEPTUAL_ROUGHNESS (1417)
#define DEBUGVIEW_STACKLIT_BSDFDATA_COAT_IOR (1418)
#define DEBUGVIEW_STACKLIT_BSDFDATA_COAT_THICKNESS (1419)
#define DEBUGVIEW_STACKLIT_BSDFDATA_COAT_EXTINCTION (1420)
#define DEBUGVIEW_STACKLIT_BSDFDATA_IRIDESCENCE_IOR (1421)
#define DEBUGVIEW_STACKLIT_BSDFDATA_IRIDESCENCE_THICKNESS (1422)
#define DEBUGVIEW_STACKLIT_BSDFDATA_DIFFUSION_PROFILE (1423)
#define DEBUGVIEW_STACKLIT_BSDFDATA_SUBSURFACE_MASK (1424)
#define DEBUGVIEW_STACKLIT_BSDFDATA_THICKNESS (1425)
#define DEBUGVIEW_STACKLIT_BSDFDATA_USE_THICK_OBJECT_MODE (1426)
#define DEBUGVIEW_STACKLIT_BSDFDATA_TRANSMITTANCE (1427)
// Generated from UnityEngine.Experimental.Rendering.HDPipeline.StackLit+SurfaceData
// PackingRules = Exact

float3 baseColor;
float ambientOcclusion;
float metallic;
float metallic;
uint diffusionProfile;
float subsurfaceMask;
float thickness;
float iridescenceIor;
float iridescenceThickness;
float ambientOcclusion;
uint diffusionProfile;
float subsurfaceMask;
float thickness;
};
// Generated from UnityEngine.Experimental.Rendering.HDPipeline.StackLit+BSDFData

uint materialFeatures;
float3 diffuseColor;
float3 fresnel0;
float ambientOcclusion;
float3 normalWS;
float perceptualRoughnessA;
float perceptualRoughnessB;

float roughnessAB;
float roughnessBT;
float roughnessBB;
float coatRoughness;
float coatRoughness;
float iridescenceIor;
float iridescenceThickness;
float ambientOcclusion;
};
//

result = surfacedata.baseColor;
needLinearToSRGB = true;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_AMBIENT_OCCLUSION:
result = surfacedata.ambientOcclusion.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_METALLIC:
result = surfacedata.metallic.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_NORMAL:
result = surfacedata.normalWS * 0.5 + 0.5;
break;

case DEBUGVIEW_STACKLIT_SURFACEDATA_LOBE_MIXING:
result = surfacedata.lobeMix.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_METALLIC:
result = surfacedata.metallic.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_DIFFUSION_PROFILE:
result = GetIndexColor(surfacedata.diffusionProfile);
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_SUBSURFACE_MASK:
result = surfacedata.subsurfaceMask.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_THICKNESS:
result = surfacedata.thickness.xxx;
break;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_IRIDESCENCE_IOR:
result = surfacedata.iridescenceIor.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_IRIDESCENCE_THICKNESS:
result = surfacedata.iridescenceThickness.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_ROUGHNESS:
result = surfacedata.coatPerceptualSmoothness.xxx;

case DEBUGVIEW_STACKLIT_SURFACEDATA_COAT_EXTINCTION_COEFFICIENT:
result = surfacedata.coatExtinction;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_AMBIENT_OCCLUSION:
result = surfacedata.ambientOcclusion.xxx;
case DEBUGVIEW_STACKLIT_SURFACEDATA_DIFFUSION_PROFILE:
result = GetIndexColor(surfacedata.diffusionProfile);
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_SUBSURFACE_MASK:
result = surfacedata.subsurfaceMask.xxx;
break;
case DEBUGVIEW_STACKLIT_SURFACEDATA_THICKNESS:
result = surfacedata.thickness.xxx;
break;
}
}

break;
case DEBUGVIEW_STACKLIT_BSDFDATA_FRESNEL0:
result = bsdfdata.fresnel0;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_AMBIENT_OCCLUSION:
result = bsdfdata.ambientOcclusion.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_NORMAL_WS:
result = bsdfdata.normalWS * 0.5 + 0.5;

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_ROUGHNESS:
result = bsdfdata.coatRoughness.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_COAT_PERCEPTUAL_ROUGHNESS:
result = bsdfdata.coatPerceptualRoughness.xxx;

case DEBUGVIEW_STACKLIT_BSDFDATA_COAT_EXTINCTION:
result = bsdfdata.coatExtinction;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_IRIDESCENCE_IOR:
result = bsdfdata.iridescenceIor.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_IRIDESCENCE_THICKNESS:
result = bsdfdata.iridescenceThickness.xxx;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_DIFFUSION_PROFILE:
result = GetIndexColor(bsdfdata.diffusionProfile);
break;

break;
case DEBUGVIEW_STACKLIT_BSDFDATA_TRANSMITTANCE:
result = bsdfdata.transmittance;
break;
case DEBUGVIEW_STACKLIT_BSDFDATA_AMBIENT_OCCLUSION:
result = bsdfdata.ambientOcclusion.xxx;
break;
}
}

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


[ToggleUI] _SmoothnessARemapInverted("Invert SmoothnessA Remap", Float) = 0.0
[HideInInspector] _SmoothnessARange("SmoothnessA Range", Vector) = (0, 1, 0, 0)
[ToggleUI] _EnableDualSpecularLobe("Enable Dual Specular Lobe", Float) = 0.0 // UI only
[HideInInspector] _SmoothnessBMapShow("SmoothnessB Map Show", Float) = 0
_SmoothnessB("SmoothnessB", Range(0.0, 1.0)) = 1.0
_SmoothnessBMap("SmoothnessB Map", 2D) = "white" {}

// TODO: TangentMap, AnisotropyMap and CoatIorMap (SmoothnessMap ?)
[ToggleUI] _EnableAnisotropy("Enable Anisotropy", Float) = 0.0 // UI only
_AnisotropyMap("Anisotropy Map", 2D) = "white" {}
_AnisotropyUseMap("Anisotropy Use Map", Float) = 0
_AnisotropyMapUVLocal("Anisotropy Map UV Local", Float) = 0.0
_AnisotropyMapChannel("Anisotropy Map Channel", Float) = 0.0
_AnisotropyMapChannelMask("Anisotropy Map Channel Mask", Vector) = (1, 0, 0, 0)
_AnisotropyRemap("Anisotropy Remap", Vector) = (0, 1, 0, 0)
[HideInInspector] _AnisotropyRange("Anisotropy Range", Vector) = (0, 1, 0, 0)
[ToggleUI] _CoatEnable("Coat Enable", Float) = 0.0 // UI only
[ToggleUI] _EnableCoat("Enable Coat", Float) = 0.0 // UI only
_CoatSmoothness("Coat Smoothness", Range(0.0, 1.0)) = 1.0
_CoatIor("Coat IOR", Range(1.0001, 2.0)) = 1.5
_CoatThickness("Coat Thickness", Range(0.0, 0.99)) = 0.0

_SubsurfaceMaskMapChannel("Subsurface Mask Map Channel", Float) = 0.0
_SubsurfaceMaskMapChannelMask("Subsurface Mask Map Channel Mask", Vector) = (1, 0, 0, 0)
_SubsurfaceMaskRemap("Subsurface Mask Remap", Vector) = (0, 1, 0, 0)
[ToggleUI] _SubsurfaceMaskRemapInverted("Invert Subsurface Mask Remap", Float) = 0.0
[ToggleUI] _EnableTransmission("Enable Transmission", Float) = 0.0
[HideInInspector] _ThicknessMapShow("Thickness Show", Float) = 0
_Thickness("Thickness", Range(0.0, 1.0)) = 1.0

[ToggleUI] _ThicknessRemapInverted("Invert Thickness Remap", Float) = 0.0
[HideInInspector] _ThicknessRange("Thickness Range", Vector) = (0, 1, 0, 0)
[ToggleUI] _EnableIridescence("Enable Iridescence", Float) = 0.0 // UI only
_IridescenceIor("Coat IOR", Range(1.0, 2.0)) = 1.5
_IridescenceThickness("_IridescenceThickness", Range(0.0, 1.0)) = 0.0
_IridescenceThicknessMap("IridescenceThickness Color Map", 2D) = "black" {}
_IridescenceThicknessUseMap("IridescenceThickness Use Map", Float) = 0
_IridescenceThicknessUV("IridescenceThickness Map UV", Float) = 0.0
_IridescenceThicknessLocal("IridescenceThickness Map UV Local", Float) = 0.0
_IridescenceThicknessMapChannel("IridescenceThickness Mask Map Channel", Float) = 0.0
_IridescenceThicknessMapChannelMask("IridescenceThickness Mask Map Channel Mask", Vector) = (1, 0, 0, 0)
[HideInInspector] _IridescenceThicknessRange("IridescenceThickness Range", Vector) = (0, 1, 0, 0)
_DistortionVectorMap("DistortionVectorMap", 2D) = "black" {}
[ToggleUI] _DistortionEnable("Enable Distortion", Float) = 0.0
[ToggleUI] _DistortionOnly("Distortion Only", Float) = 0.0

[HideInInspector] _CoatShow("_CoatShow", Float) = 0.0
[HideInInspector] _DebugShow("_DebugShow", Float) = 0.0
[HideInInspector] _SSSShow("_SSSShow", Float) = 0.0
[HideInInspector] _Lobe2Show("_Lobe2Show", Float) = 0.0
[HideInInspector] _DualSpecularLobeShow("_DualSpecularLobeShow", Float) = 0.0
[HideInInspector] _GlintShow("_GlintShow", Float) = 0.0
// Caution: C# code in BaseLitUI.cs call LightmapEmissionFlagsProperty() which assume that there is an existing "_EmissionColor"
// value that exist to identify if the GI emission need to be enabled.

// but we need it right away for toggle with LayerTexCoord mapping so we might need them
// from the Frag input right away. See also ShaderPass/StackLitSharePass.hlsl.
#pragma shader_feature _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
#pragma shader_feature _MATERIAL_FEATURE_TRANSMISSION
//#pragma shader_feature _EMISSIVE_COLOR_MAP
// Keyword for transparent
#pragma shader_feature _SURFACE_TYPE_TRANSPARENT
#pragma shader_feature _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY

// MaterialFeature are used as shader feature to allow compiler to optimize properly
#pragma shader_feature _MATERIAL_FEATURE_DUAL_SPECULAR_LOBE
#pragma shader_feature _MATERIAL_FEATURE_DUAL_LOBE
#pragma shader_feature _MATERIAL_FEATURE_IRIDESCENCE
#pragma shader_feature _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
#pragma shader_feature _MATERIAL_FEATURE_TRANSMISSION
#pragma shader_feature _STACKLIT_DEBUG
//enable GPU instancing support

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


#include "CoreRP/ShaderLibrary/Sampling/SampleUVMapping.hlsl"
#include "../MaterialUtilities.hlsl"
////-----------------------------------------------------------------------------
//// Texture Mapping (think of LayerTexCoord as simply TexCoordMappings,
//// ie no more layers here - cf Lit materials)
////-----------------------------------------------------------------------------
//
////
//// For easier copying of code for now use a LayerTexCoord wrapping struct.
//// We don't have details yet.
////
//// NEWLITTODO: Eventually, we could quickly share GetBuiltinData of LitBuiltinData.hlsl
//// in our GetSurfaceAndBuiltinData( ) here, since we will use the LayerTexCoord identifier,
//// and an identical ComputeLayerTexCoord( ) prototype
////
//struct LayerTexCoord
//{
// UVMapping base;
//
// // Store information that will be share by all UVMapping
// float3 vertexNormalWS; // TODO: store also object normal map for object triplanar
//};
//
//// Want to use only one sampler for normalmap/bentnormalmap either we use OS or TS. And either we have normal map or bent normal or both.
////
//// Note (compared to Lit shader):
////
//// We don't have a layered material with which we are sharing code here like the LayeredLit shader, but we can also save a couple of
//// samplers later if we use bentnormals.
////
//// _IDX suffix is meaningless here, could use the name SAMPLER_NORMALMAP_ID instead of SAMPLER_NORMALMAP_IDX and replace all
//// indirect #ifdef _NORMALMAP_TANGENT_SPACE_IDX #ifdef and _NORMALMAP_IDX tests with the more direct
//// shader_feature keywords _NORMALMAP_TANGENT_SPACE and _NORMALMAP.
////
//// (Originally in the LayeredLit shader, shader_feature keywords like _NORMALMAP become _NORMALMAP0 but since files are shared,
//// LitDataIndividualLayer will use a generic _NORMALMAP_IDX defined before its inclusion by the client LitData or LayeredLitData.
//// That way, LitDataIndividualLayer supports multiple inclusions)
#ifdef _NORMALMAP_TANGENT_SPACE
#if defined(_NORMALMAP)
#define SAMPLER_NORMALMAP_ID sampler_NormalMap
// TODO:
//#elif defined(_BENTNORMALMAP)
//#define SAMPLER_NORMALMAP_ID sampler_BentNormalMap
#endif
#else
// TODO:
//#error STACKLIT_USES_ONLY_TANGENT_SPACE_FOR_NOW
//#if defined(_NORMALMAP)
//#define SAMPLER_NORMALMAP_ID sampler_NormalMapOS
//#elif defined(_BENTNORMALMAP)
//#define SAMPLER_NORMALMAP_ID sampler_BentNormalMapOS
//#endif
#endif
//-----------------------------------------------------------------------------
// Texture Mapping
//-----------------------------------------------------------------------------

InitializeMappingData(input, uvMapping);
// -------------------------------------------------------------
// Surface Data:
// Surface Data
// -------------------------------------------------------------
float alpha = SAMPLE_TEXTURE2D_SCALE_BIAS(_BaseColorMap).a * _BaseColor.a;

DoAlphaTest(alpha, _AlphaCutoff);
#endif
// Standard
surfaceData.baseColor = SAMPLE_TEXTURE2D_SCALE_BIAS(_BaseColorMap).rgb * _BaseColor.rgb;
float3 gradient = SAMPLE_TEXTURE2D_NORMAL_SCALE_BIAS(_NormalMap, float2(_NormalScale.xx));

surfaceData.perceptualSmoothnessA = lerp(_SmoothnessARange.x, _SmoothnessARange.y, surfaceData.perceptualSmoothnessA);
surfaceData.perceptualSmoothnessA = lerp(_SmoothnessA, surfaceData.perceptualSmoothnessA, _SmoothnessAUseMap);
// TODO: Ambient occlusion, detail mask.
surfaceData.metallic = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_MetallicMap), _MetallicMapChannelMask);
surfaceData.metallic = lerp(_MetallicRange.x, _MetallicRange.y, surfaceData.metallic);
surfaceData.metallic = lerp(_Metallic, surfaceData.metallic, _MetallicUseMap);

surfaceData.ambientOcclusion = lerp(_AmbientOcclusion, surfaceData.ambientOcclusion, _AmbientOcclusionUseMap);
// These static material feature allow compile time optimization
// TODO: As we add features, or-set the flags eg MATERIALFEATUREFLAGS_STACK_LIT_* with #ifdef
// on corresponding _MATERIAL_FEATURE_* shader_feature kerwords (set by UI) so the compiler
// knows the value of surfaceData.materialFeatures.
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_STACK_LIT_SUBSURFACE_SCATTERING;
#endif
#ifdef _MATERIAL_FEATURE_TRANSMISSION
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_STACK_LIT_TRANSMISSION;
#endif
#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
// -------------------------------------------------------------
// -------------------------------------------------------------
// 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
#ifdef _MATERIAL_FEATURE_DUAL_SPECULAR_LOBE
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_STACK_LIT_DUAL_SPECULAR_LOBE;
surfaceData.lobeMix = _LobeMix;
surfaceData.perceptualSmoothnessB = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_SmoothnessBMap), _SmoothnessBMapChannelMask);
surfaceData.perceptualSmoothnessB = lerp(_SmoothnessBRange.x, _SmoothnessBRange.y, surfaceData.perceptualSmoothnessB);

surfaceData.perceptualSmoothnessB = 1.0;
#endif
// TODO: #ifdef _ANISOTROPYMAP
surfaceData.anisotropy = 1.0;
surfaceData.anisotropy *= _Anisotropy;
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_STACK_LIT_ANISOTROPY;
// TODO: manage anistropy map
//surfaceData.anisotropy = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_AnistropyMap), _AnistropyMapChannelMask);
//surfaceData.anisotropy = lerp(_AnistropyRange.x, _AnistropyRange.y, surfaceData.anisotropy);
surfaceData.anisotropy = _Anisotropy; // In all cases we must multiply anisotropy with the map
#else
surfaceData.anisotropy = 0.0;
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
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_STACK_LIT_COAT;
surfaceData.coatPerceptualSmoothness = _CoatSmoothness;
surfaceData.coatIor = _CoatIor;
surfaceData.coatThickness = _CoatThickness;

surfaceData.coatExtinction = float3(1.0, 1.0, 1.0);
#endif
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_STACK_LIT_IRIDESCENCE;
surfaceData.iridescenceIor = _IridescenceIor;
surfaceData.iridescenceThickness = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(iridescenceThicknessMap), iridescenceThicknessMapChannelMask);
surfaceData.iridescenceThickness = lerp(iridescenceThicknessRange.x, iridescenceThicknessRange.y, surfaceData.iridescenceThickness);
surfaceData.iridescenceThickness = lerp(_IridescenceThickness, surfaceData.iridescenceThickness, _IridescenceThicknessUseMap);
#else
surfaceData.iridescenceIor = 1.0;
surfaceData.iridescenceThickness = 0.0;
#endif
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) || defined(_MATERIAL_FEATURE_TRANSMISSION)
surfaceData.diffusionProfile = _DiffusionProfile;
#else
surfaceData.diffusionProfile = 0;
#endif
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_STACK_LIT_SUBSURFACE_SCATTERING;
surfaceData.subsurfaceMask = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_SubsurfaceMaskMap), _SubsurfaceMaskMapChannelMask);
surfaceData.subsurfaceMask = lerp(_SubsurfaceMaskRange.x, _SubsurfaceMaskRange.y, surfaceData.subsurfaceMask);
surfaceData.subsurfaceMask = lerp(_SubsurfaceMask, surfaceData.subsurfaceMask, _SubsurfaceMaskUseMap);
#else
surfaceData.subsurfaceMask = 0.0;
#endif
#ifdef _MATERIAL_FEATURE_TRANSMISSION
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_STACK_LIT_TRANSMISSION;
surfaceData.thickness = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_ThicknessMap), _ThicknessMapChannelMask);
surfaceData.thickness = lerp(_ThicknessRange.x, _ThicknessRange.y, surfaceData.thickness);
surfaceData.thickness = lerp(_Thickness, surfaceData.thickness, _ThicknessUseMap);
#else
surfaceData.thickness = 1.0;
#endif
// -------------------------------------------------------------
// Surface Data Part 2 (outsite GetSurfaceData( ) in Lit shader):
// -------------------------------------------------------------

surfaceData.metallic = 0.0;
}
#endif
surfaceData.diffusionProfile = _DiffusionProfile;
surfaceData.subsurfaceMask = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_SubsurfaceMaskMap), _SubsurfaceMaskMapChannelMask);
surfaceData.subsurfaceMask = lerp(_SubsurfaceMaskRange.x, _SubsurfaceMaskRange.y, surfaceData.subsurfaceMask);
surfaceData.subsurfaceMask = lerp(_SubsurfaceMask, surfaceData.subsurfaceMask, _SubsurfaceMaskUseMap);
surfaceData.thickness = dot(SAMPLE_TEXTURE2D_SCALE_BIAS(_ThicknessMap), _ThicknessMapChannelMask);
surfaceData.thickness = lerp(_ThicknessRange.x, _ThicknessRange.y, surfaceData.thickness);
surfaceData.thickness = lerp(_Thickness, surfaceData.thickness, _ThicknessUseMap);
// -------------------------------------------------------------
// Builtin Data:

正在加载...
取消
保存