浏览代码

Update the UI for iridescence

/main
Sebastien Lagarde 6 年前
当前提交
106566dc
共有 12 个文件被更改,包括 237 次插入43 次删除
  1. 76
      SampleScenes/HDTest/GraphicTest/SSS/head.OBJ.meta
  2. 8
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/CommonMaterial.hlsl
  3. 54
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/Lit/LitUI.cs
  4. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLitData.hlsl
  5. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.cs
  6. 42
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.cs.hlsl
  7. 38
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl
  8. 7
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.shader
  9. 19
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitDataIndividualLayer.hlsl
  10. 10
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitProperties.hlsl
  11. 7
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitTessellation.shader
  12. 8
      SampleScenes/HDTest/HDRenderLoopTest_Profiles.meta

76
SampleScenes/HDTest/GraphicTest/SSS/head.OBJ.meta


fileFormatVersion: 2
guid: c567c8ceaf4b2a640926180289847290
timeCreated: 1494507413
licenseType: Pro
serializedVersion: 21
serializedVersion: 22
fileIDToRecycleName:
100000: Group12
100002: Group14

4300020: Group4
4300022: Group5
4300024: Group7
2186277476908879412: ImportLogs
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Group12Mat
second: {fileID: 2100000, guid: 30f21721af7ebd0448be0dcfec0074f1, type: 2}
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Group14Mat
second: {fileID: 2100000, guid: 2ee351eaf894bd84ea7b01943fbe0563, type: 2}
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Group19Mat
second: {fileID: 2100000, guid: 3cebc5e48633f5945902c68cf16bf096, type: 2}
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Group24Mat
second: {fileID: 2100000, guid: 3c9dc1f55aa963c44b6666d154356723, type: 2}
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Group26Mat
second: {fileID: 2100000, guid: 50b1d4b20bf986149bc42528026f4305, type: 2}
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Group28Mat
second: {fileID: 2100000, guid: 91dd7c7f3843b724fa99ff46c33ffd03, type: 2}
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Group2Mat
second: {fileID: 2100000, guid: 1dba3e60230b9724eb0cc8bb6aed491a, type: 2}
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Group33Mat
second: {fileID: 2100000, guid: 28d8c86f3603f79489848d863b9cbee0, type: 2}
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Group35Mat
second: {fileID: 2100000, guid: bf6c40b91880c51499ed7632da19afec, type: 2}
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Group39Mat
second: {fileID: 2100000, guid: e7b64b2987ce9d44d924bc4a614cce75, type: 2}
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Group4Mat
second: {fileID: 2100000, guid: 3eb5f7c7baae8484cb76fd9dcd65709c, type: 2}
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Group5Mat
second: {fileID: 2100000, guid: ab0ed2eee715f5a40899e5948c2f78bd, type: 2}
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Group7Mat
second: {fileID: 2100000, guid: b76a948b681a8ec488d8ccdcc4173f4c, type: 2}
materialLocation: 0
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0

animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5

optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
indexFormat: 1
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88

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


// ior is a value between 1.0 and 2.5
// Assume air interface for top
real IORToFresnel0(real ior)
real IorToFresnel0(real ior)
real IORToFresnel0(real baseIor, real topIor)
real IorToFresnel0(real baseIor, real topIor)
{
return Sq((baseIor - topIor) / (baseIor + topIor));
}

real Fresnel0ToIOR(real fresnel0)
real Fresnel0ToIor(real fresnel0)
{
real sqrtF0 = sqrt(fresnel0);
return (1.0 + sqrtF0) / (1.0 - sqrtF0);

// This function is equivalent to IORToFresnel0(Fresnel0ToIOR(fresnel0), 1.5)
// This function is equivalent to IorToFresnel0(Fresnel0ToIor(fresnel0), 1.5)
// mean
// real sqrtF0 = sqrt(fresnel0);
// return Sq(1.0 - 5.0 * sqrtF0) / Sq(5.0 - sqrtF0);

54
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/Lit/LitUI.cs


public static GUIContent thicknessMapText = new GUIContent("Thickness map (R)", "If subsurface scattering is enabled, low values allow some light to be transmitted through the object.");
public static GUIContent thicknessRemapText = new GUIContent("Thickness Remap", "Remaps values of the thickness map from [0, 1] to the specified range.");
// Iridescence
public static GUIContent iorIridescenceText = new GUIContent("Iridescence IOR");
public static GUIContent thicknessIridescenceText = new GUIContent("Iridescence Thickness");
public static GUIContent thicknessMapIridescenceText = new GUIContent("Iridescence Thickness map");
public static GUIContent thicknessRemapIridescenceText = new GUIContent("Iridescence Thickness remap");
// Clear Coat
public static GUIContent coatMaskText = new GUIContent("Coat Mask", "Attenuate the coating effect (similar to change to IOR of 1");

// Transparency
public static string refractionModeText = "Refraction Mode";
public static GUIContent refractionIORText = new GUIContent("Index of refraction", "Index of refraction");
public static GUIContent refractionIorText = new GUIContent("Index of refraction", "Index of refraction");
public static GUIContent refractionThicknessText = new GUIContent("Refraction Thickness", "Thickness for rough refraction");
public static GUIContent refractionThicknessMultiplierText = new GUIContent("Refraction Thickness multiplier (m)", "Thickness multiplier");
public static GUIContent refractionThicknessMapText = new GUIContent("Refraction Thickness Map (R)", "Thickness multiplier");

protected MaterialProperty anisotropyMap = null;
protected const string kAnisotropyMap = "_AnisotropyMap";
protected MaterialProperty iorIridescence = null;
protected const string kIorIridescence = "_IorIridescence";
protected MaterialProperty thicknessIridescence = null;
protected const string kThicknessIridescence = "_ThicknessIridescence";
protected MaterialProperty thicknessMapIridescence = null;
protected const string kThicknessMapIridescence = "_ThicknessMapIridescence";
protected MaterialProperty thicknessRemapIridescence = null;
protected const string kThicknessRemapIridescence = "_ThicknessRemapIridescence";
protected MaterialProperty coatMask = null;
protected const string kCoatMask = "_CoatMask";
protected MaterialProperty coatMaskMap = null;

// transparency params
protected MaterialProperty ior = null;
protected const string kIOR = "_IOR";
protected const string kIor = "_Ior";
protected MaterialProperty transmittanceColor = null;
protected const string kTransmittanceColor = "_TransmittanceColor";
protected MaterialProperty transmittanceColorMap = null;

anisotropy = FindProperty(kAnisotropy, props);
anisotropyMap = FindProperty(kAnisotropyMap, props);
// Iridescence
iorIridescence = FindProperty(kIorIridescence, props);
thicknessIridescence = FindProperty(kThicknessIridescence, props);
thicknessMapIridescence = FindProperty(kThicknessMapIridescence, props);
thicknessRemapIridescence = FindProperty(kThicknessRemapIridescence, props);
// clear coat
coatMask = FindProperty(kCoatMask, props);
coatMaskMap = FindProperty(kCoatMaskMap, props);

transmittanceColorMap = FindProperty(kTransmittanceColorMap, props, false);
atDistance = FindProperty(kATDistance, props, false);
thicknessMultiplier = FindProperty(kThicknessMultiplier, props, false);
ior = FindProperty(kIOR, props, false);
ior = FindProperty(kIor, props, false);
// We reuse thickness from SSS
}

}
}
}
protected void ShaderIridescenceInputGUI()
{
m_MaterialEditor.ShaderProperty(iorIridescence, Styles.iorIridescenceText);
m_MaterialEditor.TexturePropertySingleLine(Styles.thicknessMapIridescenceText, thicknessMapIridescence);
if (thicknessMapIridescence.textureValue != null)
{
// Display the remap of texture values.
Vector2 remap = thicknessRemapIridescence.vectorValue;
EditorGUI.BeginChangeCheck();
EditorGUILayout.MinMaxSlider(Styles.thicknessRemapIridescenceText, ref remap.x, ref remap.y, 0.0f, 1.0f);
if (EditorGUI.EndChangeCheck())
{
thicknessRemapIridescence.vectorValue = remap;
}
}
else
{
// Allow the user to set the constant value of thickness if no thickness map is provided.
m_MaterialEditor.ShaderProperty(thicknessIridescence, Styles.thicknessIridescenceText);
}
}
protected void ShaderClearCoatInputGUI()
{

case BaseLitGUI.MaterialId.LitSpecular:
ShaderSpecularColorInputGUI(material);
break;
case BaseLitGUI.MaterialId.LitIridescence:
ShaderIridescenceInputGUI();
break;
default:
Debug.Assert(false, "Encountered an unsupported MaterialID.");

var mode = (Lit.RefractionMode)refractionMode.floatValue;
if (mode != Lit.RefractionMode.None)
{
m_MaterialEditor.ShaderProperty(ior, Styles.refractionIORText);
m_MaterialEditor.ShaderProperty(ior, Styles.refractionIorText);
blendMode.floatValue = (float)BlendMode.Alpha;

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLitData.hlsl


surfaceData.anisotropy = 0.0;
surfaceData.specularColor = float3(0.0, 0.0, 0.0);
surfaceData.coatMask = 0.0;
surfaceData.thicknessIrid = 0.0;
surfaceData.thicknessIridescence = 0.0;
surfaceData.iorIridescence = 1.0;
// Transparency parameters
// Use thickness from SSS

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.cs


public float anisotropy; // anisotropic ratio(0->no isotropic; 1->full anisotropy in tangent direction, -1->full anisotropy in bitangent direction)
// Iridescence
public float thicknessIrid;
[SurfaceDataAttributes("Thickness of Iridescence")]
public float thicknessIridescence;
[SurfaceDataAttributes("Index of refraction of Iridescence")]
public float iorIridescence;
// Forward property only

public float anisotropy;
// Iridescence
public float thicknessIrid;
public float thicknessIridescence;
public float iorIridescence;
// ClearCoat
public float coatRoughness; // Automatically fill

42
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.cs.hlsl


#define DEBUGVIEW_LIT_SURFACEDATA_THICKNESS (1012)
#define DEBUGVIEW_LIT_SURFACEDATA_TANGENT (1013)
#define DEBUGVIEW_LIT_SURFACEDATA_ANISOTROPY (1014)
#define DEBUGVIEW_LIT_SURFACEDATA_THICKNESS_IRID (1015)
#define DEBUGVIEW_LIT_SURFACEDATA_INDEX_OF_REFRACTION (1016)
#define DEBUGVIEW_LIT_SURFACEDATA_TRANSMITTANCE_COLOR (1017)
#define DEBUGVIEW_LIT_SURFACEDATA_TRANSMITTANCE_ABSORPTION_DISTANCE (1018)
#define DEBUGVIEW_LIT_SURFACEDATA_TRANSMITTANCE_MASK (1019)
#define DEBUGVIEW_LIT_SURFACEDATA_THICKNESS_OF_IRIDESCENCE (1015)
#define DEBUGVIEW_LIT_SURFACEDATA_INDEX_OF_REFRACTION_OF_IRIDESCENCE (1016)
#define DEBUGVIEW_LIT_SURFACEDATA_INDEX_OF_REFRACTION (1017)
#define DEBUGVIEW_LIT_SURFACEDATA_TRANSMITTANCE_COLOR (1018)
#define DEBUGVIEW_LIT_SURFACEDATA_TRANSMITTANCE_ABSORPTION_DISTANCE (1019)
#define DEBUGVIEW_LIT_SURFACEDATA_TRANSMITTANCE_MASK (1020)
//
// UnityEngine.Experimental.Rendering.HDPipeline.Lit+BSDFData: static fields

#define DEBUGVIEW_LIT_BSDFDATA_ROUGHNESS_T (1045)
#define DEBUGVIEW_LIT_BSDFDATA_ROUGHNESS_B (1046)
#define DEBUGVIEW_LIT_BSDFDATA_ANISOTROPY (1047)
#define DEBUGVIEW_LIT_BSDFDATA_THICKNESS_IRID (1048)
#define DEBUGVIEW_LIT_BSDFDATA_COAT_ROUGHNESS (1049)
#define DEBUGVIEW_LIT_BSDFDATA_IOR (1050)
#define DEBUGVIEW_LIT_BSDFDATA_ABSORPTION_COEFFICIENT (1051)
#define DEBUGVIEW_LIT_BSDFDATA_TRANSMITTANCE_MASK (1052)
#define DEBUGVIEW_LIT_BSDFDATA_THICKNESS_IRIDESCENCE (1048)
#define DEBUGVIEW_LIT_BSDFDATA_IOR_IRIDESCENCE (1049)
#define DEBUGVIEW_LIT_BSDFDATA_COAT_ROUGHNESS (1050)
#define DEBUGVIEW_LIT_BSDFDATA_IOR (1051)
#define DEBUGVIEW_LIT_BSDFDATA_ABSORPTION_COEFFICIENT (1052)
#define DEBUGVIEW_LIT_BSDFDATA_TRANSMITTANCE_MASK (1053)
//
// UnityEngine.Experimental.Rendering.HDPipeline.Lit+GBufferMaterial: static fields

float thickness;
float3 tangentWS;
float anisotropy;
float thicknessIrid;
float thicknessIridescence;
float iorIridescence;
float ior;
float3 transmittanceColor;
float atDistance;

float roughnessT;
float roughnessB;
float anisotropy;
float thicknessIrid;
float thicknessIridescence;
float iorIridescence;
float coatRoughness;
float ior;
float3 absorptionCoefficient;

case DEBUGVIEW_LIT_SURFACEDATA_ANISOTROPY:
result = surfacedata.anisotropy.xxx;
break;
case DEBUGVIEW_LIT_SURFACEDATA_THICKNESS_IRID:
result = surfacedata.thicknessIrid.xxx;
case DEBUGVIEW_LIT_SURFACEDATA_THICKNESS_OF_IRIDESCENCE:
result = surfacedata.thicknessIridescence.xxx;
break;
case DEBUGVIEW_LIT_SURFACEDATA_INDEX_OF_REFRACTION_OF_IRIDESCENCE:
result = surfacedata.iorIridescence.xxx;
break;
case DEBUGVIEW_LIT_SURFACEDATA_INDEX_OF_REFRACTION:
result = surfacedata.ior.xxx;

case DEBUGVIEW_LIT_BSDFDATA_ANISOTROPY:
result = bsdfdata.anisotropy.xxx;
break;
case DEBUGVIEW_LIT_BSDFDATA_THICKNESS_IRID:
result = bsdfdata.thicknessIrid.xxx;
case DEBUGVIEW_LIT_BSDFDATA_THICKNESS_IRIDESCENCE:
result = bsdfdata.thicknessIridescence.xxx;
break;
case DEBUGVIEW_LIT_BSDFDATA_IOR_IRIDESCENCE:
result = bsdfdata.iorIridescence.xxx;
break;
case DEBUGVIEW_LIT_BSDFDATA_COAT_ROUGHNESS:
result = bsdfdata.coatRoughness.xxx;

38
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl


bsdfData.bitangentWS = bitangentWS;
}
void FillMaterialIridescence(float thicknessIrid, inout BSDFData bsdfData)
void FillMaterialIridescence(float ior, float thickness, inout BSDFData bsdfData)
bsdfData.thicknessIrid = thicknessIrid;
bsdfData.iorIridescence = ior;
bsdfData.thicknessIridescence = thickness;
}
// Note: this modify the parameter perceptualRoughness and fresnel0, so they need to be setup

bsdfData.ior = ior;
// IOR define the fresnel0 value, so update it also for consistency (and even if not physical we still need to take into account any metal mask)
bsdfData.fresnel0 = lerp(IORToFresnel0(ior).xxx, baseColor, metallic);
bsdfData.fresnel0 = lerp(IorToFresnel0(ior).xxx, baseColor, metallic);
}
// Remap IOR in range 1..2.5 to 0..1
float RemapIor25to01(float ior)
{
return saturate((ior - 1.0) / 1.5);
}
float RemapIor01to25(float ior)
{
return ior * 1.5 + 1.0;
}
// For image based lighting, a part of the BSDF is pre-integrated.

if (HasFeatureFlag(surfaceData.materialFeatures, MATERIALFEATUREFLAGS_LIT_IRIDESCENCE))
{
FillMaterialIridescence(surfaceData.thicknessIrid, bsdfData);
FillMaterialIridescence(surfaceData.iorIridescence, surfaceData.thicknessIridescence, bsdfData);
}
if (HasFeatureFlag(surfaceData.materialFeatures, MATERIALFEATUREFLAGS_LIT_CLEAR_COAT))

{
materialFeatureId = GBUFFER_LIT_IRIDESCENCE;
outGBuffer2.rgb = float3(0.0 /* TODO: IOR */, surfaceData.thicknessIrid,
// Range of IOR is 1..2.5, so remap to 0..1
outGBuffer2.rgb = float3(RemapIor25to01(surfaceData.iorIridescence), surfaceData.thicknessIridescence,
PackFloatInt8bit(surfaceData.metallic, 0, 8));
}
else // Standard

if (HasFeatureFlag(pixelFeatureFlags, MATERIALFEATUREFLAGS_LIT_IRIDESCENCE))
{
FillMaterialIridescence(inGBuffer2.g, bsdfData);
// Range of IOR is 1..2.5
FillMaterialIridescence(RemapIor01to25(inGBuffer2.r), inGBuffer2.g, bsdfData);
}
// The neutral value of coatMask is 0 (handled by ZERO_INITIALIZE).

case DEBUGVIEW_LIT_SURFACEDATA_MATERIAL_FEATURES:
result = (surfaceData.materialFeatures.xxx) / 255.0; // Aloow to read with color picker debug mode
break;
case DEBUGVIEW_LIT_SURFACEDATA_INDEX_OF_REFRACTION_OF_IRIDESCENCE:
result = RemapIor25to01(surfaceData.iorIridescence).xxx;
break;
case DEBUGVIEW_LIT_SURFACEDATA_INDEX_OF_REFRACTION:
result = RemapIor25to01(surfaceData.ior).xxx;
break;
}
}

break;
case DEBUGVIEW_LIT_BSDFDATA_MATERIAL_FEATURES:
result = (bsdfData.materialFeatures.xxx) / 255.0; // Aloow to read with color picker debug mode
break;
case DEBUGVIEW_LIT_BSDFDATA_IOR_IRIDESCENCE:
result = RemapIor25to01(bsdfData.iorIridescence).xxx;
break;
case DEBUGVIEW_LIT_BSDFDATA_IOR:
result = RemapIor25to01(bsdfData.ior).xxx;
break;
}
}

7
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.shader


_ThicknessMap("Thickness Map", 2D) = "white" {}
_ThicknessRemap("Thickness Remap", Vector) = (0, 1, 0, 0)
_ThicknessIridescence("Thickness sridescence", Range(0.0, 1.0)) = 1.0
_ThicknessMapIridescence("Thickness Map Iridescence", 2D) = "white" {}
_ThicknessRemapIridescence("Thickness Remap Iridescence", Vector) = (0, 1, 0, 0)
_IorIridescence("Indice Of Refraction Iridescence", Range(1.0, 2.5)) = 1.0
_CoatMask("Coat Mask", Range(0.0, 1.0)) = 0.0
_CoatMaskMap("CoatMaskMap", 2D) = "white" {}

// Transparency
[Enum(None, 0, Plane, 1, Sphere, 2)]_RefractionMode("Refraction Mode", Int) = 0
_IOR("Indice Of Refraction", Range(1.0, 2.5)) = 1.0
_Ior("Indice Of Refraction", Range(1.0, 2.5)) = 1.0
_ThicknessMultiplier("Thickness Multiplier", Float) = 1.0
_TransmittanceColor("Transmittance Color", Color) = (1.0, 1.0, 1.0)
_TransmittanceColorMap("TransmittanceColorMap", 2D) = "white" {}

19
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitDataIndividualLayer.hlsl


#endif
#if HAS_REFRACTION
surfaceData.ior = _IOR;
surfaceData.ior = _Ior;
surfaceData.transmittanceColor = _TransmittanceColor;
#ifdef _TRANSMITTANCECOLORMAP
surfaceData.transmittanceColor *= SAMPLE_UVMAPPING_TEXTURE2D(ADD_IDX(_TransmittanceColorMap), ADD_ZERO_IDX(sampler_TransmittanceColorMap), ADD_IDX(layerTexCoord.base)).rgb;

surfaceData.coatMask = 0.0;
#endif
surfaceData.thicknessIrid = 0.0;
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
#ifdef _THICKNESSMAP_IRIDESCENCE_IDX
surfaceData.thicknessIridescence = SAMPLE_UVMAPPING_TEXTURE2D(ADD_IDX(_ThicknessMapIridescence), SAMPLER_THICKNESSMAP_IDX, ADD_IDX(layerTexCoord.base)).r;
surfaceData.thicknessIridescence = ADD_IDX(_ThicknessRemapIridescence).x + ADD_IDX(_ThicknessRemapIridescence).y * surfaceData.thicknessIridescence;
#else
surfaceData.thicknessIridescence = ADD_IDX(_ThicknessIridescence);
#endif
surfaceData.iorIridescence = ADD_IDX(_IorIridescence);
#else
surfaceData.thicknessIridescence = 0.0;
surfaceData.iorIridescence = 1.0;
#endif
#else // #if !defined(LAYERED_LIT_SHADER)

surfaceData.tangentWS = float3(0.0, 0.0, 0.0);
surfaceData.anisotropy = 0.0;
surfaceData.specularColor = float3(0.0, 0.0, 0.0);
surfaceData.thicknessIrid = 0.0;
surfaceData.thicknessIridescence = 0.0;
surfaceData.iorIridescence = 0.0;
surfaceData.coatMask = 0.0;
// Transparency

10
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitProperties.hlsl


TEXTURE2D(_ThicknessMap);
SAMPLER(sampler_ThicknessMap);
TEXTURE2D(_ThicknessMapIridescence);
SAMPLER(sampler_ThicknessMapIridescence);
TEXTURE2D(_SpecularColorMap);
SAMPLER(sampler_SpecularColorMap);

// Transparency
float3 _TransmittanceColor;
float _IOR;
float _Ior;
float _ATDistance;
float _ThicknessMultiplier;

float _SubsurfaceMask;
float _Thickness;
float4 _ThicknessRemap;
float _ThicknessIridescence;
float4 _ThicknessRemapIridescence;
float _IorIridescence;
float _CoatMask;

7
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitTessellation.shader


_ThicknessMap("Thickness Map", 2D) = "white" {}
_ThicknessRemap("Thickness Remap", Vector) = (0, 1, 0, 0)
_ThicknessIridescence("Thickness sridescence", Range(0.0, 1.0)) = 1.0
_ThicknessMapIridescence("Thickness Map Iridescence", 2D) = "white" {}
_ThicknessRemapIridescence("Thickness Remap Iridescence", Vector) = (0, 1, 0, 0)
_IorIridescence("Indice Of Refraction Iridescence", Range(1.0, 2.5)) = 1.0
_CoatMask("Coat Mask", Range(0.0, 1.0)) = 0.0
_CoatMaskMap("CoatMaskMap", 2D) = "white" {}

// Transparency
[Enum(None, 0, Plane, 1, Sphere, 2)]_RefractionMode("Refraction Mode", Int) = 0
_IOR("Indice Of Refraction", Range(1.0, 2.5)) = 1.0
_Ior("Indice Of Refraction", Range(1.0, 2.5)) = 1.0
_ThicknessMultiplier("Thickness Multiplier", Float) = 1.0
_TransmittanceColor("Transmittance Color", Color) = (1.0, 1.0, 1.0)
_TransmittanceColorMap("TransmittanceColorMap", 2D) = "white" {}

8
SampleScenes/HDTest/HDRenderLoopTest_Profiles.meta


fileFormatVersion: 2
guid: 56849b96579769846bb5393dddeb6e90
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存