Evgenii Golubev 8 年前
当前提交
269e987f
共有 87 个文件被更改,包括 3037 次插入655 次删除
  1. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/TilePass.cs
  2. 8
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
  3. 58
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
  4. 4
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/Editor/BaseLitUI.cs
  5. 8
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/Lit.hlsl
  6. 234
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitData.hlsl
  7. 50
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitDataInternal.hlsl
  8. 1
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitProperties.hlsl
  9. 18
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitTessellation.hlsl
  10. 6
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitTessellation.shader
  11. 5
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/ShaderPass/LitDepthPass.hlsl
  12. 5
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/ShaderPass/LitDistortionPass.hlsl
  13. 6
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/ShaderPass/LitVelocityPass.hlsl
  14. 21
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/MaterialUtilities.hlsl
  15. 4
      Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderPass/ShaderPassLightTransport.hlsl
  16. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Shadow/Shadow.hlsl
  17. 39
      Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyManager.cs
  18. 2
      Assets/ScriptableRenderLoop/ShaderLibrary/AreaLighting.hlsl
  19. 4
      Assets/ScriptableRenderLoop/ShaderLibrary/BSDF.hlsl
  20. 4
      Assets/ScriptableRenderLoop/ShaderLibrary/Common.hlsl
  21. 10
      Assets/ScriptableRenderLoop/ShaderLibrary/CommonLighting.hlsl
  22. 7
      Assets/ScriptableRenderLoop/ShaderLibrary/ImageBasedLighting.hlsl
  23. 2
      Assets/ScriptableRenderLoop/ShaderLibrary/Packing.hlsl
  24. 26
      Assets/ScriptableRenderLoop/ShaderLibrary/Tessellation.hlsl
  25. 13
      Assets/TestScenes/HDTest/GlobalIlluminationTest.unity
  26. 875
      Assets/TestScenes/HDTest/HDRenderLoopTest.unity
  27. 291
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/Terrain.mat
  28. 25
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/test details.mat
  29. 21
      Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedFlip.mat
  30. 93
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/SamplerLayerInternal.hlsl
  31. 9
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/SamplerLayerInternal.hlsl.meta
  32. 50
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/SampleLayer.hlsl
  33. 9
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/SampleLayer.hlsl.meta
  34. 93
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/SampleLayerInternal.hlsl
  35. 9
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/SampleLayerInternal.hlsl.meta
  36. 9
      Assets/TestScenes/HDTest/GraphicTest/Common.meta
  37. 9
      Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation.meta
  38. 9
      Assets/TestScenes/HDTest/GraphicTest/Two Sided.meta
  39. 9
      Assets/TestScenes/HDTest/HDRenderLoopTest.meta
  40. 9
      Assets/TestScenes/HDTest/GraphicTest/Common/Material.meta
  41. 9
      Assets/TestScenes/HDTest/GraphicTest/Common/Textures.meta
  42. 1
      Assets/TestScenes/HDTest/GraphicTest/Common/Textures/LayerMask.tga
  43. 108
      Assets/TestScenes/HDTest/GraphicTest/Common/Textures/LayerMask.tga.meta
  44. 161
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Blue.mat
  45. 8
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Blue.mat.meta
  46. 161
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Green.mat
  47. 8
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Green.mat.meta
  48. 162
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Red.mat
  49. 8
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Red.mat.meta
  50. 162
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_White.mat
  51. 8
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_White.mat.meta
  52. 339
      Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Layer-2-woord-rock.mat
  53. 9
      Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Layer-2-woord-rock.mat.meta
  54. 9
      Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material.meta
  55. 179
      Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSided.mat
  56. 8
      Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSided.mat.meta
  57. 179
      Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedMirror.mat
  58. 8
      Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedMirror.mat.meta
  59. 9
      Assets/TestScenes/HDTest/GraphicTest/Two Sided/Prefabs.meta
  60. 9
      Assets/TestScenes/HDTest/GraphicTest/Two Sided/Textures.meta
  61. 70
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LayeredLitNormalSampling.hlsl
  62. 9
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LayeredLitNormalSampling.hlsl.meta
  63. 9
      Assets/TestScenes/HDTest/GraphicTest/Common/Material/Materials.meta
  64. 0
      /Assets/TestScenes/HDTest/GraphicTest/Common/Prefabs.meta
  65. 0
      /Assets/TestScenes/HDTest/GraphicTest/Common/Material
  66. 0
      /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Prefabs/GroundLeaf.FBX
  67. 0
      /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Prefabs/GroundLeaf.FBX.meta
  68. 0
      /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Textures/GroundLeaf.tga
  69. 0
      /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Textures/GroundLeaf.tga.meta
  70. 0
      /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Textures/GroundLeaf_Normal.tga
  71. 0
      /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Textures/GroundLeaf_Normal.tga.meta
  72. 0
      /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Textures/GroundLeaf_Roughness.tga
  73. 0
      /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Textures/GroundLeaf_Roughness.tga.meta
  74. 0
      /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedFlip.mat.meta
  75. 0
      /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedFlip.mat
  76. 0
      /Assets/TestScenes/HDTest/GraphicTest/Common/Prefabs/SphereGroup.prefab
  77. 0
      /Assets/TestScenes/HDTest/GraphicTest/Common/Prefabs/SphereGroup.prefab.meta

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/TilePass.cs


public int debugViewTilesFlags = 0;
public bool enableClustered = false;
public bool disableFptlWhenClustered = true; // still useful on opaques. Should be false by default to force tile on opaque.
public bool enableBigTilePrepass = false;
public bool enableBigTilePrepass = true;
const bool k_UseDepthBuffer = true; // only has an impact when EnableClustered is true (requires a depth-prepass)
const bool k_UseAsyncCompute = true; // should not use on mobile

8
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader


[HideInInspector] _LayerCount("_LayerCount", Float) = 2.0
// WARNING
// All the following properties that concern the UV mapping are the same as in the Lit shader.
// This means that they will get overridden when synchronizing the various layers.
// To avoid this, make sure that all properties here are in the exclusion list in LayeredLitUI.SynchronizeLayerProperties
// WARNING
// All the following properties that concern the UV mapping are the same as in the Lit shader.
// This means that they will get overridden when synchronizing the various layers.
// To avoid this, make sure that all properties here are in the exclusion list in LayeredLitUI.SynchronizeLayerProperties
_TexWorldScale0("Tiling", Float) = 1.0
_TexWorldScale1("Tiling", Float) = 1.0
_TexWorldScale2("Tiling", Float) = 1.0

58
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader


_HeightOffset2("_HeightOffset2", Range(-0.3, 0.3)) = 0.0
_HeightOffset3("_HeightOffset3", Range(-0.3, 0.3)) = 0.0
_HeightFactor1("_HeightFactor1", Range(0, 5)) = 1
_HeightFactor2("_HeightFactor2", Range(0, 5)) = 1
_HeightFactor3("_HeightFactor3", Range(0, 5)) = 1
_HeightFactor1("_HeightFactor1", Float) = 1
_HeightFactor2("_HeightFactor2", Float) = 1
_HeightFactor3("_HeightFactor3", Float) = 1
_BlendSize1("_BlendSize1", Range(0, 0.30)) = 0.0
_BlendSize2("_BlendSize2", Range(0, 0.30)) = 0.0

_VertexColorHeightFactor("_VertexColorHeightFactor", Float) = 0.3
// Layer blending options V2
[ToggleOff] _UseHeightBasedBlendV2("Use Height Blend V2", Float) = 0.0
_HeightCenterOffset1("_HeightCenterOffset1", Float) = 0.0
_HeightCenterOffset2("_HeightCenterOffset2", Float) = 0.0
_HeightCenterOffset3("_HeightCenterOffset3", Float) = 0.0
_BlendUsingHeight1("_BlendUsingHeight1", Float) = 0.0
_BlendUsingHeight2("_BlendUsingHeight2", Float) = 0.0
_BlendUsingHeight3("_BlendUsingHeight3", Float) = 0.0
_InheritBaseNormal1("_InheritBaseNormal1", Range(0, 1.0)) = 0.0
_InheritBaseNormal2("_InheritBaseNormal2", Range(0, 1.0)) = 0.0
_InheritBaseNormal3("_InheritBaseNormal3", Range(0, 1.0)) = 0.0
_InheritBaseHeight1("_InheritBaseHeight1", Range(0, 1.0)) = 0.0
_InheritBaseHeight2("_InheritBaseHeight2", Range(0, 1.0)) = 0.0
_InheritBaseHeight3("_InheritBaseHeight3", Range(0, 1.0)) = 0.0
_InheritBaseColor1("_InheritBaseColor1", Range(0, 1.0)) = 0.0
_InheritBaseColor2("_InheritBaseColor2", Range(0, 1.0)) = 0.0
_InheritBaseColor3("_InheritBaseColor3", Range(0, 1.0)) = 0.0
_InheritBaseColorThreshold1("_InheritBaseColorThreshold1", Range(0, 1.0)) = 1.0
_InheritBaseColorThreshold2("_InheritBaseColorThreshold2", Range(0, 1.0)) = 1.0
_InheritBaseColorThreshold3("_InheritBaseColorThreshold3", Range(0, 1.0)) = 1.0
_MinimumOpacity1("_MinimumOpacity1", Range(0, 1.0)) = 1.0
_MinimumOpacity2("_MinimumOpacity2", Range(0, 1.0)) = 1.0
_MinimumOpacity3("_MinimumOpacity3", Range(0, 1.0)) = 1.0
_OpacityAsDensity1("_OpacityAsDensity1", Range(0, 1.0)) = 0.0
_OpacityAsDensity2("_OpacityAsDensity2", Range(0, 1.0)) = 0.0
_OpacityAsDensity3("_OpacityAsDensity3", Range(0, 1.0)) = 0.0
_DistortionVectorMap("DistortionVectorMap", 2D) = "black" {}
_EmissiveColor("EmissiveColor", Color) = (0, 0, 0)

[HideInInspector] _LayerCount("_LayerCount", Float) = 2.0
// WARNING
// All the following properties that concern the UV mapping are the same as in the Lit shader.
// This means that they will get overridden when synchronizing the various layers.
// To avoid this, make sure that all properties here are in the exclusion list in LayeredLitUI.SynchronizeLayerProperties
// WARNING
// All the following properties that concern the UV mapping are the same as in the Lit shader.
// This means that they will get overridden when synchronizing the various layers.
// To avoid this, make sure that all properties here are in the exclusion list in LayeredLitUI.SynchronizeLayerProperties
_TexWorldScale0("Tiling", Float) = 1.0
_TexWorldScale1("Tiling", Float) = 1.0
_TexWorldScale2("Tiling", Float) = 1.0

HLSLINCLUDE
#pragma target 4.5
#pragma only_renderers d3d11 ps4 metal // TEMP: unitl we go futher in dev
#pragma target 5.0
#pragma only_renderers d3d11 ps4 // TEMP: unitl we go futher in dev
#pragma shader_feature _ALPHATEST_ON
#pragma shader_feature _DISTORTION_ON

#pragma shader_feature _DETAIL_MAP
#pragma shader_feature _ _LAYER_MASK_VERTEX_COLOR_MUL _LAYER_MASK_VERTEX_COLOR_ADD
#pragma shader_feature _HEIGHT_BASED_BLEND
#pragma shader_feature _HEIGHT_BASED_BLEND_V2
#pragma shader_feature _ _LAYEREDLIT_3_LAYERS _LAYEREDLIT_4_LAYERS
#pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON

#endif
// Explicitely said that we are a layered shader as we share code between lit and layered lit
#define LAYERED_LIT_SHADER
#define LAYERED_LIT_SHADER
//-------------------------------------------------------------------------------------
// variable declaration

}
}
CustomEditor "Experimental.Rendering.HDPipeline.LayeredLitGUI"
CustomEditor "Experimental.Rendering.HDPipeline.LayeredLitGUI"
}

4
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/Editor/BaseLitUI.cs


public static GUIContent tangentMapText = new GUIContent("Tangent Map", "Tangent Map (BC5) - DXT5 for test");
public static GUIContent anisotropyText = new GUIContent("Anisotropy", "Anisotropy scale factor");
public static GUIContent anisotropyMapText = new GUIContent("Anisotropy Map (G)", "Anisotropy");
public static GUIContent anisotropyMapText = new GUIContent("Anisotropy Map (B)", "Anisotropy");
public static GUIContent detailMaskText = new GUIContent("Detail Mask (B)", "Mask for detailMap");
public static GUIContent detailMaskText = new GUIContent("Detail Mask (G)", "Mask for detailMap");
public static GUIContent detailAlbedoScaleText = new GUIContent("Detail AlbedoScale", "Detail Albedo Scale factor");
public static GUIContent detailNormalScaleText = new GUIContent("Detail NormalScale", "Normal Scale factor");
public static GUIContent detailSmoothnessScaleText = new GUIContent("Detail SmoothnessScale", "Smoothness Scale factor");

8
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/Lit.hlsl


}
else if (surfaceData.materialId == MATERIALID_LIT_SSS)
{
outGBuffer2 = float4(surfaceData.subSurfaceRadius, surfaceData.thickness, 0.0, surfaceData.subSurfaceProfile / 8.0f); // Number of profile not define yet
outGBuffer2 = float4(surfaceData.subSurfaceRadius, surfaceData.thickness, 0.0, surfaceData.subSurfaceProfile / 8.0); // Number of profile not define yet
}
else if (surfaceData.materialId == MATERIALID_LIT_CLEAR_COAT)
{

bsdfData.fresnel0 = 0.028; // TODO take from subSurfaceProfile
bsdfData.subSurfaceRadius = inGBuffer2.r;
bsdfData.thickness = inGBuffer2.g;
bsdfData.subSurfaceProfile = inGBuffer2.a * 8.0f;
bsdfData.subSurfaceProfile = inGBuffer2.a * 8.0;
}
else if (bsdfData.materialId == MATERIALID_LIT_CLEAR_COAT)
{

specularLighting = float3(0.0, 0.0, 0.0);
float3 cookieColor = float3(1.0, 1.0, 1.0);
[branch] if (lightData.shadowIndex >= 0 && illuminance > 0.0f)
[branch] if (lightData.shadowIndex >= 0 && illuminance > 0.0)
{
float shadowAttenuation = GetDirectionalShadowAttenuation(lightLoopContext, positionWS, lightData.shadowIndex, L, posInput.unPositionSS);

illuminance *= cookie.a;
}
[branch] if (illuminance > 0.0f)
[branch] if (illuminance > 0.0)
{
BSDF(V, L, positionWS, preLightData, bsdfData, diffuseLighting, specularLighting);
diffuseLighting *= (cookieColor * lightData.color) * (illuminance * lightData.diffuseScale);

234
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitData.hlsl


// Fill SurfaceData/Builtin data function
//-------------------------------------------------------------------------------------
#include "../MaterialUtilities.hlsl"
#include "../SampleLayer.hlsl"
void GetBuiltinData(FragInputs input, SurfaceData surfaceData, float alpha, float depthOffset, out BuiltinData builtinData)
{

builtinData.depthOffset = depthOffset;
}
// Gather all kind of mapping in one struct, allow to improve code readability
struct LayerUV
{
float2 uv;
// triplanar
bool isTriplanar;
float2 uvYZ;
float2 uvZX;
float2 uvXY;
};
struct LayerTexCoord
{
#ifndef LAYERED_LIT_SHADER

float3 weights;
};
float4 SampleLayer(TEXTURE2D_ARGS(layerTex, layerSampler), LayerUV layerUV, float3 weights)
{
if (layerUV.isTriplanar)
{
float4 val = float4(0.0, 0.0, 0.0, 0.0);
if (weights.x > 0.0)
val += weights.x * SAMPLE_TEXTURE2D(layerTex, layerSampler, layerUV.uvYZ);
if (weights.y > 0.0)
val += weights.y * SAMPLE_TEXTURE2D(layerTex, layerSampler, layerUV.uvZX);
if (weights.z > 0.0)
val += weights.z * SAMPLE_TEXTURE2D(layerTex, layerSampler, layerUV.uvXY);
return val;
}
else
{
return SAMPLE_TEXTURE2D(layerTex, layerSampler, layerUV.uv);
}
}
float4 SampleLayerLod(TEXTURE2D_ARGS(layerTex, layerSampler), LayerUV layerUV, float3 weights, float lod)
{
if (layerUV.isTriplanar)
{
float4 val = float4(0.0, 0.0, 0.0, 0.0);
if (weights.x > 0.0)
val += weights.x * SAMPLE_TEXTURE2D_LOD(layerTex, layerSampler, layerUV.uvYZ, lod);
if (weights.y > 0.0)
val += weights.y * SAMPLE_TEXTURE2D_LOD(layerTex, layerSampler, layerUV.uvZX, lod);
if (weights.z > 0.0)
val += weights.z * SAMPLE_TEXTURE2D_LOD(layerTex, layerSampler, layerUV.uvXY, lod);
return val;
}
else
{
return SAMPLE_TEXTURE2D_LOD(layerTex, layerSampler, layerUV.uv, lod);
}
}
#define ADD_FUNC_SUFFIX(Name) Name
#define NORMAL_SAMPLE_FUNC(layerTex, layerSampler, layerUV, bias) SAMPLE_TEXTURE2D(layerTex, layerSampler, layerUV)
#include "LayeredLitNormalSampling.hlsl"
#undef ADD_FUNC_SUFFIX
#undef NORMAL_SAMPLE_FUNC
#define ADD_FUNC_SUFFIX(Name) Name##_Bias
#define NORMAL_SAMPLE_FUNC(layerTex, layerSampler, layerUV, bias) SAMPLE_TEXTURE2D_BIAS(layerTex, layerSampler, layerUV, bias)
#include "LayeredLitNormalSampling.hlsl"
#undef ADD_FUNC_SUFFIX
#undef NORMAL_SAMPLE_FUNC
// Macro to improve readibility of surface data
#define SAMPLE_LAYER_TEXTURE2D(textureName, samplerName, coord) SampleLayer(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights)
#define SAMPLE_LAYER_TEXTURE2D_LOD(textureName, samplerName, coord, lod) SampleLayerLod(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, lod)
#define SAMPLE_LAYER_NORMALMAP(textureName, samplerName, coord, scale, useBias, bias) useBias ? SampleLayerNormal_Bias(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, scale, bias) : SampleLayerNormal(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, scale, bias)
#define SAMPLE_LAYER_NORMALMAP_AG(textureName, samplerName, coord, scale, useBias, bias) useBias ? SampleLayerNormalAG_Bias(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, scale, bias) : SampleLayerNormalAG(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, scale, bias)
#define SAMPLE_LAYER_NORMALMAP_RGB(textureName, samplerName, coord, scale, useBias, bias) useBias ? SampleLayerNormalRGB_Bias(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, scale, bias) : SampleLayerNormalRGB(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, scale, bias)
// include LitDataInternal to define GetSurfaceData
#define LAYER_INDEX 0
#define ADD_IDX(Name) Name
#define ADD_ZERO_IDX(Name) Name

#endif
}
// Calculate displacement for per vertex displacement mapping
float ComputePerVertexDisplacement(LayerTexCoord layerTexCoord, float4 vertexColor, float lod)
{
return SampleHeightmapLod(layerTexCoord, lod);
}
void GetSurfaceAndBuiltinData(FragInputs input, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData)
{
LayerTexCoord layerTexCoord;

// so it allow us to correctly deal with detail normal map and optimize the code for the layered shaders
float3 normalTS;
float alpha = GetSurfaceData(input, layerTexCoord, surfaceData, normalTS);
surfaceData.normalWS = TransformTangentToWorld(normalTS, input.tangentToWorld);
surfaceData.tangentWS = input.tangentToWorld[0].xyz;
// NdotV should not be negative for visible pixels, but it can happen due to the
// perspective projection and the normal mapping + decals. In that case, the normal
// should be modified to become valid (i.e facing the camera) to avoid weird artifacts.
// Note: certain applications (e.g. SpeedTree) make use of double-sided lighting.
// This will potentially reduce the length of the normal at edges of geometry.
bool twoSided = false;
GetShiftedNdotV(surfaceData.normalWS, V, twoSided);
// Orthonormalize the basis vectors using the Gram-Schmidt process.
// We assume that the length of the surface normal is sufficiently close to 1.
surfaceData.tangentWS = normalize(surfaceData.tangentWS - dot(surfaceData.tangentWS, surfaceData.normalWS));
GetNormalAndTangentWS(input, V, normalTS, surfaceData.normalWS, surfaceData.tangentWS);
// Caution: surfaceData must be fully initialize before calling GetBuiltinData
GetBuiltinData(input, surfaceData, alpha, depthOffset, builtinData);

#define ADD_ZERO_IDX(Name) Name##0
// Generate function for all layer
// include LitDataInternal multiple time to define the variation of GetSurfaceData for each layer
#define LAYER_INDEX 0
#define ADD_IDX(Name) Name##0
#include "LitDataInternal.hlsl"

void ComputeMaskWeights(float3 inputMasks, out float outWeights[_MAX_LAYER])
{
float masks[_MAX_LAYER];
masks[0] = 1.0f; // Layer 0 is always full
masks[0] = 1.0; // Layer 0 is always full
float left = 1.0f;
// Algorithm is like this:
// Top layer have priority on others layers
// If a top layer doesn't use the full weight, the remaining can be use by the following layer.
float weightsSum = 0.0;
for (int i = _LAYER_COUNT - 1; i > 0; --i)
for (int i = _LAYER_COUNT - 1; i >= 0; --i)
outWeights[i] = masks[i] * left;
left -= outWeights[i];
outWeights[i] = min(masks[i], (1.0 - weightsSum));
weightsSum = saturate(weightsSum + masks[i]);
outWeights[0] = left;
float3 BlendLayeredFloat3(float3 x0, float3 x1, float3 x2, float3 x3, float weight[4])
float3 BlendLayeredVector3(float3 x0, float3 x1, float3 x2, float3 x3, float weight[4])
{
float3 result = float3(0.0, 0.0, 0.0);

return result;
}
#define SURFACEDATA_BLEND_VECTOR3(surfaceData, name, mask) BlendLayeredVector3(surfaceData##0.##name, surfaceData##1.##name, surfaceData##2.##name, surfaceData##3.##name, mask);
#define SURFACEDATA_BLEND_SCALAR(surfaceData, name, mask) BlendLayeredScalar(surfaceData##0.##name, surfaceData##1.##name, surfaceData##2.##name, surfaceData##3.##name, mask);
#define PROP_BLEND_SCALAR(name, mask) BlendLayeredScalar(name##0, name##1, name##2, name##3, mask);
float ApplyHeightBasedBlend(inout float inputFactor, float previousLayerHeight, float layerHeight, float heightOffset, float heightFactor, float edgeBlendStrength, float vertexColor)
{
float finalLayerHeight = heightFactor * layerHeight + heightOffset + _VertexColorHeightFactor * (vertexColor * 2.0 - 1.0);

{
return saturate(lerp(inputMask * inputHeight * blendUsingHeight * 100, 1, inputMask * inputMask)); // 100 arbitrary scale to limit blendUsingHeight values.
}
#define SURFACEDATA_BLEND_COLOR(surfaceData, name, mask) BlendLayeredFloat3(surfaceData##0.##name, surfaceData##1.##name, surfaceData##2.##name, surfaceData##3.##name, mask);
#define SURFACEDATA_BLEND_SCALAR(surfaceData, name, mask) BlendLayeredScalar(surfaceData##0.##name, surfaceData##1.##name, surfaceData##2.##name, surfaceData##3.##name, mask);
#define PROP_BLEND_SCALAR(name, mask) BlendLayeredScalar(name##0, name##1, name##2, name##3, mask);
void GetLayerTexCoord(float2 texCoord0, float2 texCoord1, float2 texCoord2, float2 texCoord3,
float3 positionWS, float3 normalWS, out LayerTexCoord layerTexCoord)

#endif
}
float3 ComputeInheritedNormalTS(float3 normalTS0, float3 normalTS1, float3 normalTS2, float3 normalTS3, LayerTexCoord layerTexCoord, float weights[_MAX_LAYER])
float3 ComputeInheritedNormalTS(FragInputs input, float3 normalTS0, float3 normalTS1, float3 normalTS2, float3 normalTS3, LayerTexCoord layerTexCoord, float weights[_MAX_LAYER])
// float _InheritBaseLayer0 = 1.0f; // Default value for lerp when all weights but base layer are zero.
// float _InheritBaseLayer0 = 1.0; // Default value for lerp when all weights but base layer are zero.
//
// // Compute the combined inheritance factor of layers 1,2 and 3
// float inheritFactor = PROP_BLEND_SCALAR(_InheritBaseLayer, weights);

// // Blend layer 1/2/3 normals before combining to the base layer. Again we need to have a neutral value for base layer (vertex normal) in case all weights are zero.
// float3 layersNormalTS = BlendLayeredFloat3(vertexNormalTS, normalTS1, normalTS2, normalTS3, weights);
// float3 layersNormalTS = BlendLayeredVector3(vertexNormalTS, normalTS1, normalTS2, normalTS3, weights);
float inheritBaseNormal = BlendLayeredScalar(1.0f, _InheritBaseNormal1, _InheritBaseNormal2, _InheritBaseNormal3, weights);
float inheritBaseNormal = BlendLayeredScalar(1.0, _InheritBaseNormal1, _InheritBaseNormal2, _InheritBaseNormal3, weights);
float maxMipBias = 12.0f; // We arbitrarly choose the max bias for a 2048 texture. Smaller texture will bias toward vertex normal faster.
float3 inheritedBaseNormalTS = GetNormalTS0(layerTexCoord, float3(0.0, 0.0, 0.0), 0.0f, true, maxMipBias * (1.0 - inheritBaseNormal));
float maxMipBias = log2(max(_NormalMap0_TexelSize.x, _NormalMap0_TexelSize.y)) + 1.0; // TODO: Use hardware instruction here (GetDimensions) that can retunr mipmaps num ? will this be faster
float3 inheritedBaseNormalTS = GetNormalTS0(input, layerTexCoord, float3(0.0, 0.0, 0.0), 0.0, true, maxMipBias * (1.0 - inheritBaseNormal));
float3 layersNormalTS = BlendLayeredFloat3(float3(0.0, 0.0, 1.0), normalTS1, normalTS2, normalTS3, weights);
float3 layersNormalTS = BlendLayeredVector3(float3(0.0, 0.0, 1.0), normalTS1, normalTS2, normalTS3, weights);
// Add the inherited normal to the blended top layers.
normalTS = BlendNormalRNM(inheritedBaseNormalTS, layersNormalTS);
//#endif

float3 ComputeInheritedColor(float3 baseColor0, float3 baseColor1, float3 baseColor2, float3 baseColor3, float compoMask, LayerTexCoord layerTexCoord, float weights[_MAX_LAYER])
{
//return BlendLayeredFloat3(baseColor0, baseColor1, baseColor2, baseColor3, weights);
float inheritBaseColor = BlendLayeredScalar(1.0, _InheritBaseColor1, _InheritBaseColor2, _InheritBaseColor3, weights);
float inheritBaseColorThreshold = BlendLayeredScalar(1.0, _InheritBaseColorThreshold1, _InheritBaseColorThreshold2, _InheritBaseColorThreshold3, weights);
inheritBaseColor = inheritBaseColor * (1.0 - saturate(compoMask / inheritBaseColorThreshold));
// We want to calculate the mean color of the texture. For this we will sample a low mipmap
float textureBias = 16.0; // Force a high number to be sure we get the lowest mip
float3 baseMeanColor0 = SAMPLE_LAYER_TEXTURE2D_BIAS(_BaseColorMap0, sampler_BaseColorMap0, layerTexCoord.base0, textureBias).rgb * _BaseColor0.rgb;
float3 baseMeanColor1 = SAMPLE_LAYER_TEXTURE2D_BIAS(_BaseColorMap1, sampler_BaseColorMap0, layerTexCoord.base1, textureBias).rgb * _BaseColor1.rgb;
float3 baseMeanColor2 = SAMPLE_LAYER_TEXTURE2D_BIAS(_BaseColorMap2, sampler_BaseColorMap0, layerTexCoord.base2, textureBias).rgb * _BaseColor2.rgb;
float3 baseMeanColor3 = SAMPLE_LAYER_TEXTURE2D_BIAS(_BaseColorMap3, sampler_BaseColorMap0, layerTexCoord.base3, textureBias).rgb * _BaseColor3.rgb;
float3 meanColor = BlendLayeredVector3(baseMeanColor0, baseMeanColor1, baseMeanColor2, baseMeanColor3, weights);
float3 baseColor = BlendLayeredVector3(baseColor0, baseColor1, baseColor2, baseColor3, weights);
// If we inherit from base layer, we will add a bit of it
return inheritBaseColor * (baseColor0 - meanColor) + baseColor;
}
float inheritBaseColor = BlendLayeredScalar(1.0f, _InheritBaseColor1, _InheritBaseColor2, _InheritBaseColor3, weights);
float inheritBaseColorThreshold = BlendLayeredScalar(1.0f, _InheritBaseColorThreshold1, _InheritBaseColorThreshold2, _InheritBaseColorThreshold3, weights);
// Calculate displacement for per vertex displacement mapping
float ComputePerVertexDisplacement(LayerTexCoord layerTexCoord, float4 vertexColor, float lod)
{
float height0 = SampleHeightmapLod0(layerTexCoord, lod);
float height1 = SampleHeightmapLod1(layerTexCoord, lod, _HeightCenterOffset1, _HeightFactor1);
float height2 = SampleHeightmapLod2(layerTexCoord, lod, _HeightCenterOffset2, _HeightFactor2);
float height3 = SampleHeightmapLod3(layerTexCoord, lod, _HeightCenterOffset3, _HeightFactor3);
inheritBaseColor = inheritBaseColor * (1.0 - saturate(compoMask / inheritBaseColorThreshold));
float4 heights = float4(height0, height1, height2, height3);
// Mask Values : Layer 1, 2, 3 are r, g, b
float3 inputMaskValues = SAMPLE_LAYER_TEXTURE2D_LOD(_LayerMaskMap, sampler_LayerMaskMap, layerTexCoord.base0, lod).rgb;
float textureBias = 12.0f;
float3 baseMeanColor0 = SAMPLE_TEXTURE2D_BIAS(_BaseColorMap0, sampler_BaseColorMap0, layerTexCoord.base0.uv, textureBias).rgb * _BaseColor0.rgb;
float3 baseMeanColor1 = SAMPLE_TEXTURE2D_BIAS(_BaseColorMap1, sampler_BaseColorMap0, layerTexCoord.base1.uv, textureBias).rgb * _BaseColor1.rgb;
float3 baseMeanColor2 = SAMPLE_TEXTURE2D_BIAS(_BaseColorMap2, sampler_BaseColorMap0, layerTexCoord.base2.uv, textureBias).rgb * _BaseColor2.rgb;
float3 baseMeanColor3 = SAMPLE_TEXTURE2D_BIAS(_BaseColorMap3, sampler_BaseColorMap0, layerTexCoord.base3.uv, textureBias).rgb * _BaseColor3.rgb;
// Mutually exclusive with _HEIGHT_BASED_BLEND
#if defined(_LAYER_MASK_VERTEX_COLOR_MUL) // Used when no layer mask is set
inputMaskValues *= vertexColor.rgb;
#elif defined(_LAYER_MASK_VERTEX_COLOR_ADD) || defined(_HEIGHT_BASED_BLEND_V2) // When layer mask is set, color is additive to enable user to override it.
inputMaskValues = saturate(inputMaskValues + vertexColor.rgb * 2.0 - 1.0);
#endif
//float3 toto1 = lerp(baseMeanColor1, baseMeanColor0, _InheritBaseColor1) + baseColor1 - baseMeanColor1;
//float3 toto2 = lerp(baseMeanColor2, baseMeanColor0, _InheritBaseColor2) + baseColor2 - baseMeanColor2;
//float3 toto3 = lerp(baseMeanColor3, baseMeanColor0, _InheritBaseColor3) + baseColor3 - baseMeanColor3;
float weights[_MAX_LAYER];
ComputeMaskWeights(inputMaskValues, weights);
//return BlendLayeredFloat3(baseColor0, toto1, toto3, toto3, weights);
float heightResult = BlendLayeredScalar(height0, height1, height2, height3, weights);
float3 meanColor = BlendLayeredFloat3(baseMeanColor0, baseMeanColor1, baseMeanColor2, baseMeanColor3, weights);
float3 baseColor = BlendLayeredFloat3(baseColor0, baseColor1, baseColor2, baseColor3, weights);
#if defined(_HEIGHT_BASED_BLEND_V2)
// Think that inheritbasedheight will be 0 if height0 is fully visible in weights. So there is no double contribution of height0
float inheritBaseHeight = BlendLayeredScalar(0.0, _InheritBaseHeight1, _InheritBaseHeight2, _InheritBaseHeight3, weights);
return heightResult + height0 * inheritBaseHeight;
#endif
//return lerp(baseMeanColor1, baseColor0, _InheritBaseColor1) + (baseColor1 - baseMeanColor1);
return lerp(meanColor, baseColor0, inheritBaseColor) + (baseColor - meanColor);
return heightResult;
// Calculate weights to apply to each layer
// Caution: This function must not be use for per vertex of per pixel displacement, there is a dedicated function for them.
// this function handle triplanar
void ComputeLayerWeights(FragInputs input, LayerTexCoord layerTexCoord, float4 inputAlphaMask, out float outWeights[_MAX_LAYER])
{
float height0 = SampleHeightmap0(layerTexCoord);

float4 heights = float4(height0, height1, height2, height3);
// Mask Values : Layer 1, 2, 3 are r, g, b
float3 inputMaskValues = SAMPLE_TEXTURE2D(_LayerMaskMap, sampler_LayerMaskMap, input.texCoord0).rgb;
// Always use layer0 parametrization for the mask
float3 inputMaskValues = SAMPLE_LAYER_TEXTURE2D(_LayerMaskMap, sampler_LayerMaskMap, layerTexCoord.base0).rgb;
// Mutually exclusive with _HEIGHT_BASED_BLEND
#if defined(_LAYER_MASK_VERTEX_COLOR_MUL) // Used when no layer mask is set

#endif
ComputeMaskWeights(inputMaskValues, outWeights);
//#if defined(_HEIGHT_BASED_BLEND_V2)
// float inheritBaseHeight = BlendLayeredScalar(0.0f, _InheritBaseHeight1, _InheritBaseHeight2, _InheritBaseHeight3, weights);
// float blendedLayerHeight = BlendLayeredScalar(heights.x, heights.y, heights.z, heights.w, weights);
// float finalHeight = heights.x * inheritBaseHeight + blendedLayerHeight;
// // Use this for POM/Tesselation
//#endif
}
void GetSurfaceAndBuiltinData(FragInputs input, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData)

#if defined(_HEIGHT_BASED_BLEND)
surfaceData.baseColor = ComputeInheritedColor(surfaceData0.baseColor, surfaceData1.baseColor, surfaceData2.baseColor, surfaceData3.baseColor, alpha, layerTexCoord, weights);
#else
surfaceData.baseColor = SURFACEDATA_BLEND_COLOR(surfaceData, baseColor, weights);
surfaceData.baseColor = SURFACEDATA_BLEND_VECTOR3(surfaceData, baseColor, weights);
#endif
surfaceData.specularOcclusion = SURFACEDATA_BLEND_SCALAR(surfaceData, specularOcclusion, weights);
surfaceData.perceptualSmoothness = SURFACEDATA_BLEND_SCALAR(surfaceData, perceptualSmoothness, weights);

float3 normalTS;
#if defined(_HEIGHT_BASED_BLEND)
normalTS = ComputeInheritedNormalTS(normalTS0, normalTS1, normalTS2, normalTS3, layerTexCoord, weights);
normalTS = ComputeInheritedNormalTS(input, normalTS0, normalTS1, normalTS2, normalTS3, layerTexCoord, weights);
normalTS = BlendLayeredFloat3(normalTS0, normalTS1, normalTS2, normalTS3, weights);
normalTS = BlendLayeredVector3(normalTS0, normalTS1, normalTS2, normalTS3, weights);
surfaceData.normalWS = TransformTangentToWorld(normalTS, input.tangentToWorld);
surfaceData.tangentWS = input.tangentToWorld[0].xyz;
// NdotV should not be negative for visible pixels, but it can happen due to the
// perspective projection and the normal mapping + decals. In that case, the normal
// should be modified to become valid (i.e facing the camera) to avoid weird artifacts.
// Note: certain applications (e.g. SpeedTree) make use of double-sided lighting.
// This will potentially reduce the length of the normal at edges of geometry.
bool twoSided = false;
GetShiftedNdotV(surfaceData.normalWS, V, twoSided);
// Orthonormalize the basis vectors using the Gram-Schmidt process.
// We assume that the length of the surface normal is sufficiently close to 1.
surfaceData.tangentWS = normalize(surfaceData.tangentWS - dot(surfaceData.tangentWS, surfaceData.normalWS));
surfaceData.tangentWS = normalize(input.tangentToWorld[0].xyz);
surfaceData.materialId = 0;
surfaceData.anisotropy = 0;
surfaceData.specular = 0.04;

surfaceData.coatNormalWS = float3(1.0, 0.0, 0.0);
surfaceData.coatPerceptualSmoothness = 1.0;
surfaceData.specularColor = float3(0.0, 0.0, 0.0);
GetNormalAndTangentWS(input, V, normalTS, surfaceData.normalWS, surfaceData.tangentWS);
GetBuiltinData(input, surfaceData, alpha, depthOffset, builtinData);
}

50
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitDataInternal.hlsl


ADD_IDX(layerTexCoord.details).uvXY = TRANSFORM_TEX(uvXY, ADD_IDX(_DetailMap));
}
float ADD_IDX(SampleHeightmap)(LayerTexCoord layerTexCoord, float centerOffset = 0.0f, float multiplier = 1.0f)
float ADD_IDX(SampleHeightmap)(LayerTexCoord layerTexCoord, float centerOffset = 0.0, float multiplier = 1.0)
{
#ifdef _HEIGHTMAP
return (SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_HeightMap), ADD_ZERO_IDX(sampler_HeightMap), ADD_IDX(layerTexCoord.base)).r - ADD_IDX(_HeightCenter) - centerOffset) * ADD_IDX(_HeightAmplitude) * multiplier;
#else
return 0.0;
#endif
}
float ADD_IDX(SampleHeightmapLod)(LayerTexCoord layerTexCoord, float lod, float centerOffset = 0.0, float multiplier = 1.0)
return (SAMPLE_TEXTURE2D(ADD_IDX(_HeightMap), ADD_ZERO_IDX(sampler_HeightMap), ADD_IDX(layerTexCoord.base).uv).r - ADD_IDX(_HeightCenter) - centerOffset) * ADD_IDX(_HeightAmplitude) * multiplier;
return (SAMPLE_LAYER_TEXTURE2D_LOD(ADD_IDX(_HeightMap), ADD_ZERO_IDX(sampler_HeightMap), ADD_IDX(layerTexCoord.base), lod).r - ADD_IDX(_HeightCenter) - centerOffset) * ADD_IDX(_HeightAmplitude) * multiplier;
// Note: The sampling of heightmap inside POM don't use sampling abstraction (with triplanar) as
// POM must be apply separately for each uv set (so 3 time for triplanar)
void ADD_IDX(ParallaxOcclusionMappingLayer)(inout LayerTexCoord layerTexCoord, int numSteps, float3 viewDirTS)
{
// Convention: 1.0 is top, 0.0 is bottom - POM is always inward, no extrusion

#ifdef _NORMALMAP
#ifdef _NORMALMAP_TANGENT_SPACE
normalTS = SAMPLE_LAYER_NORMALMAP(ADD_IDX(_NormalMap), ADD_ZERO_IDX(sampler_NormalMap), ADD_IDX(layerTexCoord.base), ADD_ZERO_IDX(_NormalScale), useBias, bias);
if (useBias)
{
normalTS = SAMPLE_LAYER_NORMALMAP_BIAS(ADD_IDX(_NormalMap), ADD_ZERO_IDX(sampler_NormalMap), ADD_IDX(layerTexCoord.base), ADD_ZERO_IDX(_NormalScale), bias);
}
else
{
normalTS = SAMPLE_LAYER_NORMALMAP(ADD_IDX(_NormalMap), ADD_ZERO_IDX(sampler_NormalMap), ADD_IDX(layerTexCoord.base), ADD_ZERO_IDX(_NormalScale));
}
float3 normalOS = SAMPLE_LAYER_NORMALMAP_RGB(ADD_IDX(_NormalMap), ADD_ZERO_IDX(sampler_NormalMap), ADD_IDX(layerTexCoord.base), ADD_ZERO_IDX(_NormalScale), useBias, bias).rgb;
normalTS = TransformObjectToTangent(normalOS, input.tangentToWorld);
// to be able to combine object space normal with detail map we transform it to tangent space (object space normal composition is not simple).
// then later we will re-transform it to world space.
if (useBias)
{
float3 normalOS = SAMPLE_LAYER_NORMALMAP_RGB_BIAS(ADD_IDX(_NormalMap), ADD_ZERO_IDX(sampler_NormalMap), ADD_IDX(layerTexCoord.base), ADD_ZERO_IDX(_NormalScale), bias).rgb;
normalTS = TransformObjectToTangent(normalOS, input.tangentToWorld);
}
else
{
float3 normalOS = SAMPLE_LAYER_NORMALMAP_RGB(ADD_IDX(_NormalMap), ADD_ZERO_IDX(sampler_NormalMap), ADD_IDX(layerTexCoord.base), ADD_ZERO_IDX(_NormalScale)).rgb;
normalTS = TransformObjectToTangent(normalOS, input.tangentToWorld);
}
#endif
#ifdef _DETAIL_MAP

#endif
// TODO : Test if GetOddNegativeScale() is necessary here in case of normal map, as GetOddNegativeScale is take into account in CreateTangentToWorld();
normalTS = input.isFrontFace ?
(GetOddNegativeScale() >= 0.0 ? normalTS : oppositeNormalTS) :
(-GetOddNegativeScale() >= 0.0 ? normalTS : oppositeNormalTS);
(GetOddNegativeScale() >= 0.0 ? normalTS : oppositeNormalTS) :
(-GetOddNegativeScale() >= 0.0 ? normalTS : oppositeNormalTS);
#endif
return normalTS;

float3 detailNormalTS = float3(0.0, 0.0, 0.0);
float detailMask = 0.0;
#ifdef _DETAIL_MAP
detailMask = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_DetailMask), ADD_ZERO_IDX(sampler_DetailMask), ADD_IDX(layerTexCoord.base)).b;
detailMask = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_DetailMask), ADD_ZERO_IDX(sampler_DetailMask), ADD_IDX(layerTexCoord.base)).g;
float2 detailAlbedoAndSmoothness = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_DetailMap), ADD_ZERO_IDX(sampler_DetailMap), ADD_IDX(layerTexCoord.details)).rb;
float detailAlbedo = detailAlbedoAndSmoothness.r;
float detailSmoothness = detailAlbedoAndSmoothness.g;

detailNormalTS = SAMPLE_LAYER_NORMALMAP_AG(ADD_IDX(_DetailMap), ADD_ZERO_IDX(sampler_DetailMap), ADD_IDX(layerTexCoord.details), ADD_ZERO_IDX(_DetailNormalScale), false, 0.0f);
detailNormalTS = SAMPLE_LAYER_NORMALMAP_AG(ADD_IDX(_DetailMap), ADD_ZERO_IDX(sampler_DetailMap), ADD_IDX(layerTexCoord.details), ADD_ZERO_IDX(_DetailNormalScale));
//float detailAO = 0.0;
#else
// TODO: Use heightmap as a derivative with Morten Mikklesen approach, how this work with our abstraction and triplanar ?

surfaceData.normalWS = float3(0.0, 0.0, 0.0); // Need to init this so that the compiler leaves us alone.
// TODO: think about using BC5
normalTS = ADD_IDX(GetNormalTS)(input, layerTexCoord, detailNormalTS, detailMask, false, 0.0f);
normalTS = ADD_IDX(GetNormalTS)(input, layerTexCoord, detailNormalTS, detailMask, false, 0.0);
#ifdef _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
surfaceData.perceptualSmoothness = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_BaseColorMap), ADD_ZERO_IDX(sampler_BaseColorMap), ADD_IDX(layerTexCoord.base)).a;

// TODO: Is there anything todo regarding flip normal but for the tangent ?
#ifdef _ANISOTROPYMAP
surfaceData.anisotropy = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_AnisotropyMap), ADD_ZERO_IDX(sampler_AnisotropyMap), ADD_IDX(layerTexCoord.base)).g;
surfaceData.anisotropy = SAMPLE_LAYER_TEXTURE2D(ADD_IDX(_AnisotropyMap), ADD_ZERO_IDX(sampler_AnisotropyMap), ADD_IDX(layerTexCoord.base)).b;
#else
surfaceData.anisotropy = 1.0;
#endif

1
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitProperties.hlsl


PROP_DECL_TEX2D(_NormalMap);
PROP_DECL(float, _NormalScale);
float4 _NormalMap0_TexelSize; // Unity facility. This will provide the size of the base normal to the shader
PROP_DECL_TEX2D(_HeightMap);
float4 _HeightMap0_TexelSize;

18
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitTessellation.hlsl


input.normalWS,
layerTexCoord);
// TODO: For now just use Layer0, but we are suppose to apply the same heightmap blending than in the pixel shader
#ifdef _HEIGHTMAP
// TODO test mip lod to reduce texture cache miss
//float dist = distance(input.positionWS, cameraPosWS);
// No ddx/ddy to calculate LOD, use camera distance instead
//float fadeDist = _TessellationFactorMaxDistance - _TessellationFactorMinDistance;
//float heightMapLod = saturate((dist - _TessellationFactorMinDistance) / min(fadeDist, 0.01)) * 6; // 6 is an arbitrary number here
float heightMapLod = 0.0;
float height = (SAMPLE_LAYER_TEXTURE2D_LOD(ADD_ZERO_IDX(_HeightMap), ADD_ZERO_IDX(sampler_HeightMap), ADD_ZERO_IDX(layerTexCoord.base), heightMapLod).r - ADD_ZERO_IDX(_HeightCenter)) * ADD_ZERO_IDX(_HeightAmplitude);
#else
float height = 0.0;
float lod = 0.0;
float4 vertexColor = float4(0.0, 0.0, 0.0, 0.0);
#ifdef VARYINGS_DS_NEED_COLOR
vertexColor = input.color;
float height = ComputePerVertexDisplacement(layerTexCoord, vertexColor, lod);
float3 displ = height * input.normalWS;
// Applying scaling of the object if requested

6
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitTessellation.shader


ENDHLSL
}
Pass
{
Name "ShadowCaster"

ENDHLSL
}
Pass
{
Name "Motion Vectors"

ENDHLSL
}
Pass
{
Name "Distortion" // Name is not used

5
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/ShaderPass/LitDepthPass.hlsl


// Attributes
#define REQUIRE_UV_FOR_TESSELATION (defined(TESSELLATION_ON) && (defined(_TESSELLATION_DISPLACEMENT) || defined(_TESSELLATION_DISPLACEMENT_PHONG)))
#define REQUIRE_VERTEX_COLOR_FOR_TESSELATION REQUIRE_UV_FOR_TESSELATION
#define REQUIRE_TANGENT_TO_WORLD (defined(_HEIGHTMAP) && defined(_PER_PIXEL_DISPLACEMENT))
// This first set of define allow to say which attributes will be use by the mesh in the vertex and domain shader (for tesselation)

#define ATTRIBUTES_NEED_TEXCOORD3
#endif
#endif
#endif
#if REQUIRE_VERTEX_COLOR_FOR_TESSELATION
#define ATTRIBUTES_NEED_COLOR
#endif
// Varying - Use for pixel shader

5
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/ShaderPass/LitDistortionPass.hlsl


// Attributes
#define REQUIRE_UV_FOR_TESSELATION (defined(TESSELLATION_ON) && (defined(_TESSELLATION_DISPLACEMENT) || defined(_TESSELLATION_DISPLACEMENT_PHONG)))
#define REQUIRE_VERTEX_COLOR_FOR_TESSELATION REQUIRE_UV_FOR_TESSELATION
#define REQUIRE_TANGENT_TO_WORLD (defined(_HEIGHTMAP) && defined(_PER_PIXEL_DISPLACEMENT))
// This first set of define allow to say which attributes will be use by the mesh in the vertex and domain shader (for tesselation)

#define ATTRIBUTES_NEED_TEXCOORD3
#endif
#endif
#endif
#if REQUIRE_VERTEX_COLOR_FOR_TESSELATION
#define ATTRIBUTES_NEED_COLOR
#endif
// Varying - Use for pixel shader

6
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/ShaderPass/LitVelocityPass.hlsl


// Attributes
#define REQUIRE_UV_FOR_TESSELATION (defined(TESSELLATION_ON) && (defined(_TESSELLATION_DISPLACEMENT) || defined(_TESSELLATION_DISPLACEMENT_PHONG)))
#define REQUIRE_VERTEX_COLOR_FOR_TESSELATION REQUIRE_UV_FOR_TESSELATION
#define REQUIRE_TANGENT_TO_WORLD 0 /* (defined(_HEIGHTMAP) && defined(_PER_PIXEL_DISPLACEMENT)) */
// This first set of define allow to say which attributes will be use by the mesh in the vertex and domain shader (for tesselation)

#endif
#endif
#endif
#if REQUIRE_VERTEX_COLOR_FOR_TESSELATION
#define ATTRIBUTES_NEED_COLOR
#endif
// Varying - Use for pixel shader
// This second set of define allow to say which varyings will be output in the vertex (no more tesselation)

21
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/MaterialUtilities.hlsl


// TODO: Move all this to C++!
float4x4 identity = 0;
identity._m00_m11_m22_m33 = 1.0;
float4x4 WorldToTexture = (unity_ProbeVolumeParams.y == 1.0f) ? unity_ProbeVolumeWorldToObject : identity;
float4x4 WorldToTexture = (unity_ProbeVolumeParams.y == 1.0) ? unity_ProbeVolumeWorldToObject : identity;
float4x4 translation = identity;
translation._m30_m31_m32 = -unity_ProbeVolumeMin.xyz;

#else
return float2(0.0, 0.0);
#endif
}
}
// This function convert the tangent space normal/tangent to world space and orthonormalize it + apply a correction of the normal if it is not pointing towards the near plane
void GetNormalAndTangentWS(FragInputs input, float3 V, float3 normalTS, inout float3 normalWS, inout float3 tangentWS, bool twoSided = false)
{
normalWS = TransformTangentToWorld(normalTS, input.tangentToWorld);
// NdotV should not be negative for visible pixels, but it can happen due to the
// perspective projection and the normal mapping + decals. In that case, the normal
// should be modified to become valid (i.e facing the camera) to avoid weird artifacts.
// Note: certain applications (e.g. SpeedTree) require to still have negative normal to perform their own two sided lighting
// This will potentially reduce the length of the normal at edges of geometry.
GetShiftedNdotV(normalWS, V, twoSided);
// Orthonormalize the basis vectors using the Gram-Schmidt process.
// We assume that the length of the surface normal is sufficiently close to 1.
tangentWS = normalize(tangentWS - dot(tangentWS, normalWS));
}

4
Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderPass/ShaderPassLightTransport.hlsl


inputMesh.positionOS.xy = inputMesh.uv1 * unity_LightmapST.xy + unity_LightmapST.zw;
// OpenGL right now needs to actually use incoming vertex position,
// so use it in a very dummy way
//v.positionOS.z = vertex.z > 0 ? 1.0e-4f : 0.0f;
//v.positionOS.z = vertex.z > 0 ? 1.0e-4 : 0.0;
}
if (unity_MetaVertexControl.y)
{

//v.positionOS.z = vertex.z > 0 ? 1.0e-4f : 0.0f;
//v.positionOS.z = vertex.z > 0 ? 1.0e-4 : 0.0;
}
float3 positionWS = TransformObjectToWorld(inputMesh.positionOS);

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Shadow/Shadow.hlsl


// - Could be return by GetShadowTextureCoordinate() and pass to GetPunctualShadowAttenuation(). But in this case, who control the atlas application ?
// TODO:
// Caution: formula doesn't work as we are texture atlas...
// if (max3(abs(NDC.x), abs(NDC.y), 1.0f - texCoordXYZ.z) <= 1.0f) return 1.0;
// if (max3(abs(NDC.x), abs(NDC.y), 1.0 - texCoordXYZ.z) <= 1.0) return 1.0;

39
Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyManager.cs


Vector3[] lookAtList = {
new Vector3(1.0f, 0.0f, 0.0f),
new Vector3(-1.0f, 0.0f, 0.0f),
new Vector3(0.0f, -1.0f, 0.0f),
new Vector3(0.0f, -1.0f, 0.0f),
new Vector3(0.0f, -1.0f, 0.0f),
new Vector3(0.0f, -1.0f, 0.0f),
new Vector3(0.0f, 1.0f, 0.0f),
new Vector3(0.0f, 1.0f, 0.0f),
new Vector3(0.0f, -1.0f, 0.0f),
new Vector3(0.0f, -1.0f, 0.0f),
new Vector3(0.0f, 1.0f, 0.0f),
new Vector3(0.0f, 1.0f, 0.0f),
};
for (int i = 0; i < 6; ++i)

m_faceCameraInvViewProjectionMatrix[i] = m_faceCameraViewProjectionMatrix[i].inverse;
m_CubemapFaceMesh[i] = BuildSkyMesh(Vector3.zero, m_faceCameraInvViewProjectionMatrix[i], false);
m_CubemapFaceMesh[i] = BuildSkyMesh(Vector3.zero, m_faceCameraInvViewProjectionMatrix[i], true);
}
}
}

m_iblFilterGgx.Initialize(renderContext);
}
// Copy the first mip.
// WARNING:
// Since we can't instanciate the parameters anymore (we don't know the final type here)
// we can't make sure that exposure/multiplier etc are at neutral values
// This will be solved with proper CopyTexture
// TEMP code until CopyTexture is implemented for command buffer
// All parameters are neutral because exposure/multiplier have already been applied in the first copy.
//SkyParameters skyParams = new SkyParameters();
//skyParams.exposure = 0.0f;
//skyParams.multiplier = 1.0f;
//skyParams.rotation = 0.0f;
//skyParams.skyHDRI = input;
RenderSkyToCubemap(builtinParams, skyParams, target);
// End temp
//for (int f = 0; f < 6; f++)
// Graphics.CopyTexture(input, f, 0, target, f, 0);
// Copy the first mip
var cmd = new CommandBuffer { name = "" };
for (int f = 0; f < 6; f++)
{
cmd.CopyTexture(input, f, 0, target, f, 0);
}
renderContext.ExecuteCommandBuffer(cmd);
cmd.Dispose();
if (m_useMIS)
{

2
Assets/ScriptableRenderLoop/ShaderLibrary/AreaLighting.hlsl


// Clamp to avoid artifacts. This particular constant gives the best results.
cosTheta = Clamp(cosTheta, -0.9999, 0.9999);
float theta = FastACos(cosTheta);
float res = cross(v1, v2).z * theta * rsqrt(1.0f - cosTheta * cosTheta); // optimization from * 1 / sin(theta)
float res = cross(v1, v2).z * theta * rsqrt(1.0 - cosTheta * cosTheta); // optimization from * 1 / sin(theta)
return res;
}

4
Assets/ScriptableRenderLoop/ShaderLibrary/BSDF.hlsl


float lambdaV = NdotL * sqrt((-NdotV * a2 + NdotV) * NdotV + a2);
float lambdaL = NdotV * sqrt((-NdotL * a2 + NdotL) * NdotL + a2);
// Simplify visibility term: (2.0f * NdotL * NdotV) / ((4.0f * NdotL * NdotV) * (lambda_v + lambda_l));
// Simplify visibility term: (2.0 * NdotL * NdotV) / ((4.0 * NdotL * NdotV) * (lambda_v + lambda_l));
return 0.5 / (lambdaV + lambdaL);
}

lambdaV *= NdotL;
float lambdaL = NdotV * sqrt((-NdotL * a2 + NdotL) * NdotL + a2);
// Simplify visibility term: (2.0f * NdotL * NdotV) / ((4.0f * NdotL * NdotV) * (lambda_v + lambda_l));
// Simplify visibility term: (2.0 * NdotL * NdotV) / ((4.0 * NdotL * NdotV) * (lambda_v + lambda_l));
return 0.5 / (lambdaV + lambdaL);
}

4
Assets/ScriptableRenderLoop/ShaderLibrary/Common.hlsl


float3 adir = abs(dir);
// +Z -Z
faceIndex = dir.z > 0.0f ? CUBEMAPFACE_NEGATIVE_Z : CUBEMAPFACE_POSITIVE_Z;
faceIndex = dir.z > 0.0 ? CUBEMAPFACE_NEGATIVE_Z : CUBEMAPFACE_POSITIVE_Z;
// +X -X
if (adir.x > adir.y && adir.x > adir.z)

{
float x = abs(inX);
float res = (0.0468878 * x + -0.203471) * x + 1.570796; // p(x)
res *= sqrt(1.0f - x);
res *= sqrt(1.0 - x);
return (inX >= 0) ? res : PI - res; // Undo range reduction
}

10
Assets/ScriptableRenderLoop/ShaderLibrary/CommonLighting.hlsl


float SmoothDistanceAttenuation(float squaredDistance, float invSqrAttenuationRadius)
{
float factor = squaredDistance * invSqrAttenuationRadius;
float smoothFactor = saturate(1.0f - factor * factor);
float smoothFactor = saturate(1.0 - factor * factor);
return smoothFactor * smoothFactor;
}

{
float sqrDist = dot(unL, unL);
float attenuation = 1.0f / (max(PUNCTUAL_LIGHT_THRESHOLD * PUNCTUAL_LIGHT_THRESHOLD, sqrDist));
float attenuation = 1.0 / (max(PUNCTUAL_LIGHT_THRESHOLD * PUNCTUAL_LIGHT_THRESHOLD, sqrDist));
// Non physically based hack to limit light influence to attenuationRadius.
attenuation *= SmoothDistanceAttenuation(sqrDist, invSqrAttenuationRadius);

// NdotV should not be negative for visible pixels, but it can happen due to the
// perspective projection and the normal mapping + decals. In that case, the normal
// should be modified to become valid (i.e facing the camera) to avoid weird artifacts.
// Note: certain applications (e.g. SpeedTree) make use of double-sided lighting.
// Note: certain applications (e.g. SpeedTree) require to still have negative normal to perform their own two sided lighting
// This will potentially reduce the length of the normal at edges of geometry.
float GetShiftedNdotV(inout float3 N, float3 V, bool twoSided)
{

float a = 1.0 / (1.0 + N.z);
float b = -N.x * N.y * a;
tangentX = float3(1.0f - N.x * N.x * a , b, -N.x);
tangentY = float3(b, 1.0f - N.y * N.y * a, -N.y);
tangentX = float3(1.0 - N.x * N.x * a , b, -N.x);
tangentY = float3(b, 1.0 - N.y * N.y * a, -N.y);
}
*/

7
Assets/ScriptableRenderLoop/ShaderLibrary/ImageBasedLighting.hlsl


}
// invOmegaP is precomputed on CPU and provide as a parameter of the function
// float omegaP = FOUR_PI / (6.0f * cubemapWidth * cubemapWidth);
// float omegaP = FOUR_PI / (6.0 * cubemapWidth * cubemapWidth);
mipLevel = 0.5 * log2(omegaS * invOmegaP);
}

// This will blur the reflection.
// TODO: find a more accurate MIP bias function.
mipLevel = lerp(mipLevel, lastMipLevel, bias);
// TODO: There is a bug currently where autogenerate mipmap for the cubemap seems to
// clamp the mipLevel to 6. correct it! Then remove this clamp
// All MIP map levels beyond UNITY_SPECCUBE_LOD_STEPS contain invalid data.
mipLevel = min(mipLevel, UNITY_SPECCUBE_LOD_STEPS);
// TODO: use a Gaussian-like filter to generate the MIP pyramid.
float3 val = SAMPLE_TEXTURECUBE_LOD(tex, sampl, L, mipLevel).rgb;

2
Assets/ScriptableRenderLoop/ShaderLibrary/Packing.hlsl


vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;
float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;
vResult.w = frac(Le);
vResult.z = (Le - (floor(vResult.w*255.0f)) / 255.0f) / 255.0f;
vResult.z = (Le - (floor(vResult.w * 255.0)) / 255.0) / 255.0;
return vResult;
}

26
Assets/ScriptableRenderLoop/ShaderLibrary/Tessellation.hlsl


// TODO: Move in geomtry.hlsl
float DistanceFromPlane(float3 pos, float4 plane)
{
float d = dot(float4(pos, 1.0f), plane);
float d = dot(float4(pos, 1.0), plane);
return d;
}

float4 planeTest;
// left
planeTest.x = ((DistanceFromPlane(p0, cameraWorldClipPlanes[0]) > -cullEps) ? 1.0f : 0.0f) +
((DistanceFromPlane(p1, cameraWorldClipPlanes[0]) > -cullEps) ? 1.0f : 0.0f) +
((DistanceFromPlane(p2, cameraWorldClipPlanes[0]) > -cullEps) ? 1.0f : 0.0f);
planeTest.x = ((DistanceFromPlane(p0, cameraWorldClipPlanes[0]) > -cullEps) ? 1.0 : 0.0) +
((DistanceFromPlane(p1, cameraWorldClipPlanes[0]) > -cullEps) ? 1.0 : 0.0) +
((DistanceFromPlane(p2, cameraWorldClipPlanes[0]) > -cullEps) ? 1.0 : 0.0);
planeTest.y = ((DistanceFromPlane(p0, cameraWorldClipPlanes[1]) > -cullEps) ? 1.0f : 0.0f) +
((DistanceFromPlane(p1, cameraWorldClipPlanes[1]) > -cullEps) ? 1.0f : 0.0f) +
((DistanceFromPlane(p2, cameraWorldClipPlanes[1]) > -cullEps) ? 1.0f : 0.0f);
planeTest.y = ((DistanceFromPlane(p0, cameraWorldClipPlanes[1]) > -cullEps) ? 1.0 : 0.0) +
((DistanceFromPlane(p1, cameraWorldClipPlanes[1]) > -cullEps) ? 1.0 : 0.0) +
((DistanceFromPlane(p2, cameraWorldClipPlanes[1]) > -cullEps) ? 1.0 : 0.0);
planeTest.z = ((DistanceFromPlane(p0, cameraWorldClipPlanes[2]) > -cullEps) ? 1.0f : 0.0f) +
((DistanceFromPlane(p1, cameraWorldClipPlanes[2]) > -cullEps) ? 1.0f : 0.0f) +
((DistanceFromPlane(p2, cameraWorldClipPlanes[2]) > -cullEps) ? 1.0f : 0.0f);
planeTest.z = ((DistanceFromPlane(p0, cameraWorldClipPlanes[2]) > -cullEps) ? 1.0 : 0.0) +
((DistanceFromPlane(p1, cameraWorldClipPlanes[2]) > -cullEps) ? 1.0 : 0.0) +
((DistanceFromPlane(p2, cameraWorldClipPlanes[2]) > -cullEps) ? 1.0 : 0.0);
planeTest.w = ((DistanceFromPlane(p0, cameraWorldClipPlanes[3]) > -cullEps) ? 1.0f : 0.0f) +
((DistanceFromPlane(p1, cameraWorldClipPlanes[3]) > -cullEps) ? 1.0f : 0.0f) +
((DistanceFromPlane(p2, cameraWorldClipPlanes[3]) > -cullEps) ? 1.0f : 0.0f);
planeTest.w = ((DistanceFromPlane(p0, cameraWorldClipPlanes[3]) > -cullEps) ? 1.0 : 0.0) +
((DistanceFromPlane(p1, cameraWorldClipPlanes[3]) > -cullEps) ? 1.0 : 0.0) +
((DistanceFromPlane(p2, cameraWorldClipPlanes[3]) > -cullEps) ? 1.0 : 0.0);
// has to pass all 4 plane tests to be visible
return !all(planeTest);

13
Assets/TestScenes/HDTest/GlobalIlluminationTest.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.5456157, g: 0.39781958, b: 0.24038762, a: 1}
m_IndirectSpecularColor: {r: 0.3199737, g: 0.28755516, b: 0.26444194, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0

m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_CCT: 6570
m_UseCCT: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!114 &565152817

m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_CCT: 6570
m_UseCCT: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!114 &1108908834

resolution: 256
updateMode: 1
updatePeriod: 0
skyHDRI: {fileID: 8900000, guid: 9b513842339ef704ca63ef696691bc34, type: 3}
skyHDRI: {fileID: 8900000, guid: de78f930088fc194290da7400c89bfb5, type: 3}
--- !u!114 &1944423447
MonoBehaviour:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: bc357c46587fc9d4cb8f311794d7d2f3, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SkyRendererTypeName: UnityEngine.Experimental.ScriptableRenderLoop.HDRISkyRenderer
m_SkyRendererTypeName: UnityEngine.Experimental.Rendering.HDPipeline.HDRISkyRenderer
m_ShadowMaxDistance: 1000
m_ShadowCascadeCount: 4
m_ShadowCascadeSplit0: 0.05
m_ShadowCascadeSplit1: 0.2
m_ShadowCascadeSplit2: 0.3
--- !u!4 &1944423448
Transform:
m_ObjectHideFlags: 0

875
Assets/TestScenes/HDTest/HDRenderLoopTest.unity
文件差异内容过多而无法显示
查看文件

291
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/Terrain.mat


m_PrefabInternal: {fileID: 0}
m_Name: Terrain
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DETAIL_MAP_WITH_NORMAL _DISTORTIONDEPTHTEST_OFF
_DISTORTIONONLY_OFF _EMISSION _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
serializedVersion: 2
serializedVersion: 3
- first:
name: _BaseColorMap
second:
- _AnisotropyMap:
- first:
name: _BumpMap
second:
- _BaseColorMap:
- first:
name: _DetailAlbedoMap
second:
- _BumpMap:
- first:
name: _DetailMask
second:
- _DetailAlbedoMap:
- first:
name: _DetailNormalMap
second:
- _DetailMap:
- first:
name: _DiffuseLightingMap
second:
- _DetailMask:
- first:
name: _DiffuseMap
second:
- _DetailNormalMap:
- first:
name: _EmissionMap
second:
- _DiffuseLightingMap:
- first:
name: _EmissiveColorMap
second:
- _DiffuseMap:
- first:
name: _HeightMap
second:
- _DistortionVectorMap:
- first:
name: _MainTex
second:
- _EmissionMap:
- first:
name: _MaskMap
second:
- _EmissiveColorMap:
- first:
name: _MetallicGlossMap
second:
- _HeightMap:
- first:
name: _NormalMap
second:
- _MainTex:
- first:
name: _OcclusionMap
second:
- _MaskMap:
- first:
name: _ParallaxMap
second:
- _MetallicGlossMap:
- first:
name: _SmoothnessMap
second:
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SmoothnessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecMap:
- first:
name: _SpecMap
second:
- _SpecularOcclusionMap:
- first:
name: _SpecularOcclusionMap
second:
- _SubSurfaceRadiusMap:
- first:
name: _SubSurfaceRadiusMap
second:
- _TangentMap:
- first:
name: _AlphaCutoff
second: 0.5
- first:
name: _AlphaCutoffEnable
second: 0
- first:
name: _BlendMode
second: 0
- first:
name: _BumpScale
second: 1
- first:
name: _CullMode
second: 2
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DistortionDepthTest
second: 0
- first:
name: _DistortionOnly
second: 0
- first:
name: _DoubleSidedMode
second: 0
- first:
name: _DstBlend
second: 0
- first:
name: _EmissiveColorMode
second: 1
- first:
name: _EmissiveIntensity
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _HeightBias
second: 0
- first:
name: _HeightMapMode
second: 0
- first:
name: _HeightScale
second: 1
- first:
name: _MaterialId
second: 0
- first:
name: _Metalic
second: 0
- first:
name: _Metallic
second: 0
- first:
name: _Mettalic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _NormalMapSpace
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _Smoothness
second: 0.5
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _SubSurfaceRadius
second: 0
- first:
name: _SurfaceType
second: 0
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAOScale: 1
- _DetailAlbedoScale: 1
- _DetailHeightScale: 1
- _DetailMapMode: 0
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _MaterialId: 0
- _Metalic: 0
- _Metallic: 0
- _Mettalic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SubSurfaceRadius: 0
- _SurfaceType: 0
- _TexWorldScale: 1
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
- first:
name: _BaseColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _Color
second: {r: 0.5, g: 0.5, b: 0.5, a: 1}
- first:
name: _DiffuseColor
second: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissiveColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _SpecColor
second: {r: 0.04, g: 0.04, b: 0.04, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.5, g: 0.5, b: 0.5, a: 1}
- _DiffuseColor: {r: 0.7176471, g: 0.7176471, b: 0.7176471, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.04, g: 0.04, b: 0.04, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

25
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/test details.mat


m_PrefabInternal: {fileID: 0}
m_Name: test details
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DETAIL_MAP _DETAIL_MAP_WITH_NORMAL _DISTORTIONDEPTHTEST_OFF
_DISTORTIONONLY_OFF _EMISSION _NORMALMAP _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DETAIL_MAP_WITH_NORMAL _DISTORTIONDEPTHTEST_OFF
_DISTORTIONONLY_OFF _EMISSION _NORMALMAP_TANGENT_SPACE
m_EnableInstancingVariants: 0
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:

m_Offset: {x: 0, y: 0}
- _DiffuseMap:
m_Texture: {fileID: 2800000, guid: d734753529ca78148a43944515a64bc5, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:

- _CoatRoughness: 0
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAOScale: 1
- _DetailAlbedoScale: 1
- _DetailHeightScale: 1

- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSided: 1
- _DoubleSidedLigthing: 1

- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _HeightAmplitude: 0.01
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _MaterialID: 0

- _Mettalic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.524
- _SmoothnessTextureChannel: 0

- _SubSurfaceRadius: 0
- _SurfaceType: 0
- _TexWorldScale: 1
- _UVBase: 0
- _UVMappingPlanar: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.5588235, g: 0.5588235, b: 0.5588235, a: 1}

- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.04, g: 0.04, b: 0.04, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

21
Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedFlip.mat


m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: GroundLeaf_Albedo
m_Name: GroundLeaf_DoubleSidedFlip
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DEPTHOFFSETENABLE_OFF _DETAIL_MAP_WITH_NORMAL
_DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF _DOUBLESIDED_LIGHTING_FLIP
_EMISSION _ENABLEPERPIXELDISPLACEMENT_OFF _HEIGHTMAP _MASKMAP _METALLICGLOSSMAP
_NORMALMAP _NORMALMAP_TANGENT_SPACE _TESSELLATIONOBJECTSCALE_OFF _TESSELLATION_DISPLACEMENT
m_ShaderKeywords: _ALPHATEST_ON _DEPTHOFFSETENABLE_OFF _DETAIL_MAP_WITH_NORMAL _DISTORTIONDEPTHTEST_OFF
_DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF _DOUBLESIDED_LIGHTING_FLIP _EMISSION
_ENABLEPERPIXELDISPLACEMENT_OFF _MASKMAP _METALLICGLOSSMAP _NORMALMAP _NORMALMAP_TANGENT_SPACE
_TESSELLATIONOBJECTSCALE_OFF _TESSELLATION_DISPLACEMENT
m_CustomRenderQueue: -1
stringTagMap: {}
m_CustomRenderQueue: 2450
stringTagMap:
RenderType: TransparentCutout
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 2800000, guid: 0c3144d154991884c8aa53e7dc7893ff, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:

m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _AlphaCutoffEnable: 1
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1

- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0

93
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/SamplerLayerInternal.hlsl


// These functions are use to hide the handling of triplanar mapping
// Normal need a specific treatment as they use special encoding for both base and detail map
// Also we use multiple inclusion to handle the various variation for lod and bias
// param can be unused, lod or bias
float4 ADD_FUNC_SUFFIX(SampleLayer)(TEXTURE2D_ARGS(layerTex, layerSampler), LayerUV layerUV, float3 triplanarWeights, float param)
{
if (layerUV.isTriplanar)
{
float4 val = float4(0.0, 0.0, 0.0, 0.0);
if (triplanarWeights.x > 0.0)
val += triplanarWeights.x * SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvYZ, param);
if (triplanarWeights.y > 0.0)
val += triplanarWeights.y * SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvZX, param);
if (triplanarWeights.z > 0.0)
val += triplanarWeights.z * SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvXY, param);
return val;
}
else
{
return SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uv, param);
}
}
// TODO: Handle BC5 format, currently this code is for DXT5nm - After the change, rename this function UnpackNormalmapRGorAG
// This version is use for the base normal map
float3 ADD_FUNC_SUFFIX(SampleLayerNormal)(TEXTURE2D_ARGS(layerTex, layerSampler), LayerUV layerUV, float3 triplanarWeights, float scale, float param)
{
if (layerUV.isTriplanar)
{
float3 val = float3(0.0, 0.0, 0.0);
if (triplanarWeights.x > 0.0)
val += triplanarWeights.x * UnpackNormalAG(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvYZ, param), scale);
if (triplanarWeights.y > 0.0)
val += triplanarWeights.y * UnpackNormalAG(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvZX, param), scale);
if (triplanarWeights.z > 0.0)
val += triplanarWeights.z * UnpackNormalAG(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvXY, param), scale);
return normalize(val);
}
else
{
return UnpackNormalAG(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uv, param), scale);
}
}
// This version is for normalmap with AG encoding only. Mainly use with details map.
float3 ADD_FUNC_SUFFIX(SampleLayerNormalAG)(TEXTURE2D_ARGS(layerTex, layerSampler), LayerUV layerUV, float3 triplanarWeights, float scale, float param)
{
if (layerUV.isTriplanar)
{
float3 val = float3(0.0, 0.0, 0.0);
if (triplanarWeights.x > 0.0)
val += triplanarWeights.x * UnpackNormalAG(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvYZ, param), scale);
if (triplanarWeights.y > 0.0)
val += triplanarWeights.y * UnpackNormalAG(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvZX, param), scale);
if (triplanarWeights.z > 0.0)
val += triplanarWeights.z * UnpackNormalAG(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvXY, param), scale);
return normalize(val);
}
else
{
return UnpackNormalAG(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uv, param), scale);
}
}
// This version is for normalmap with RGB encoding only, i.e uncompress or BC7. Mainly used for object space normal.
float3 ADD_FUNC_SUFFIX(SampleLayerNormalRGB)(TEXTURE2D_ARGS(layerTex, layerSampler), LayerUV layerUV, float3 triplanarWeights, float scale, float param)
{
if (layerUV.isTriplanar)
{
float3 val = float3(0.0, 0.0, 0.0);
if (triplanarWeights.x > 0.0)
val += triplanarWeights.x * UnpackNormalRGB(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvYZ, param), scale);
if (triplanarWeights.y > 0.0)
val += triplanarWeights.y * UnpackNormalRGB(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvZX, param), scale);
if (triplanarWeights.z > 0.0)
val += triplanarWeights.z * UnpackNormalRGB(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvXY, param), scale);
return normalize(val);
}
else
{
return UnpackNormalRGB(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uv, param), scale);
}
}

9
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/SamplerLayerInternal.hlsl.meta


fileFormatVersion: 2
guid: 6bcabcbfab3a70c45891987f8557e2e0
timeCreated: 1485260584
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

50
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/SampleLayer.hlsl


// Gather all kind of mapping in one struct, allow to improve code readability
struct LayerUV
{
float2 uv;
// triplanar
bool isTriplanar;
float2 uvYZ;
float2 uvZX;
float2 uvXY;
};
// Multiple includes of the file to handle all variations of textures sampling for regular, lod and bias
// Regular sampling functions
#define ADD_FUNC_SUFFIX(Name) Name
#define SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV, unused) SAMPLE_TEXTURE2D(layerTex, layerSampler, layerUV)
#include "SampleLayerInternal.hlsl"
#undef ADD_FUNC_SUFFIX
#undef SAMPLE_TEXTURE_FUNC
// Lod sampling functions
#define ADD_FUNC_SUFFIX(Name) Name##Lod
#define SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV, lod) SAMPLE_TEXTURE2D_LOD(layerTex, layerSampler, layerUV, lod)
#include "SampleLayerInternal.hlsl"
#undef ADD_FUNC_SUFFIX
#undef SAMPLE_TEXTURE_FUNC
// Bias sampling functions
#define ADD_FUNC_SUFFIX(Name) Name##Bias
#define SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV, bias) SAMPLE_TEXTURE2D_BIAS(layerTex, layerSampler, layerUV, bias)
#include "SampleLayerInternal.hlsl"
#undef ADD_FUNC_SUFFIX
#undef SAMPLE_TEXTURE_FUNC
// Macro to improve readibility of surface data
#define SAMPLE_LAYER_TEXTURE2D(textureName, samplerName, coord) SampleLayer(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, 0.0) // Last 0.0 is unused
#define SAMPLE_LAYER_TEXTURE2D_LOD(textureName, samplerName, coord, lod) SampleLayerLod(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, lod)
#define SAMPLE_LAYER_TEXTURE2D_BIAS(textureName, samplerName, coord, bias) SampleLayerBias(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, bias)
#define SAMPLE_LAYER_NORMALMAP(textureName, samplerName, coord, scale) SampleLayerNormal(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, scale, 0.0)
#define SAMPLE_LAYER_NORMALMAP_LOD(textureName, samplerName, coord, scale, lod) SampleLayerNormalLod(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, scale, lod)
#define SAMPLE_LAYER_NORMALMAP_BIAS(textureName, samplerName, coord, scale, bias) SampleLayerNormalBias(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, scale, bias)
#define SAMPLE_LAYER_NORMALMAP_AG(textureName, samplerName, coord, scale) SampleLayerNormalAG(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, scale, 0.0)
#define SAMPLE_LAYER_NORMALMAP_AG_LOD(textureName, samplerName, coord, scale, lod) SampleLayerNormalAGLod(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, scale, lod)
#define SAMPLE_LAYER_NORMALMAP_AG_BIAS(textureName, samplerName, coord, scale, bias) SampleLayerNormalAGBias(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, scale, bias)
#define SAMPLE_LAYER_NORMALMAP_RGB(textureName, samplerName, coord, scale) SampleLayerNormalRGB(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, scale, 0.0)
#define SAMPLE_LAYER_NORMALMAP_RGB_LOD(textureName, samplerName, coord, scale, lod) SampleLayerNormalRGBLod(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, scale, lod)
#define SAMPLE_LAYER_NORMALMAP_RGB_BIAS(textureName, samplerName, coord, scale, bias) SampleLayerNormalRGBBias(TEXTURE2D_PARAM(textureName, samplerName), coord, layerTexCoord.weights, scale, bias)

9
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/SampleLayer.hlsl.meta


fileFormatVersion: 2
guid: f3e4d64dcf820e040a738f576d8d1f79
timeCreated: 1485260584
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

93
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/SampleLayerInternal.hlsl


// These functions are use to hide the handling of triplanar mapping
// Normal need a specific treatment as they use special encoding for both base and detail map
// Also we use multiple inclusion to handle the various variation for lod and bias
// param can be unused, lod or bias
float4 ADD_FUNC_SUFFIX(SampleLayer)(TEXTURE2D_ARGS(layerTex, layerSampler), LayerUV layerUV, float3 weights, float param)
{
if (layerUV.isTriplanar)
{
float4 val = float4(0.0, 0.0, 0.0, 0.0);
if (weights.x > 0.0)
val += weights.x * SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvYZ, param);
if (weights.y > 0.0)
val += weights.y * SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvZX, param);
if (weights.z > 0.0)
val += weights.z * SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvXY, param);
return val;
}
else
{
return SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uv, param);
}
}
// TODO: Handle BC5 format, currently this code is for DXT5nm - After the change, rename this function UnpackNormalmapRGorAG
// This version is use for the base normal map
float3 ADD_FUNC_SUFFIX(SampleLayerNormal)(TEXTURE2D_ARGS(layerTex, layerSampler), LayerUV layerUV, float3 weights, float scale, float param)
{
if (layerUV.isTriplanar)
{
float3 val = float3(0.0, 0.0, 0.0);
if (weights.x > 0.0)
val += weights.x * UnpackNormalAG(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvYZ, param), scale);
if (weights.y > 0.0)
val += weights.y * UnpackNormalAG(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvZX, param), scale);
if (weights.z > 0.0)
val += weights.z * UnpackNormalAG(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvXY, param), scale);
return normalize(val);
}
else
{
return UnpackNormalAG(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uv, param), scale);
}
}
// This version is for normalmap with AG encoding only. Mainly use with details map.
float3 ADD_FUNC_SUFFIX(SampleLayerNormalAG)(TEXTURE2D_ARGS(layerTex, layerSampler), LayerUV layerUV, float3 weights, float scale, float param)
{
if (layerUV.isTriplanar)
{
float3 val = float3(0.0, 0.0, 0.0);
if (weights.x > 0.0)
val += weights.x * UnpackNormalAG(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvYZ, param), scale);
if (weights.y > 0.0)
val += weights.y * UnpackNormalAG(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvZX, param), scale);
if (weights.z > 0.0)
val += weights.z * UnpackNormalAG(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvXY, param), scale);
return normalize(val);
}
else
{
return UnpackNormalAG(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uv, param), scale);
}
}
// This version is for normalmap with RGB encoding only, i.e uncompress or BC7. Mainly used for object space normal.
float3 ADD_FUNC_SUFFIX(SampleLayerNormalRGB)(TEXTURE2D_ARGS(layerTex, layerSampler), LayerUV layerUV, float3 weights, float scale, float param)
{
if (layerUV.isTriplanar)
{
float3 val = float3(0.0, 0.0, 0.0);
if (weights.x > 0.0)
val += weights.x * UnpackNormalRGB(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvYZ, param), scale);
if (weights.y > 0.0)
val += weights.y * UnpackNormalRGB(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvZX, param), scale);
if (weights.z > 0.0)
val += weights.z * UnpackNormalRGB(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uvXY, param), scale);
return normalize(val);
}
else
{
return UnpackNormalRGB(SAMPLE_TEXTURE_FUNC(layerTex, layerSampler, layerUV.uv, param), scale);
}
}

9
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/SampleLayerInternal.hlsl.meta


fileFormatVersion: 2
guid: 01b8f0e33ff01164da19412b5fbdc7d4
timeCreated: 1485250177
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

9
Assets/TestScenes/HDTest/GraphicTest/Common.meta


fileFormatVersion: 2
guid: ebbb689e8fbe63a4a88d6c6552e389fd
folderAsset: yes
timeCreated: 1485165227
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation.meta


fileFormatVersion: 2
guid: a3942f1f17206ea47b331d0bcefa96c9
folderAsset: yes
timeCreated: 1485267469
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/TestScenes/HDTest/GraphicTest/Two Sided.meta


fileFormatVersion: 2
guid: f6711eb5354eb3a4e8aa3d4018202b93
folderAsset: yes
timeCreated: 1485165084
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/TestScenes/HDTest/HDRenderLoopTest.meta


fileFormatVersion: 2
guid: bb067c1f82e9d8648b8909e905f6607b
folderAsset: yes
timeCreated: 1484331444
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/TestScenes/HDTest/GraphicTest/Common/Material.meta


fileFormatVersion: 2
guid: 5f31d17932e081649ae921b0862eea4a
folderAsset: yes
timeCreated: 1485165228
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/TestScenes/HDTest/GraphicTest/Common/Textures.meta


fileFormatVersion: 2
guid: 5d7f6a5ce24cb9a4c8af11d5f2b72af4
folderAsset: yes
timeCreated: 1485165228
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

1
Assets/TestScenes/HDTest/GraphicTest/Common/Textures/LayerMask.tga
文件差异内容过多而无法显示
查看文件

108
Assets/TestScenes/HDTest/GraphicTest/Common/Textures/LayerMask.tga.meta


fileFormatVersion: 2
guid: 01dda0caaf1cdcb4a821d7c0a8cfb018
timeCreated: 1476374214
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: tvOS
maxTextureSize: 2048
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Windows Store Apps
maxTextureSize: 2048
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: WebGL
maxTextureSize: 2048
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

161
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Blue.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Lit_Blue
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DETAIL_MAP_WITH_NORMAL _DISTORTIONDEPTHTEST_OFF
_DISTORTIONONLY_OFF _EMISSION _NORMALMAP_TANGENT_SPACE
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAOScale: 1
- _DetailAlbedoScale: 1
- _DetailHeightScale: 1
- _DetailMapMode: 0
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _MaterialId: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.4
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SubSurfaceRadius: 0
- _SurfaceType: 0
- _TexWorldScale: 1
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0, g: 0, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

8
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Blue.mat.meta


fileFormatVersion: 2
guid: 5fca900cf1782bc40858cab3a67624c4
timeCreated: 1480089588
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

161
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Green.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Lit_Green
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DETAIL_MAP_WITH_NORMAL _DISTORTIONDEPTHTEST_OFF
_DISTORTIONONLY_OFF _EMISSION _NORMALMAP_TANGENT_SPACE
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAOScale: 1
- _DetailAlbedoScale: 1
- _DetailHeightScale: 1
- _DetailMapMode: 0
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _MaterialId: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SubSurfaceRadius: 0
- _SurfaceType: 0
- _TexWorldScale: 1
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0, g: 1, b: 0, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

8
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Green.mat.meta


fileFormatVersion: 2
guid: c0b044e8d3bb04947bd559a0964cff2b
timeCreated: 1480089588
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

162
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Red.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Lit_Red
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DETAIL_MAP_WITH_NORMAL _DISTORTIONDEPTHTEST_OFF
_DISTORTIONONLY_OFF _EMISSION _NORMALMAP_TANGENT_SPACE _SPECULAROCCLUSIONMAP
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 2800000, guid: b24f69ff4ace9194fb0d9eee4f5cf1a4, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAOScale: 1
- _DetailAlbedoScale: 1
- _DetailHeightScale: 1
- _DetailMapMode: 0
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _MaterialId: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 1
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SubSurfaceRadius: 0
- _SurfaceType: 0
- _TexWorldScale: 1
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

8
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Red.mat.meta


fileFormatVersion: 2
guid: 2cd5a13366cb5a646a6f3881edeb0d38
timeCreated: 1480089588
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

162
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_White.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Lit_White
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DETAIL_MAP_WITH_NORMAL _DISTORTIONDEPTHTEST_OFF
_DISTORTIONONLY_OFF _EMISSION _NORMALMAP_TANGENT_SPACE
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAOScale: 1
- _DetailAlbedoScale: 1
- _DetailHeightScale: 1
- _DetailMapMode: 0
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _HeightAmplitude: 0.01
- _HeightBias: 0
- _HeightCenter: 0.5
- _HeightMapMode: 0
- _HeightScale: 1
- _MaterialId: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SubSurfaceRadius: 0
- _SurfaceType: 0
- _TexWorldScale: 1
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

8
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_White.mat.meta


fileFormatVersion: 2
guid: 4709cba96526aa041abe1fb27397b28e
timeCreated: 1480089588
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

339
Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Layer-2-woord-rock.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Layer-2-woord-rock
m_Shader: {fileID: 4800000, guid: eab0538d9d5746246806a9611c04ac4d, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DEPTHOFFSETENABLE_OFF _DETAIL_MAP_WITH_NORMAL
_DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF _ENABLEPERPIXELDISPLACEMENT_OFF
_HEIGHTMAP _LAYERMASKVERTEXCOLOR_OFF _NORMALMAP _NORMALMAP_TANGENT_SPACE _TESSELLATIONOBJECTSCALE_OFF
_TESSELLATION_DISPLACEMENT _USEHEIGHTBASEDBLENDV2_OFF _USEHEIGHTBASEDBLEND_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseColorMap0:
m_Texture: {fileID: 2800000, guid: 37411c7405e8c1a42ac0a0f50983bd46, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap1:
m_Texture: {fileID: 2800000, guid: 0353c00d9bc99f14780836a6a51a6d97, type: 3}
m_Scale: {x: 2, y: 2}
m_Offset: {x: 0, y: 0}
- _BaseColorMap2:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap3:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap0:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap1:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap2:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap3:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask0:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask1:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask2:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask3:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap0:
m_Texture: {fileID: 2800000, guid: a3f1edea0cb01de42968bf3e4317f387, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap1:
m_Texture: {fileID: 2800000, guid: db7b513b0c2406e40be832dc28133281, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap2:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap3:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _LayerMaskMap:
m_Texture: {fileID: 2800000, guid: 01dda0caaf1cdcb4a821d7c0a8cfb018, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap0:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap1:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap2:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap3:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap0:
m_Texture: {fileID: 2800000, guid: bbc15758a54df6f43a834cbf4e150d45, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap1:
m_Texture: {fileID: 2800000, guid: ccbd506f77c77e04eaa274a3d3d417e3, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap2:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap3:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap0:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap1:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap2:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap3:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BlendUsingHeight1: 0
- _BlendUsingHeight2: 0
- _BlendUsingHeight3: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAOScale0: 1
- _DetailAOScale1: 1
- _DetailAOScale2: 1
- _DetailAOScale3: 1
- _DetailAlbedoScale0: 1
- _DetailAlbedoScale1: 1
- _DetailAlbedoScale2: 1
- _DetailAlbedoScale3: 1
- _DetailHeightScale0: 1
- _DetailHeightScale1: 1
- _DetailHeightScale2: 1
- _DetailHeightScale3: 1
- _DetailMapMode: 0
- _DetailNormalMapScale: 1
- _DetailNormalScale0: 1
- _DetailNormalScale1: 1
- _DetailNormalScale2: 1
- _DetailNormalScale3: 1
- _DetailSmoothnessScale0: 1
- _DetailSmoothnessScale1: 1
- _DetailSmoothnessScale2: 1
- _DetailSmoothnessScale3: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 0
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _HeightAmplitude0: 0.8
- _HeightAmplitude1: 1.27
- _HeightAmplitude2: 1
- _HeightAmplitude3: 1
- _HeightCenter0: 0.5
- _HeightCenter1: 0.5
- _HeightCenter2: 0
- _HeightCenter3: 0
- _HeightCenterOffset1: 0
- _HeightCenterOffset2: 0
- _HeightCenterOffset3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _InheritBaseColor1: 0
- _InheritBaseColor2: 0
- _InheritBaseColor3: 0
- _InheritBaseColorThreshold1: 1
- _InheritBaseColorThreshold2: 1
- _InheritBaseColorThreshold3: 1
- _InheritBaseHeight1: 0.06
- _InheritBaseHeight2: 0
- _InheritBaseHeight3: 0
- _InheritBaseLayer1: 0
- _InheritBaseLayer2: 0
- _InheritBaseLayer3: 0
- _InheritBaseNormal1: 0
- _InheritBaseNormal2: 0
- _InheritBaseNormal3: 0
- _LayerCount: 2
- _LayerMaskVertexColor: 0
- _Metallic: 0
- _Metallic0: 0
- _Metallic1: 0
- _Metallic2: 0
- _Metallic3: 0
- _MinimumOpacity1: 1
- _MinimumOpacity2: 1
- _MinimumOpacity3: 1
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale0: 1
- _NormalScale1: 1
- _NormalScale2: 1
- _NormalScale3: 1
- _OcclusionStrength: 1
- _OpacityAsDensity1: 0
- _OpacityAsDensity2: 0
- _OpacityAsDensity3: 0
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness0: 0.5
- _Smoothness1: 0.5
- _Smoothness2: 0.5
- _Smoothness3: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SurfaceType: 0
- _TessellationBackFaceCullEpsilon: -0.25
- _TessellationFactor: 4
- _TessellationFactorMaxDistance: 50
- _TessellationFactorMinDistance: 20
- _TessellationFactorTriangleSize: 100
- _TessellationMode: 1
- _TessellationObjectScale: 0
- _TessellationShapeFactor: 0.75
- _TexWorldScale0: 1
- _TexWorldScale1: 1
- _TexWorldScale2: 1
- _TexWorldScale3: 1
- _UVBase0: 0
- _UVBase1: 0
- _UVBase2: 0
- _UVBase3: 0
- _UVDetail0: 0
- _UVDetail1: 0
- _UVDetail2: 0
- _UVDetail3: 0
- _UVMappingPlanar0: 0
- _UVMappingPlanar1: 0
- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend: 0
- _UseHeightBasedBlendV2: 0
- _VertexColorHeightFactor: 0.3
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor0: {r: 1, g: 1, b: 1, a: 1}
- _BaseColor1: {r: 1, g: 1, b: 1, a: 1}
- _BaseColor2: {r: 1, g: 1, b: 1, a: 1}
- _BaseColor3: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask0: {r: 1, g: 0, b: 0, a: 0}
- _UVDetailsMappingMask1: {r: 1, g: 0, b: 0, a: 0}
- _UVDetailsMappingMask2: {r: 1, g: 0, b: 0, a: 0}
- _UVDetailsMappingMask3: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask0: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask1: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask2: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask3: {r: 1, g: 0, b: 0, a: 0}

9
Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Layer-2-woord-rock.mat.meta


fileFormatVersion: 2
guid: 2ebfc83bd8b60ca479682b22f411906a
timeCreated: 1485267495
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 2100000
userData: '{"GUIDArray":["e6f68673cc8e7c347a989ffe33cb21b4","f6dfdaa6d241dc94bb8816edbe111721","",""]}'
assetBundleName:
assetBundleVariant:

9
Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material.meta


fileFormatVersion: 2
guid: 7ec4dc8b3f852604e90bf521f17a164c
folderAsset: yes
timeCreated: 1485165228
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

179
Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSided.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: GroundLeaf_DoubleSided
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHATEST_ON _DEPTHOFFSETENABLE_OFF _DETAIL_MAP_WITH_NORMAL _DISTORTIONDEPTHTEST_OFF
_DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF _DOUBLESIDED _EMISSION _ENABLEPERPIXELDISPLACEMENT_OFF
_MASKMAP _METALLICGLOSSMAP _NORMALMAP _NORMALMAP_TANGENT_SPACE _TESSELLATIONOBJECTSCALE_OFF
_TESSELLATION_DISPLACEMENT
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_CustomRenderQueue: 2450
stringTagMap:
RenderType: TransparentCutout
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: 00447c5eeb984f54d92c80818840a36b, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 0c3144d154991884c8aa53e7dc7893ff, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DiffuseLightingMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 00447c5eeb984f54d92c80818840a36b, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 2800000, guid: b24f69ff4ace9194fb0d9eee4f5cf1a4, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 2800000, guid: b24f69ff4ace9194fb0d9eee4f5cf1a4, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 2800000, guid: 0c3144d154991884c8aa53e7dc7893ff, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 1
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 0
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAOScale: 1
- _DetailAlbedoScale: 1
- _DetailHeightScale: 1
- _DetailMapMode: 0
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 1
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 0.892
- _Glossiness: 0.507
- _GlossyReflections: 1
- _HeightAmplitude: 0.32
- _HeightBias: 0
- _HeightCenter: 0.68
- _HeightMapMode: 0
- _HeightScale: 1
- _MaterialId: 0
- _Metalic: 0
- _Metallic: 0
- _Mettalic: 0
- _Mode: 1
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SubSurfaceRadius: 0
- _SurfaceType: 0
- _TessellationBackFaceCullEpsilon: -0.375
- _TessellationFactor: 4
- _TessellationFactorMaxDistance: 50
- _TessellationFactorMinDistance: 20
- _TessellationFactorTriangleSize: 100
- _TessellationMode: 1
- _TessellationObjectScale: 0
- _TessellationShapeFactor: 0.75
- _TexWorldScale: 1
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.5882353, g: 0.5882353, b: 0.5882353, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

8
Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSided.mat.meta


fileFormatVersion: 2
guid: 12eac2bb2b18e914bbb6fed8262eb302
timeCreated: 1460562588
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

179
Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedMirror.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: GroundLeaf_DoubleSidedMirror
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHATEST_ON _DEPTHOFFSETENABLE_OFF _DETAIL_MAP_WITH_NORMAL _DISTORTIONDEPTHTEST_OFF
_DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF _DOUBLESIDED_LIGHTING_MIRROR _EMISSION
_ENABLEPERPIXELDISPLACEMENT_OFF _MASKMAP _METALLICGLOSSMAP _NORMALMAP _NORMALMAP_TANGENT_SPACE
_TESSELLATIONOBJECTSCALE_OFF _TESSELLATION_DISPLACEMENT
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_CustomRenderQueue: 2450
stringTagMap:
RenderType: TransparentCutout
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: 00447c5eeb984f54d92c80818840a36b, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 0c3144d154991884c8aa53e7dc7893ff, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DiffuseLightingMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 00447c5eeb984f54d92c80818840a36b, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 2800000, guid: b24f69ff4ace9194fb0d9eee4f5cf1a4, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 2800000, guid: b24f69ff4ace9194fb0d9eee4f5cf1a4, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 2800000, guid: 0c3144d154991884c8aa53e7dc7893ff, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubSurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 1
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 0
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAOScale: 1
- _DetailAlbedoScale: 1
- _DetailHeightScale: 1
- _DetailMapMode: 0
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 3
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 0.892
- _Glossiness: 0.507
- _GlossyReflections: 1
- _HeightAmplitude: 0.32
- _HeightBias: 0
- _HeightCenter: 0.68
- _HeightMapMode: 0
- _HeightScale: 1
- _MaterialId: 0
- _Metalic: 0
- _Metallic: 0
- _Mettalic: 0
- _Mode: 1
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SubSurfaceRadius: 0
- _SurfaceType: 0
- _TessellationBackFaceCullEpsilon: -0.375
- _TessellationFactor: 4
- _TessellationFactorMaxDistance: 50
- _TessellationFactorMinDistance: 20
- _TessellationFactorTriangleSize: 100
- _TessellationMode: 1
- _TessellationObjectScale: 0
- _TessellationShapeFactor: 0.75
- _TexWorldScale: 1
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.5882353, g: 0.5882353, b: 0.5882353, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

8
Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedMirror.mat.meta


fileFormatVersion: 2
guid: 88b4fe239bea7fa469847fd5e76d0dfd
timeCreated: 1460562588
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/TestScenes/HDTest/GraphicTest/Two Sided/Prefabs.meta


fileFormatVersion: 2
guid: fb91c6103a183b547971208a3848dc97
folderAsset: yes
timeCreated: 1485165522
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/TestScenes/HDTest/GraphicTest/Two Sided/Textures.meta


fileFormatVersion: 2
guid: 3c2101d8023df944eb8e6cdbf586e081
folderAsset: yes
timeCreated: 1485165228
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

70
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LayeredLitNormalSampling.hlsl


// TODO: Handle BC5 format, currently this code is for DXT5nm
// THis function below must call UnpackNormalmapRGorAG
float3 ADD_FUNC_SUFFIX(SampleLayerNormal)(TEXTURE2D_ARGS(layerTex, layerSampler), LayerUV layerUV, float3 weights, float scale, float bias)
{
if (layerUV.isTriplanar)
{
float3 val = float3(0.0, 0.0, 0.0);
if (weights.x > 0.0)
val += weights.x * UnpackNormalAG(NORMAL_SAMPLE_FUNC(layerTex, layerSampler, layerUV.uvYZ, bias), scale);
if (weights.y > 0.0)
val += weights.y * UnpackNormalAG(NORMAL_SAMPLE_FUNC(layerTex, layerSampler, layerUV.uvZX, bias), scale);
if (weights.z > 0.0)
val += weights.z * UnpackNormalAG(NORMAL_SAMPLE_FUNC(layerTex, layerSampler, layerUV.uvXY, bias), scale);
return normalize(val);
}
else
{
return UnpackNormalAG(NORMAL_SAMPLE_FUNC(layerTex, layerSampler, layerUV.uv, bias), scale);
}
}
// This version is for normalmap with AG encoding only (use with details map)
float3 ADD_FUNC_SUFFIX(SampleLayerNormalAG)(TEXTURE2D_ARGS(layerTex, layerSampler), LayerUV layerUV, float3 weights, float scale, float bias)
{
if (layerUV.isTriplanar)
{
float3 val = float3(0.0, 0.0, 0.0);
if (weights.x > 0.0)
val += weights.x * UnpackNormalAG(NORMAL_SAMPLE_FUNC(layerTex, layerSampler, layerUV.uvYZ, bias), scale);
if (weights.y > 0.0)
val += weights.y * UnpackNormalAG(NORMAL_SAMPLE_FUNC(layerTex, layerSampler, layerUV.uvZX, bias), scale);
if (weights.z > 0.0)
val += weights.z * UnpackNormalAG(NORMAL_SAMPLE_FUNC(layerTex, layerSampler, layerUV.uvXY, bias), scale);
return normalize(val);
}
else
{
return UnpackNormalAG(NORMAL_SAMPLE_FUNC(layerTex, layerSampler, layerUV.uv, bias), scale);
}
}
// This version is for normalmap with RGB encoding only, i.e non encoding. It is necessary to use this abstraction to handle correctly triplanar
// plus consistent with the normal scale parameter
float3 ADD_FUNC_SUFFIX(SampleLayerNormalRGB)(TEXTURE2D_ARGS(layerTex, layerSampler), LayerUV layerUV, float3 weights, float scale, float bias)
{
if (layerUV.isTriplanar)
{
float3 val = float3(0.0, 0.0, 0.0);
if (weights.x > 0.0)
val += weights.x * UnpackNormalRGB(NORMAL_SAMPLE_FUNC(layerTex, layerSampler, layerUV.uvYZ, bias), scale);
if (weights.y > 0.0)
val += weights.y * UnpackNormalRGB(NORMAL_SAMPLE_FUNC(layerTex, layerSampler, layerUV.uvZX, bias), scale);
if (weights.z > 0.0)
val += weights.z * UnpackNormalRGB(NORMAL_SAMPLE_FUNC(layerTex, layerSampler, layerUV.uvXY, bias), scale);
return normalize(val);
}
else
{
return UnpackNormalRGB(NORMAL_SAMPLE_FUNC(layerTex, layerSampler, layerUV.uv, bias), scale);
}
}

9
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LayeredLitNormalSampling.hlsl.meta


fileFormatVersion: 2
guid: 541d9773d4d9b4c4f92e026284359f50
timeCreated: 1485010820
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

9
Assets/TestScenes/HDTest/GraphicTest/Common/Material/Materials.meta


fileFormatVersion: 2
guid: 32611e42cdeea864fb311700b4193e53
folderAsset: yes
timeCreated: 1478686830
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

/Assets/TestScenes/HDTest/Spheres.meta → /Assets/TestScenes/HDTest/GraphicTest/Common/Prefabs.meta

/Assets/TestScenes/HDTest/Spheres → /Assets/TestScenes/HDTest/GraphicTest/Common/Material

/Assets/TestScenes/HDTest/Leaf/GroundLeaf/GroundLeaf.FBX → /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Prefabs/GroundLeaf.FBX

/Assets/TestScenes/HDTest/Leaf/GroundLeaf/GroundLeaf.FBX.meta → /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Prefabs/GroundLeaf.FBX.meta

/Assets/TestScenes/HDTest/Leaf/GroundLeaf/GroundLeaf_Albedo.tga → /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Textures/GroundLeaf.tga

/Assets/TestScenes/HDTest/Leaf/GroundLeaf/GroundLeaf_Albedo.tga.meta → /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Textures/GroundLeaf.tga.meta

/Assets/TestScenes/HDTest/Leaf/GroundLeaf/GroundLeaf_Normal.tga → /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Textures/GroundLeaf_Normal.tga

/Assets/TestScenes/HDTest/Leaf/GroundLeaf/GroundLeaf_Normal.tga.meta → /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Textures/GroundLeaf_Normal.tga.meta

/Assets/TestScenes/HDTest/Leaf/GroundLeaf/GroundLeaf_Roughness.tga → /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Textures/GroundLeaf_Roughness.tga

/Assets/TestScenes/HDTest/Leaf/GroundLeaf/GroundLeaf_Roughness.tga.meta → /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Textures/GroundLeaf_Roughness.tga.meta

/Assets/TestScenes/HDTest/Leaf/GroundLeaf/Materials/GroundLeaf_Albedo.mat.meta → /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedFlip.mat.meta

/Assets/TestScenes/HDTest/Leaf/GroundLeaf/Materials/GroundLeaf_Albedo.mat → /Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedFlip.mat

/Assets/TestScenes/HDTest/GraphicTest/Common/Material/SphereGroup.prefab → /Assets/TestScenes/HDTest/GraphicTest/Common/Prefabs/SphereGroup.prefab

/Assets/TestScenes/HDTest/GraphicTest/Common/Material/SphereGroup.prefab.meta → /Assets/TestScenes/HDTest/GraphicTest/Common/Prefabs/SphereGroup.prefab.meta

正在加载...
取消
保存