浏览代码

Merge remote-tracking branch 'origin/master' into sample_game

/sample_game
Peter Andreasen 7 年前
当前提交
867c8236
共有 296 个文件被更改,包括 4311 次插入2894 次删除
  1. 999
      ImageTemplates/LightweightPipeline/Scenes/010_MultiplePointLights.unity.png
  2. 999
      ImageTemplates/LightweightPipeline/Scenes/026_Shader_PBRscene.unity.png
  3. 27
      SampleScenes/HDTest/GraphicTest/SSS/Materials/SSSHead.mat
  4. 5
      SampleScenes/LightweightPipeline/Materials/LDRenderPipeMaterials/MobileColors.mat
  5. 5
      SampleScenes/LightweightPipeline/Materials/LDRenderPipeMaterials/MobileColorsTile.mat
  6. 6
      SampleScenes/LightweightPipeline/Materials/LDRenderPipeMaterials/MobileGlass.mat
  7. 5
      SampleScenes/LightweightPipeline/Materials/LDRenderPipeMaterials/MobilePlane.mat
  8. 3
      ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/Shadow.hlsl
  9. 18
      ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/ShadowAlgorithms.hlsl
  10. 42
      ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/ShadowSampling.hlsl
  11. 4
      ScriptableRenderPipeline/Core/TextureCache.cs
  12. 90
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  13. 22
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/Editor/HDLightEditor.cs
  14. 3
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowContext.hlsl
  15. 4
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowDispatch.hlsl
  16. 20
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
  17. 42
      ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/Editor/LayeredLitUI.cs
  18. 1
      ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
  19. 1
      ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
  20. 11
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitDataInternal.hlsl
  21. 6
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/SSSProfile/SkinSSSProfile.asset
  22. 6
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/ShaderPass/LitDepthPass.hlsl
  23. 6
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/ShaderPass/LitDistortionPass.hlsl
  24. 7
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/ShaderPass/LitMetaPass.hlsl
  25. 7
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/ShaderPass/LitVelocityPass.hlsl
  26. 10
      ScriptableRenderPipeline/HDRenderPipeline/Material/MaterialUtilities.hlsl
  27. 14
      ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/VertMesh.hlsl
  28. 2
      ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs
  29. 3
      ScriptableRenderPipeline/LightweightPipeline/Editor/LightweightAssetInspector.cs
  30. 72
      ScriptableRenderPipeline/LightweightPipeline/Editor/LightweightPipelineUpgraders.cs
  31. 133
      ScriptableRenderPipeline/LightweightPipeline/Editor/ShaderGUI/LightweightStandardSimpleLightingGUI.cs
  32. 42
      ScriptableRenderPipeline/LightweightPipeline/Editor/ShaderGUI/LightweightStandardGUI.cs
  33. 1
      ScriptableRenderPipeline/LightweightPipeline/Editor/UpgradeCommon.cs
  34. 483
      ScriptableRenderPipeline/LightweightPipeline/LightweightPipeline.cs
  35. 2
      ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.asset
  36. 52
      ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.cs
  37. 5
      ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineUtils.cs
  38. 2
      ScriptableRenderPipeline/LightweightPipeline/Materials/Lightweight-StandardShader.mat
  39. 2
      ScriptableRenderPipeline/LightweightPipeline/Materials/Lightweight-StandardSimpleLighting.mat
  40. 5
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightBlit.shader
  41. 75
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightCore.cginc
  42. 162
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightInput.cginc
  43. 94
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightLighting.cginc
  44. 136
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightPassLit.cginc
  45. 14
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightShadows.cginc
  46. 12
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandardSimpleLighting.shader
  47. 16
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandard.shader
  48. 357
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/010_MultiplePointLights.unity
  49. 3
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/012_PBS_EnvironmentBRDF_Spheres.unity
  50. 6
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/015_CameraMulti_FPSCam.unity
  51. 5
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/017_Lighting_Scene_DirectionalBaked.unity
  52. 9
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/017_Lighting_Scene_DirectionalBaked/LightingData.asset
  53. 2
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/017_Lighting_Scene_DirectionalBaked/LightingData.asset.meta
  54. 1001
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/017_Lighting_Scene_DirectionalBaked/Lightmap-0_comp_light.exr
  55. 2
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/017_Lighting_Scene_DirectionalBaked/Lightmap-0_comp_light.exr.meta
  56. 1001
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/017_Lighting_Scene_DirectionalBaked/ReflectionProbe-0.exr
  57. 2
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/017_Lighting_Scene_DirectionalBaked/ReflectionProbe-0.exr.meta
  58. 63
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/021_Lighting_BasicPoint.unity
  59. 2
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/024_Shader_PBRvalidation_Specular/Adam/Crowd_LOD0.FBX.meta
  60. 3
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/024_Shader_PBRvalidation_Specular/Adam/Materials/Crowd_LOD0_Mat_Limbs_spec.mat
  61. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/024_Shader_PBRvalidation_Specular/Adam/Materials/Crowd_LOD0_Mat_Torso_spec.mat
  62. 3
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/024_Shader_PBRvalidation_Specular/PBRtest_Spec.mat
  63. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/025_Shader_PBRvalidation_Metallic/Adam/Materials/Crowd_LOD0_Mat_Limbs_metallic.mat
  64. 6
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/025_Shader_PBRvalidation_Metallic/Adam/Materials/Crowd_LOD0_Mat_Torso_metallic.mat
  65. 2
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/025_Shader_PBRvalidation_Metallic/PBRtest_met.mat
  66. 63
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene.unity
  67. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/kabel.mat
  68. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/korpus.mat
  69. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/kozhuh.mat
  70. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/motor.mat
  71. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/spindle.mat
  72. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/stanina.mat
  73. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/stanina_vk.mat
  74. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/top.mat
  75. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/val.mat
  76. 3
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/CeramicTiles.mat
  77. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/Challenge-Brick.mat
  78. 90
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/Challenge-Brick.sbsar.meta
  79. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/Hole_mesh.mat
  80. 114
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/Hole_mesh.sbsar.meta
  81. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/IndustrialGlass.mat
  82. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/IndustrialGlass.sbsar.meta
  83. 3
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/PW_WoodLog.mat
  84. 154
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/PW_WoodLog.sbsar.meta
  85. 6
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/Pyramids Wall - v01.mat
  86. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/Pyramids Wall - v01.sbsar.meta
  87. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/Roofing.mat
  88. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/Roofing.sbsar.meta
  89. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/ShoreRockSand.mat
  90. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/ShoreRockSand.sbsar.meta
  91. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/bark.mat
  92. 82
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/bark.sbsar.meta
  93. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/herringbone_brick_floor.mat
  94. 130
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/herringbone_brick_floor.sbsar.meta
  95. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/metal_aluminium_directional.mat
  96. 122
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/metal_aluminium_directional.sbsar.meta
  97. 4
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/metal_brushed_copper.mat
  98. 122
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/metal_brushed_copper.sbsar.meta
  99. 3
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/red_paint.mat
  100. 74
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/red_paint.sbsar.meta

999
ImageTemplates/LightweightPipeline/Scenes/010_MultiplePointLights.unity.png
文件差异内容过多而无法显示
查看文件

999
ImageTemplates/LightweightPipeline/Scenes/026_Shader_PBRscene.unity.png
文件差异内容过多而无法显示
查看文件

27
SampleScenes/HDTest/GraphicTest/SSS/Materials/SSSHead.mat


m_PrefabInternal: {fileID: 0}
m_Name: SSSHead
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _MATID_SSS _NORMALMAP _NORMALMAP_TANGENT_SPACE
m_ShaderKeywords: _ALBEDOAFFECTEMISSIVE_OFF _ENABLEPERPIXELDISPLACEMENT_OFF _ENABLESPECULAROCCLUSION_OFF
_MATID_SSS _NORMALMAP _NORMALMAP_TANGENT_SPACE _THICKNESSMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: 6e9f830fee2ef0c44af529384a948910, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: f40319fb453e7e04dbe1e64f7b81efd9, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 13ef23776cd487941973bab55623a077, type: 3}
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0

- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _EnableSpecularOcclusion: 0
- _EnableWind: 0
- _GlossMapScale: 1
- _Glossiness: 0.5

- _HeightMax: 1
- _HeightMin: -1
- _HorizonFade: 1
- _InitialBend: 1
- _MaterialID: 0

- _NormalScale: 1
- _NormalScale: 0.776
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15

- _ShiverDrag: 0.2
- _Smoothness: 0.497
- _Smoothness: 0.542
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1

- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 1
- _Thickness: 0.911
- _UVBase: 0
- _UVDetail: 0
- _UVSec: 0

5
SampleScenes/LightweightPipeline/Materials/LDRenderPipeMaterials/MobileColors.mat


m_PrefabInternal: {fileID: 0}
m_Name: MobileColors
m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3}
m_ShaderKeywords: _EMISSION _GLOSSINESS_FROM_BASE_ALPHA _NORMALMAP _SPECULAR_COLOR
m_LightmapFlags: 1
m_ShaderKeywords: _GLOSSINESS_FROM_BASE_ALPHA _NORMALMAP _SPECULAR_COLOR
m_LightmapFlags: 4
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []

5
SampleScenes/LightweightPipeline/Materials/LDRenderPipeMaterials/MobileColorsTile.mat


m_PrefabInternal: {fileID: 0}
m_Name: MobileColorsTile
m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3}
m_ShaderKeywords: _EMISSION _GLOSSINESS_FROM_BASE_ALPHA _SPECULAR_COLOR
m_LightmapFlags: 1
m_ShaderKeywords: _GLOSSINESS_FROM_BASE_ALPHA _SPECULAR_COLOR
m_LightmapFlags: 4
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []

6
SampleScenes/LightweightPipeline/Materials/LDRenderPipeMaterials/MobileGlass.mat


m_PrefabInternal: {fileID: 0}
m_Name: MobileGlass
m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3}
m_ShaderKeywords: _ALPHABLEND_ON _EMISSION _GLOSSINESS_FROM_BASE_ALPHA _METALLICGLOSSMAP
_SPECULAR_COLOR
m_LightmapFlags: 1
m_ShaderKeywords: _ALPHABLEND_ON _GLOSSINESS_FROM_BASE_ALPHA _SPECULAR_COLOR
m_LightmapFlags: 4
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent

5
SampleScenes/LightweightPipeline/Materials/LDRenderPipeMaterials/MobilePlane.mat


m_PrefabInternal: {fileID: 0}
m_Name: MobilePlane
m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3}
m_ShaderKeywords: _GLOSSINESS_FROM_BASE_ALPHA _NORMALMAP _SHARED_SPECULAR_DIFFUSE
_SPECULAR_COLOR
m_LightmapFlags: 1
m_ShaderKeywords: _GLOSSINESS_FROM_BASE_ALPHA _NORMALMAP _SPECULAR_COLOR
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1

3
ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/Shadow.hlsl


#define SHADOW_SUPPORTS_DYNAMIC_INDEXING 0 // only on >= sm 5.1
#define SHADOW_OPTIMIZE_REGISTER_USAGE 0 // redefine this as 1 in your ShadowContext.hlsl to optimize for register usage over instruction count
#include "../../../Core/Shadow/ShadowBase.cs.hlsl" // ShadowData definition, auto generated (don't modify)
#include "ShadowTexFetch.hlsl" // Resource sampling definitions (don't modify)

#define SHADOW_CONTEXT_INCLUDE
#include "../../ShadowIncludes.inl"
#undef SHADOW_CONTEXT_INCLUDE
//#include "ShadowContext.hlsl"
// helper function to extract shadowmap data from the ShadowData struct
void UnpackShadowmapId( uint shadowmapId, out uint texIdx, out uint sampIdx, out float slice )

#define SHADOW_DISPATCH_INCLUDE
#include "../../ShadowIncludes.inl"
#undef SHADOW_DISPATCH_INCLUDE
//#include "ShadowDispatch.hlsl"
// if shadow dispatch is empty we'll fall back to default shadow sampling implementations
#ifndef SHADOW_DISPATCH_USE_CUSTOM_PUNCTUAL

18
ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/ShadowAlgorithms.hlsl


uint orig_payloadOffset = payloadOffset;
positionWS += EvalShadow_NormalBias( normalWS, saturate( dot( normalWS, L ) ), scales[shadowSplitIndex] * sd.texelSizeRcp.zw, sd.normalBias );
/* Be careful of this code, we need it here before the if statement otherwise the compiler screws up optimizing dirShadowSplitSpheres VGPRs away */
float border = borders[shadowSplitIndex];
/* Be careful of this code, we need it here before the if statement otherwise the compiler screws up optimizing dirShadowSplitSpheres VGPRs away */
float border = borders[shadowSplitIndex];
float4 splitSphere = dirShadowSplitSpheres[shadowSplitIndex];
float4 splitSphere = dirShadowSplitSpheres[shadowSplitIndex];
float3 cascadeDir = normalize( -splitSphere.xyz + dirShadowSplitSpheres[min(3,shadowSplitIndex+1)].xyz );
float3 wposDir = normalize( -splitSphere.xyz + positionWS );
float cascDot = dot( cascadeDir, wposDir );

float3 orig_pos = positionWS; \
uint orig_payloadOffset = payloadOffset; \
positionWS += EvalShadow_NormalBias( normalWS, saturate( dot( normalWS, L ) ), scales[shadowSplitIndex] * sd.texelSizeRcp.zw, sd.normalBias ); \
\
/* Be careful of this code, we need it here before the if statement otherwise the compiler screws up optimizing dirShadowSplitSpheres VGPRs away */ \
\
/* Be careful of this code, we need it here before the if statement otherwise the compiler screws up optimizing dirShadowSplitSpheres VGPRs away */ \
float4 splitSphere = dirShadowSplitSpheres[shadowSplitIndex]; \
float4 splitSphere = dirShadowSplitSpheres[shadowSplitIndex]; \
alpha = cascDot > 0.0 ? alpha : lerp( alpha, 0.0, saturate( -cascDot * 4.0 ) ); \
\
/* get shadowmap texcoords */ \
alpha = cascDot > 0.0 ? alpha : lerp( alpha, 0.0, saturate( -cascDot * 4.0 ) ); \
\
/* get shadowmap texcoords */ \
float3 posNDC; \
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS, posNDC, true ); \
/* sample the texture */ \

42
ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/ShadowSampling.hlsl


float2 fetchesUV[16];
SampleShadow_ComputeSamples_Tent_7x7(shadowMapTexture_TexelSize, coord.xy, fetchesWeights, fetchesUV);
for (int i = 0; i < 16; i++)
#if SHADOW_OPTIMIZE_REGISTER_USAGE == 1
int i;
[loop]
for( i = 0; i < 1; i++ )
{
shadow += fetchesWeights[ 0] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[ 0].xy, coord.z ), slice ).x;
shadow += fetchesWeights[ 1] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[ 1].xy, coord.z ), slice ).x;
shadow += fetchesWeights[ 2] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[ 2].xy, coord.z ), slice ).x;
shadow += fetchesWeights[ 3] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[ 3].xy, coord.z ), slice ).x;
}
[loop]
for( i = 0; i < 1; i++ )
shadow += fetchesWeights[i] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[i].xy, coord.z ), slice ).x;
shadow += fetchesWeights[ 4] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[ 4].xy, coord.z ), slice ).x;
shadow += fetchesWeights[ 5] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[ 5].xy, coord.z ), slice ).x;
shadow += fetchesWeights[ 6] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[ 6].xy, coord.z ), slice ).x;
shadow += fetchesWeights[ 7] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[ 7].xy, coord.z ), slice ).x;
[loop]
for( i = 0; i < 1; i++ )
{
shadow += fetchesWeights[ 8] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[ 8].xy, coord.z ), slice ).x;
shadow += fetchesWeights[ 9] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[ 9].xy, coord.z ), slice ).x;
shadow += fetchesWeights[10] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[10].xy, coord.z ), slice ).x;
shadow += fetchesWeights[11] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[11].xy, coord.z ), slice ).x;
}
[loop]
for( i = 0; i < 1; i++ )
{
shadow += fetchesWeights[12] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[12].xy, coord.z ), slice ).x;
shadow += fetchesWeights[13] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[13].xy, coord.z ), slice ).x;
shadow += fetchesWeights[14] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[14].xy, coord.z ), slice ).x;
shadow += fetchesWeights[15] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[15].xy, coord.z ), slice ).x;
}
#else
for( int i = 0; i < 16; i++ )
{
shadow += fetchesWeights[i] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[i].xy, coord.z ), slice ).x;
}
#endif
return shadow;
}

4
ScriptableRenderPipeline/Core/TextureCache.cs


{
sliceIndex = m_LocatorInSliceArray[texId];
bFoundAvailOrExistingSlice = true;
//assert(m_SliceArray[sliceIndex].TexID==TexID);
Debug.Assert(m_SliceArray[sliceIndex].texId == texId);
}
// If no existing copy found in the array

// wrap up
//assert(bFoundAvailOrExistingSlice);
Debug.Assert(bFoundAvailOrExistingSlice, "The texture cache doesn't have enough space to store all textures. Please either increase the size of the texture cache, or use fewer unique textures.");
if (bFoundAvailOrExistingSlice)
{
m_SliceArray[sliceIndex].countLRU = 0; // mark slice as in use this frame

90
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


// Debugging
MaterialPropertyBlock m_SharedPropertyBlock = new MaterialPropertyBlock();
public DebugDisplaySettings m_DebugDisplaySettings = new DebugDisplaySettings();
DebugDisplaySettings m_DebugDisplaySettings = new DebugDisplaySettings();
static DebugDisplaySettings s_NeutraDebugDisplaySettings = new DebugDisplaySettings();
DebugDisplaySettings m_CurrentDebugDisplaySettings = null;
private int m_DebugFullScreenTempRT;
private bool m_FullScreenDebugPushed = false;

}
// Broadcast SSS parameters to all shaders.
Shader.SetGlobalInt( HDShaderIDs._EnableSSSAndTransmission, m_DebugDisplaySettings.renderingDebugSettings.enableSSSAndTransmission ? 1 : 0);
Shader.SetGlobalInt( HDShaderIDs._EnableSSSAndTransmission, m_CurrentDebugDisplaySettings.renderingDebugSettings.enableSSSAndTransmission ? 1 : 0);
Shader.SetGlobalInt( HDShaderIDs._TexturingModeFlags, (int)sssParameters.texturingModeFlags);
Shader.SetGlobalInt( HDShaderIDs._TransmissionFlags, (int)sssParameters.transmissionFlags);
Shader.SetGlobalInt( HDShaderIDs._UseDisneySSS, sssParameters.useDisneySSS ? 1 : 0);

{
// Currently, Unity does not offer a way to bind the stencil buffer as a texture in a compute shader.
// Therefore, it's manually copied using a pixel shader.
return m_DebugDisplaySettings.renderingDebugSettings.enableSSSAndTransmission || LightLoop.GetFeatureVariantsEnabled(m_Asset.tileSettings);
return m_CurrentDebugDisplaySettings.renderingDebugSettings.enableSSSAndTransmission || LightLoop.GetFeatureVariantsEnabled(m_Asset.tileSettings);
}
bool NeedHTileCopy()

return m_DebugDisplaySettings.renderingDebugSettings.enableSSSAndTransmission;
return m_CurrentDebugDisplaySettings.renderingDebugSettings.enableSSSAndTransmission;
}
RenderTargetIdentifier GetDepthTexture()

// Do anything we need to do upon a new frame.
m_LightLoop.NewFrame();
ApplyDebugDisplaySettings();
UpdateCommonSettings();
// we only want to render one camera for now
// select the most main camera!

return;
}
// If we render a reflection view or a preview we should not display any debug information
// This need to be call before ApplyDebugDisplaySettings()
if (camera.cameraType == CameraType.Reflection || camera.cameraType == CameraType.Preview)
{
// Neutral allow to disable all debug settings
m_CurrentDebugDisplaySettings = s_NeutraDebugDisplaySettings;
}
else
{
m_CurrentDebugDisplaySettings = m_DebugDisplaySettings;
}
ApplyDebugDisplaySettings();
UpdateCommonSettings();
ScriptableCullingParameters cullingParams;
if (!CullResults.GetCullingParameters(camera, out cullingParams))
{

m_LightLoop.UpdateCullingParameters( ref cullingParams );
#if UNITY_EDITOR
// emit scene view UI
if (camera.cameraType == CameraType.SceneView)

// Required for the SSS and the shader feature classification pass.
PrepareAndBindStencilTexture(cmd);
if (m_DebugDisplaySettings.IsDebugMaterialDisplayEnabled())
if (m_CurrentDebugDisplaySettings.IsDebugMaterialDisplayEnabled())
{
RenderDebugViewMaterial(m_CullResults, hdCamera, renderContext, cmd);
}

m_LightLoop.BuildGPULightLists(camera, cmd, m_CameraDepthStencilBufferRT, GetStencilTexture());
}
// Caution: We require sun light here as some sky use the sun light to render, mean UpdateSkyEnvironment
// must be call after BuildGPULightLists.
// TODO: Try to arrange code so we can trigger this call earlier and use async compute here to run sky convolution during other passes (once we move convolution shader to compute).
UpdateSkyEnvironment(hdCamera, cmd);
// Don't update the sky environment if we are rendering a cubemap (it should be update already)
if (camera.cameraType != CameraType.Reflection)
{
// Caution: We require sun light here as some sky use the sun light to render, mean UpdateSkyEnvironment
// must be call after BuildGPULightLists.
// TODO: Try to arrange code so we can trigger this call earlier and use async compute here to run sky convolution during other passes (once we move convolution shader to compute).
UpdateSkyEnvironment(hdCamera, cmd);
}
RenderDeferredLighting(hdCamera, cmd);

RenderForwardError(m_CullResults, camera, renderContext, cmd, true);
#endif
RenderLightingDebug(hdCamera, cmd, m_CameraColorBufferRT, m_DebugDisplaySettings);
RenderLightingDebug(hdCamera, cmd, m_CameraColorBufferRT, m_CurrentDebugDisplaySettings);
// If full forward rendering, we did just rendered everything, so we can copy the depth buffer
// If Deferred nothing needs copying anymore.

void RenderOpaqueRenderList(CullResults cull, Camera camera, ScriptableRenderContext renderContext, CommandBuffer cmd, ShaderPassName[] passNames, RendererConfiguration rendererConfiguration = 0, Material overrideMaterial = null)
{
if (!m_DebugDisplaySettings.renderingDebugSettings.displayOpaqueObjects)
if (!m_CurrentDebugDisplaySettings.renderingDebugSettings.displayOpaqueObjects)
return;
// This is done here because DrawRenderers API lives outside command buffers so we need to make call this before doing any DrawRenders

void RenderTransparentRenderList(CullResults cull, Camera camera, ScriptableRenderContext renderContext, CommandBuffer cmd, ShaderPassName[] passNames, RendererConfiguration rendererConfiguration = 0, Material overrideMaterial = null)
{
if (!m_DebugDisplaySettings.renderingDebugSettings.displayTransparentObjects)
if (!m_CurrentDebugDisplaySettings.renderingDebugSettings.displayTransparentObjects)
return;
// This is done here because DrawRenderers API lives outside command buffers so we need to make call this before doing any DrawRenders

if (m_Asset.renderingSettings.ShouldUseForwardRenderingOnly())
return;
using (new Utilities.ProfilingSample(m_DebugDisplaySettings.IsDebugDisplayEnabled() ? "GBufferDebugDisplay" : "GBuffer", cmd))
using (new Utilities.ProfilingSample(m_CurrentDebugDisplaySettings.IsDebugDisplayEnabled() ? "GBufferDebugDisplay" : "GBuffer", cmd))
RenderOpaqueRenderList(cull, camera, renderContext, cmd, m_DebugDisplaySettings.IsDebugDisplayEnabled() ? HDShaderPassNames.m_GBufferDebugDisplayName : HDShaderPassNames.m_GBufferName, Utilities.kRendererConfigurationBakedLighting);
RenderOpaqueRenderList(cull, camera, renderContext, cmd, m_CurrentDebugDisplaySettings.IsDebugDisplayEnabled() ? HDShaderPassNames.m_GBufferDebugDisplayName : HDShaderPassNames.m_GBufferName, Utilities.kRendererConfigurationBakedLighting);
}
}

{
if(m_DebugDisplaySettings.materialDebugSettings.IsDebugGBufferEnabled() && !m_Asset.renderingSettings.ShouldUseForwardRenderingOnly())
if (m_CurrentDebugDisplaySettings.materialDebugSettings.IsDebugGBufferEnabled() && !m_Asset.renderingSettings.ShouldUseForwardRenderingOnly())
{
using (new Utilities.ProfilingSample("DebugViewMaterialGBuffer", cmd))
{

LightLoop.LightingPassOptions options = new LightLoop.LightingPassOptions();
options.volumetricLightingEnabled = m_VolumetricLightingEnabled;
if (m_DebugDisplaySettings.renderingDebugSettings.enableSSSAndTransmission)
if (m_CurrentDebugDisplaySettings.renderingDebugSettings.enableSSSAndTransmission)
m_LightLoop.RenderDeferredLighting(hdCamera, cmd, m_DebugDisplaySettings, colorRTs, m_CameraDepthStencilBufferRT, depthTexture, m_DeferredShadowBuffer, options);
m_LightLoop.RenderDeferredLighting(hdCamera, cmd, m_CurrentDebugDisplaySettings, colorRTs, m_CameraDepthStencilBufferRT, depthTexture, m_DeferredShadowBuffer, options);
m_LightLoop.RenderDeferredLighting(hdCamera, cmd, m_DebugDisplaySettings, colorRTs, m_CameraDepthStencilBufferRT, depthTexture, m_DeferredShadowBuffer, options);
m_LightLoop.RenderDeferredLighting(hdCamera, cmd, m_CurrentDebugDisplaySettings, colorRTs, m_CameraDepthStencilBufferRT, depthTexture, m_DeferredShadowBuffer, options);
}
// Combines specular lighting and diffuse lighting with subsurface scattering.

if (!m_DebugDisplaySettings.renderingDebugSettings.enableSSSAndTransmission || m_Asset.renderingSettings.ShouldUseForwardRenderingOnly())
if (!m_CurrentDebugDisplaySettings.renderingDebugSettings.enableSSSAndTransmission || m_Asset.renderingSettings.ShouldUseForwardRenderingOnly())
return;
using (new Utilities.ProfilingSample("Subsurface Scattering", cmd))

ShaderPassName passName;
string profileName;
if (m_DebugDisplaySettings.IsDebugDisplayEnabled())
if (m_CurrentDebugDisplaySettings.IsDebugDisplayEnabled())
{
passName = addForwardPass ? HDShaderPassNames.m_ForwardDisplayDebugName : HDShaderPassNames.m_ForwardOnlyOpaqueDisplayDebugName;
profileName = addForwardPass ? (renderOpaque ? "Forward Opaque Display Debug" : "Forward Transparent Display Debug") : "ForwardOnlyOpaqueDisplayDebug";

void RenderDistortion(CullResults cullResults, Camera camera, ScriptableRenderContext renderContext, CommandBuffer cmd)
{
if (!m_DebugDisplaySettings.renderingDebugSettings.enableDistortion)
if (!m_CurrentDebugDisplaySettings.renderingDebugSettings.enableDistortion)
return;
using (new Utilities.ProfilingSample("Distortion", cmd))

public void ApplyDebugDisplaySettings()
{
m_ShadowSettings.enabled = m_DebugDisplaySettings.lightingDebugSettings.enableShadows;
m_ShadowSettings.enabled = m_CurrentDebugDisplaySettings.lightingDebugSettings.enableShadows;
LightingDebugSettings lightingDebugSettings = m_DebugDisplaySettings.lightingDebugSettings;
LightingDebugSettings lightingDebugSettings = m_CurrentDebugDisplaySettings.lightingDebugSettings;
Shader.SetGlobalInt(HDShaderIDs._DebugViewMaterial, (int)m_DebugDisplaySettings.GetDebugMaterialIndex());
Shader.SetGlobalInt(HDShaderIDs._DebugLightingMode, (int)m_DebugDisplaySettings.GetDebugLightingMode());
Shader.SetGlobalInt(HDShaderIDs._DebugViewMaterial, (int)m_CurrentDebugDisplaySettings.GetDebugMaterialIndex());
Shader.SetGlobalInt(HDShaderIDs._DebugLightingMode, (int)m_CurrentDebugDisplaySettings.GetDebugLightingMode());
Shader.SetGlobalVector(HDShaderIDs._DebugLightingAlbedo, debugAlbedo);
Shader.SetGlobalVector(HDShaderIDs._DebugLightingSmoothness, debugSmoothness);
}

if (debugMode == m_DebugDisplaySettings.fullScreenDebugMode)
if (debugMode == m_CurrentDebugDisplaySettings.fullScreenDebugMode)
{
m_FullScreenDebugPushed = true; // We need this flag because otherwise if no fullscreen debug is pushed, when we render the result in RenderDebug the temporary RT will not exist.
cb.GetTemporaryRT(m_DebugFullScreenTempRT, camera.pixelWidth, camera.pixelHeight, 0, FilterMode.Point, RenderTextureFormat.ARGBHalf, RenderTextureReadWrite.Linear);

Utilities.SetRenderTarget(cmd, BuiltinRenderTextureType.CameraTarget, m_CameraDepthStencilBufferRT);
// First render full screen debug texture
if(m_DebugDisplaySettings.fullScreenDebugMode != FullScreenDebugMode.None && m_FullScreenDebugPushed)
if (m_CurrentDebugDisplaySettings.fullScreenDebugMode != FullScreenDebugMode.None && m_FullScreenDebugPushed)
m_DebugFullScreen.SetFloat(HDShaderIDs._FullScreenDebugMode, (float)m_DebugDisplaySettings.fullScreenDebugMode);
m_DebugFullScreen.SetFloat(HDShaderIDs._FullScreenDebugMode, (float)m_CurrentDebugDisplaySettings.fullScreenDebugMode);
float overlayRatio = m_DebugDisplaySettings.debugOverlayRatio;
float overlayRatio = m_CurrentDebugDisplaySettings.debugOverlayRatio;
LightingDebugSettings lightingDebug = m_DebugDisplaySettings.lightingDebugSettings;
LightingDebugSettings lightingDebug = m_CurrentDebugDisplaySettings.lightingDebugSettings;
if (lightingDebug.displaySkyReflection)
{

Utilities.NextOverlayCoord(ref x, ref y, overlaySize, overlaySize, camera.camera.pixelWidth);
}
m_LightLoop.RenderDebugOverlay(camera.camera, cmd, m_DebugDisplaySettings, ref x, ref y, overlaySize, camera.camera.pixelWidth);
m_LightLoop.RenderDebugOverlay(camera.camera, cmd, m_CurrentDebugDisplaySettings, ref x, ref y, overlaySize, camera.camera.pixelWidth);
}
}

22
ScriptableRenderPipeline/HDRenderPipeline/Lighting/Editor/HDLightEditor.cs


namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[CustomEditor(typeof(Light))]
[CustomEditorForRenderPipeline(typeof(Light), typeof(HDRenderPipelineAsset))]
[CanEditMultipleObjects]
public class HDLightEditor : Editor
{

SerializedProperty m_SpotLightShape;
SerializedProperty m_ShapeLength;
SerializedProperty m_ShapeWidth;
SerializedProperty m_ShapeRadius;
SerializedProperty m_ShapeRadius;
SerializedProperty m_ShowAdditionalSettings;
SerializedProperty m_ShowAdditionalSettings;
SerializedProperty m_ShadowDimmer;
SerializedProperty m_ShadowFadeDistance;

//Area, <= offline type of Unity not dispay in our case but reuse for GI of our area light
Rectangle,
Line,
// Sphere,
// Sphere,
// Disc,
}

// Note: There is no Lightmapping enum, the code C# side must use int
// Light.h file: int m_Lightmapping; ///< enum { Dynamic=4, Stationary=1, Static=2 }
// Lighting.h file:
// Lighting.h file:
// enum LightmapBakeType (not accessible in C#)
//{
// kLightRealtime = 1 << 2, // Light is realtime

m_FadeDistance = additionalDataSerializedObject.FindProperty("fadeDistance");
m_AffectDiffuse = additionalDataSerializedObject.FindProperty("affectDiffuse");
m_AffectSpecular = additionalDataSerializedObject.FindProperty("affectSpecular");
m_LightTypeExtent = additionalDataSerializedObject.FindProperty("lightTypeExtent");
m_LightTypeExtent = additionalDataSerializedObject.FindProperty("lightTypeExtent");
m_SpotLightShape = additionalDataSerializedObject.FindProperty("spotLightShape");
m_ShapeLength = additionalDataSerializedObject.FindProperty("shapeLength");
m_ShapeWidth = additionalDataSerializedObject.FindProperty("shapeWidth");

m_ShadowCascadeCount = shadowDataSerializedObject.FindProperty("shadowCascadeCount");
m_ShadowCascadeRatios = shadowDataSerializedObject.FindProperty("shadowCascadeRatios");
m_ShadowCascadeBorders = shadowDataSerializedObject.FindProperty("shadowCascadeBorders");
m_ShadowResolution = shadowDataSerializedObject.FindProperty("shadowResolution");
m_ShadowResolution = shadowDataSerializedObject.FindProperty("shadowResolution");
}
void ResolveLightShape()

// We need to overwrite the name of the default enum that doesn't make any sense
// EditorGUILayout.PropertyField(m_Lightmapping, Styles.LightmappingMode);
m_Lightmapping.enumValueIndex = EditorGUILayout.Popup(Styles.lightmappingModeText, (int)m_Lightmapping.enumValueIndex, Styles.lightmappingModeNames);
m_Lightmapping.enumValueIndex = EditorGUILayout.Popup(Styles.lightmappingModeText, (int)m_Lightmapping.enumValueIndex, Styles.lightmappingModeNames);
// Warning if GI Baking disabled and m_Lightmapping isn't realtime
if (bakingWarningValue)

break;
}
}
else
else
{
EditorGUILayout.PropertyField(m_ShadowResolution, Styles.ShadowResolution);
EditorGUILayout.Slider(m_ShadowsBias, 0.001f, 1, Styles.ShadowBias);

// Light features
EditorGUI.indentLevel++;
EditorGUILayout.LabelField(new GUIContent("Light features"), EditorStyles.boldLabel);
// Do not display option for shadow if we are fully bake
if (m_Lightmapping.enumValueIndex != (int)LightMappingType.Baked)
{

{
LightGUI();
}
// Shadows
if (m_ShadowsType.enumValueIndex != (int)LightShadows.None)
{

3
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowContext.hlsl


#define SHADOWCONTEXT_MAX_SAMPLER 3
#define SHADOWCONTEXT_MAX_COMPSAMPLER 1
#undef SHADOW_OPTIMIZE_REGISTER_USAGE
#define SHADOW_OPTIMIZE_REGISTER_USAGE 1
SHADOWCONTEXT_DECLARE( SHADOWCONTEXT_MAX_TEX2DARRAY, SHADOWCONTEXT_MAX_TEXCUBEARRAY, SHADOWCONTEXT_MAX_COMPSAMPLER, SHADOWCONTEXT_MAX_SAMPLER );
TEXTURE2D_ARRAY(_ShadowmapExp_VSM_0);

4
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowDispatch.hlsl


// directional
#define SHADOW_DISPATCH_DIR_TEX 3
#define SHADOW_DISPATCH_DIR_SMP 0
#define SHADOW_DISPATCH_DIR_ALG GPUSHADOWALGORITHM_PCF_TENT_7X7
#define SHADOW_DISPATCH_DIR_ALG GPUSHADOWALGORITHM_PCF_TENT_5X5
// point
#define SHADOW_DISPATCH_POINT_TEX 3
#define SHADOW_DISPATCH_POINT_SMP 0

//punctual
#define SHADOW_DISPATCH_PUNC_TEX 3
#define SHADOW_DISPATCH_PUNC_SMP 0
#define SHADOW_DISPATCH_PUNC_ALG GPUSHADOWALGORITHM_PCF_TENT_7X7
#define SHADOW_DISPATCH_PUNC_ALG GPUSHADOWALGORITHM_PCF_9TAP
// example of overriding directional lights
#ifdef SHADOW_DISPATCH_USE_CUSTOM_DIRECTIONAL

20
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs


static Texture2DArray m_DefaultTexture2DArray;
TextureCacheCubemap m_CubeReflTexArray;
int m_CubeReflTexArraySize = 128;
int m_CookieTexArraySize = 16;
int m_CubeCookieTexArraySize = 16;
public class LightList
{

s_shadowDatas = new ComputeBuffer(k_MaxCascadeCount + k_MaxShadowOnScreen, System.Runtime.InteropServices.Marshal.SizeOf(typeof(ShadowData)));
m_CookieTexArray = new TextureCache2D();
m_CookieTexArray.AllocTextureArray(8, textureSettings.spotCookieSize, textureSettings.spotCookieSize, TextureFormat.RGBA32, true);
m_CookieTexArray.AllocTextureArray(m_CookieTexArraySize, textureSettings.spotCookieSize, textureSettings.spotCookieSize, TextureFormat.RGBA32, true);
m_CubeCookieTexArray.AllocTextureArray(4, textureSettings.pointCookieSize, TextureFormat.RGBA32, true);
m_CubeCookieTexArray.AllocTextureArray(m_CubeCookieTexArraySize, textureSettings.pointCookieSize, TextureFormat.RGBA32, true);
m_CubeReflTexArray.AllocTextureArray(32, textureSettings.reflectionCubemapSize, TextureCache.GetPreferredHdrCompressedTextureFormat, true);
m_CubeReflTexArray.AllocTextureArray(m_CubeReflTexArraySize, textureSettings.reflectionCubemapSize, TextureCache.GetPreferredHdrCompressedTextureFormat, true);
s_GenAABBKernel = buildScreenAABBShader.FindKernel("ScreenBoundsAABB");

// probe.texture can be null when we are adding a reflection probe in the editor
if (probe.texture == null || envLightCount >= k_MaxEnvLightsOnScreen)
continue;
// Work around the culling issues. TODO: fix culling in C++.
if (probe.probe == null || !probe.probe.isActiveAndEnabled)
continue;
// Work around the data issues.
if (probe.localToWorld.determinant == 0)
{
Debug.LogError("Reflection probe " + probe.probe.name + " has an invalid local frame and needs to be fixed.");
continue;
}
// TODO: Support LightVolumeType.Sphere, currently in UI there is no way to specify a sphere influence volume
LightVolumeType lightVolumeType = probe.boxProjection != 0 ? LightVolumeType.Box : LightVolumeType.Box;

42
ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/Editor/LayeredLitUI.cs


const string kHeightTransition = "_HeightTransition";
// UI
MaterialProperty showMaterialReferences = null;
const string kShowMaterialReferences = "_ShowMaterialReferences";
MaterialProperty[] showLayer = new MaterialProperty[kMaxLayerCount];
const string kShowLayer = "_ShowLayer";

useMainLayerInfluence = FindProperty(kkUseMainLayerInfluence, props);
useHeightBasedBlend = FindProperty(kUseHeightBasedBlend, props);
heightTransition = FindProperty(kHeightTransition, props);
showMaterialReferences = FindProperty(kShowMaterialReferences, props);
for (int i = 0; i < kMaxLayerCount; ++i)
{

bool DoMaterialReferencesGUI(AssetImporter materialImporter)
{
EditorGUILayout.LabelField(styles.materialReferencesText, EditorStyles.boldLabel);
EditorGUI.indentLevel++;
showMaterialReferences.floatValue = EditorGUILayout.Foldout(showMaterialReferences.floatValue != 0.0f, styles.materialReferencesText, styles.layerLabelColors[0]) ? 1.0f : 0.0f;
if (showMaterialReferences.floatValue == 0.0f)
return false;
bool layersChanged = false;
Material material = m_MaterialEditor.target as Material;

SynchronizeLayerProperties(material, m_MaterialLayers, layerIndex, false);
layersChanged = true;
}
}
GUILayout.BeginHorizontal();
{
GUILayout.FlexibleSpace();
if (GUILayout.Button(styles.syncAllButUVButtonText))
GUILayout.BeginHorizontal();
SynchronizeAllLayersProperties(true);
layersChanged = true;
}
if (GUILayout.Button(styles.syncAllButtonText))
{
SynchronizeAllLayersProperties(false);
layersChanged = true;
GUILayout.FlexibleSpace();
if (GUILayout.Button(styles.syncAllButUVButtonText))
{
SynchronizeLayerProperties(material, m_MaterialLayers, layerIndex, true);
layersChanged = true;
}
if (GUILayout.Button(styles.syncAllButtonText))
{
SynchronizeLayerProperties(material, m_MaterialLayers, layerIndex, false);
layersChanged = true;
}
GUILayout.EndHorizontal();
GUILayout.EndHorizontal();
EditorGUI.indentLevel--;
return layersChanged;
}

EditorGUILayout.Space();
layerChanged |= DoMaterialReferencesGUI(materialImporter);
EditorGUILayout.Space();
for (int i = 0; i < numLayer; i++)
{
layerChanged |= DoLayerGUI(materialImporter, i);

layerChanged |= DoMaterialReferencesGUI(materialImporter);
layerChanged |= GUI.changed;
GUI.changed = false;

1
ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader


[HideInInspector] _UVDetailsMappingMask2("_UVDetailsMappingMask2", Color) = (1, 0, 0, 0)
[HideInInspector] _UVDetailsMappingMask3("_UVDetailsMappingMask3", Color) = (1, 0, 0, 0)
[HideInInspector] _ShowMaterialReferences("_ShowMaterialReferences", Float) = 0
[HideInInspector] _ShowLayer0("_ShowLayer0", Float) = 0
[HideInInspector] _ShowLayer1("_ShowLayer1", Float) = 0
[HideInInspector] _ShowLayer2("_ShowLayer2", Float) = 0

1
ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader


[ToggleOff] _TessellationTilingScale("Tessellation tiling scale", Float) = 1.0
// TODO: Handle culling mode for backface culling
[HideInInspector] _ShowMaterialReferences("_ShowMaterialReferences", Float) = 0
[HideInInspector] _ShowLayer0("_ShowLayer0", Float) = 0
[HideInInspector] _ShowLayer1("_ShowLayer1", Float) = 0
[HideInInspector] _ShowLayer2("_ShowLayer2", Float) = 0

11
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitDataInternal.hlsl


// Apply tiling options
ADD_IDX(layerTexCoord.base).uv = TRANSFORM_TEX(uvBase, ADD_IDX(_BaseColorMap));
ADD_IDX(layerTexCoord.details).uv = TRANSFORM_TEX(uvDetails, ADD_IDX(_DetailMap));
// Detail map tiling option inherit from the tiling of the base
ADD_IDX(layerTexCoord.details).uv = TRANSFORM_TEX(TRANSFORM_TEX(uvDetails, ADD_IDX(_BaseColorMap)), ADD_IDX(_DetailMap));
ADD_IDX(layerTexCoord.details).uvXZ = TRANSFORM_TEX(uvXZ, ADD_IDX(_DetailMap));
ADD_IDX(layerTexCoord.details).uvXY = TRANSFORM_TEX(uvXY, ADD_IDX(_DetailMap));
ADD_IDX(layerTexCoord.details).uvZY = TRANSFORM_TEX(uvZY, ADD_IDX(_DetailMap));
ADD_IDX(layerTexCoord.details).uvXZ = TRANSFORM_TEX(TRANSFORM_TEX(uvXZ, ADD_IDX(_BaseColorMap)), ADD_IDX(_DetailMap));
ADD_IDX(layerTexCoord.details).uvXY = TRANSFORM_TEX(TRANSFORM_TEX(uvXY, ADD_IDX(_BaseColorMap)), ADD_IDX(_DetailMap));
ADD_IDX(layerTexCoord.details).uvZY = TRANSFORM_TEX(TRANSFORM_TEX(uvZY, ADD_IDX(_BaseColorMap)), ADD_IDX(_DetailMap));
#ifdef SURFACE_GRADIENT
// This part is only relevant for normal mapping with UV_MAPPING_UVSET

6
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/SSSProfile/SkinSSSProfile.asset


m_Name: SkinSSSProfile
m_EditorClassIdentifier:
scatteringDistance: {r: 0.758, g: 0.321, b: 0.201, a: 1}
transmissionTint: {r: 1, g: 0.71866125, b: 0.46323532, a: 1}
texturingMode: 1
transmissionTint: {r: 0.7568628, g: 0.32156864, b: 0.20000002, a: 1}
texturingMode: 0
thicknessRemap: {x: 0, y: 20.18}
thicknessRemap: {x: 0, y: 8.152544}
worldScale: 1
settingsIndex: 0
m_ShapeParam: {x: 1.3192612, y: 3.1152647, z: 4.9751244}

6
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/ShaderPass/LitDepthPass.hlsl


// This first set of define allow to say which attributes will be use by the mesh in the vertex and domain shader (for tesselation)
// Tesselation require normal
#if defined(TESSELLATION_ON) || REQUIRE_TANGENT_TO_WORLD
#if defined(TESSELLATION_ON) || REQUIRE_TANGENT_TO_WORLD || defined(_VERTEX_WIND)
#endif
#ifdef _VERTEX_WIND
#define ATTRIBUTES_NEED_COLOR
#endif
// About UV

6
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/ShaderPass/LitDistortionPass.hlsl


// This first set of define allow to say which attributes will be use by the mesh in the vertex and domain shader (for tesselation)
// Tesselation require normal
#if defined(TESSELLATION_ON) || REQUIRE_TANGENT_TO_WORLD
#if defined(TESSELLATION_ON) || REQUIRE_TANGENT_TO_WORLD || defined(_VERTEX_WIND)
#endif
#ifdef _VERTEX_WIND
#define ATTRIBUTES_NEED_COLOR
#endif
// About UV

7
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/ShaderPass/LitMetaPass.hlsl


#ifndef SHADERPASS
#ifndef SHADERPASS
#error Undefine_SHADERPASS
#endif

#ifdef _VERTEX_WIND
#define ATTRIBUTES_NEED_COLOR
#define ATTRIBUTES_NEED_NORMAL
#endif
#if defined(LAYERED_LIT_SHADER) && (defined(_LAYER_MASK_VERTEX_COLOR_MUL) || defined(_LAYER_MASK_VERTEX_COLOR_ADD))
#define ATTRIBUTES_NEED_COLOR

7
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/ShaderPass/LitVelocityPass.hlsl


#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)
#if defined(TESSELLATION_ON) || REQUIRE_TANGENT_TO_WORLD
#if defined(TESSELLATION_ON) || REQUIRE_TANGENT_TO_WORLD || defined(_VERTEX_WIND)
#endif
#ifdef _VERTEX_WIND
#define ATTRIBUTES_NEED_COLOR
#endif
// About UV

10
ScriptableRenderPipeline/HDRenderPipeline/Material/MaterialUtilities.hlsl


float3 bakeDiffuseLighting = float3(0.0, 0.0, 0.0);
#ifdef UNITY_LIGHTMAP_FULL_HDR
bool useRGBMLightmap = false;
#else
bool useRGBMLightmap = true;
#endif
uvStaticLightmap, unity_LightmapST, normalWS, true);
uvStaticLightmap, unity_LightmapST, normalWS, useRGBMLightmap);
bakeDiffuseLighting += SampleSingleLightmap(TEXTURE2D_PARAM(unity_Lightmap, samplerunity_Lightmap), uvStaticLightmap, unity_LightmapST, true);
bakeDiffuseLighting += SampleSingleLightmap(TEXTURE2D_PARAM(unity_Lightmap, samplerunity_Lightmap), uvStaticLightmap, unity_LightmapST, useRGBMLightmap);
#endif
#endif

14
ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/VertMesh.hlsl


VaryingsMeshType output;
float3 positionWS = TransformObjectToWorld(input.positionOS);
float3 normalWS = float3(0.0, 0.0, 0.0);
#if defined(ATTRIBUTES_NEED_NORMAL)
float3 normalWS = TransformObjectToWorldNormal(input.normalOS);
#endif
#if (defined(VARYINGS_NEED_TANGENT_TO_WORLD) || defined(TESSELLATION_ON)) && (SHADERPASS != SHADERPASS_VELOCITY)
normalWS = TransformObjectToWorldNormal(input.normalOS);
#endif
#if defined(VARYINGS_NEED_TANGENT_TO_WORLD) || defined(VARYINGS_DS_NEED_TANGENT)
tangentWS = float4(TransformObjectToWorldDir(input.tangentOS.xyz), input.tangentOS.w);
#endif

#endif
#if _VERTEX_WIND
// This code is disabled for velocity pass for now because at the moment we cannot have Normals with the velocity pass (this attributes holds last frame data)
// TODO: Remove the velocity pass test when velocity is properly handled.
#if defined(_VERTEX_WIND) && (SHADERPASS != SHADERPASS_VELOCITY)
ApplyWind(positionWS, normalWS, rootWP, _Stiffness, _Drag, _ShiverDrag, _ShiverDirectionality, _InitialBend, vertexColor.a, _Time);
ApplyWind(positionWS, normalWS, rootWP, _Stiffness, _Drag, _ShiverDrag, _ShiverDirectionality, _InitialBend, input.color.a, _Time);
#endif
#if _FPS_MODE

2
ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs


{
// TODO: Properly send the cubemap to Enlighten. Currently workaround is to set the cubemap in a Skybox/cubemap material
m_StandardSkyboxMaterial.SetTexture("_Tex", m_SkyboxCubemapRT);
RenderSettings.skybox = m_StandardSkyboxMaterial; // Setup this material as the default to be use in RenderSettings
RenderSettings.skybox = IsSkyValid() ? m_StandardSkyboxMaterial : null; // Setup this material as the default to be use in RenderSettings
RenderSettings.ambientIntensity = 1.0f; // fix this to 1, this parameter should not exist!
RenderSettings.ambientMode = UnityEngine.Rendering.AmbientMode.Skybox; // Force skybox for our HDRI
RenderSettings.reflectionIntensity = 1.0f;

3
ScriptableRenderPipeline/LightweightPipeline/Editor/LightweightAssetInspector.cs


public static GUIContent attenuationTextureLabel = new GUIContent("Attenuation Texture", "Light attenuation falloff texture");
}
private int kMaxSupportedPixelLights = 5;
private SerializedProperty m_LinearRenderingProperty;
private SerializedProperty m_RenderScale;
private SerializedProperty m_MaxPixelLights;

EditorGUILayout.EndHorizontal();
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField(Styles.maxPixelLights);
m_MaxPixelLights.intValue = EditorGUILayout.IntSlider(m_MaxPixelLights.intValue, 0, 4);
m_MaxPixelLights.intValue = EditorGUILayout.IntSlider(m_MaxPixelLights.intValue, 0, kMaxSupportedPixelLights);
EditorGUILayout.EndHorizontal();
EditorGUILayout.PropertyField(m_SupportsVertexLightProp, Styles.enableVertexLightLabel);
EditorGUILayout.PropertyField(m_MSAA, Styles.msaaContent);

72
ScriptableRenderPipeline/LightweightPipeline/Editor/LightweightPipelineUpgraders.cs


using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering.LightweightPipeline;
namespace UnityEditor.Experimental.Rendering.LightweightPipeline
{

blendMode = UpgradeBlendMode.Opaque,
specularSource = SpecularSource.NoSpecular,
glosinessSource = GlossinessSource.BaseAlpha,
reflectionSource = ReflectionSource.NoReflection
};
static public UpgradeParams specularOpaque = new UpgradeParams()

glosinessSource = GlossinessSource.BaseAlpha,
reflectionSource = ReflectionSource.NoReflection
};
static public UpgradeParams diffuseAlpha = new UpgradeParams()

glosinessSource = GlossinessSource.SpecularAlpha,
reflectionSource = ReflectionSource.NoReflection
};
static public UpgradeParams specularAlpha = new UpgradeParams()

glosinessSource = GlossinessSource.SpecularAlpha,
reflectionSource = ReflectionSource.NoReflection
};
static public UpgradeParams diffuseAlphaCutout = new UpgradeParams()

glosinessSource = GlossinessSource.SpecularAlpha,
reflectionSource = ReflectionSource.NoReflection
};
static public UpgradeParams specularAlphaCutout = new UpgradeParams()

glosinessSource = GlossinessSource.SpecularAlpha,
reflectionSource = ReflectionSource.NoReflection
};
static public UpgradeParams diffuseCubemap = new UpgradeParams()

glosinessSource = GlossinessSource.BaseAlpha,
reflectionSource = ReflectionSource.Cubemap
};
static public UpgradeParams specularCubemap = new UpgradeParams()

glosinessSource = GlossinessSource.BaseAlpha,
reflectionSource = ReflectionSource.Cubemap
};
static public UpgradeParams diffuseCubemapAlpha = new UpgradeParams()

glosinessSource = GlossinessSource.BaseAlpha,
reflectionSource = ReflectionSource.Cubemap
};
static public UpgradeParams specularCubemapAlpha = new UpgradeParams()

glosinessSource = GlossinessSource.BaseAlpha,
reflectionSource = ReflectionSource.Cubemap
};
}

{
RenameShader(oldShaderName, "ScriptableRenderPipeline/LightweightPipeline/NonPBR", UpdateMaterialKeywords);
RenameShader(oldShaderName, LightweightPipelineAsset.m_SimpleLightShaderPath, UpdateMaterialKeywords);
SetFloat("_ReflectionSource", (float)upgradeParams.reflectionSource);
if (oldShaderName.Contains("Legacy Shaders/Self-Illumin"))
{

public static void UpdateMaterialKeywords(Material material)
{
material.shaderKeywords = null;
UpdateMaterialReflectionSource(material);
LightweightShaderHelper.SetKeyword(material, "_CUBEMAP_REFLECTION", material.GetTexture("_Cube"));
LightweightShaderHelper.SetKeyword(material, "_EMISSION", material.GetTexture("_EmissionMap"));
// A material's GI flag internally keeps track of whether emission is enabled at all, it's enabled but has no effect
// or is enabled and may be modified at runtime. This state depends on the values of the current flag and emissive color.
// The fixup routine makes sure that the material is in the correct state if/when changes are made to the mode or color.
MaterialEditor.FixupEmissiveFlag(material);
bool shouldEmissionBeEnabled = (material.globalIlluminationFlags & MaterialGlobalIlluminationFlags.EmissiveIsBlack) == 0;
LightweightShaderHelper.SetKeyword(material, "_EMISSION", shouldEmissionBeEnabled);
}
private static void UpdateMaterialSpecularSource(Material material)

{
LightweightShaderHelper.SetKeyword(material, "_SPECGLOSSMAP", false);
LightweightShaderHelper.SetKeyword(material, "_SPECGLOSSMAP_BASE_ALPHA", false);
}
else if (specSource == SpecularSource.SpecularTextureAndColor && material.GetTexture("_SpecGlossMap"))
{
GlossinessSource glossSource = (GlossinessSource)material.GetFloat("_GlossinessSource");
if (glossSource == GlossinessSource.BaseAlpha)
{
LightweightShaderHelper.SetKeyword(material, "_SPECGLOSSMAP", false);
LightweightShaderHelper.SetKeyword(material, "_SPECGLOSSMAP_BASE_ALPHA", true);
}
else
{
LightweightShaderHelper.SetKeyword(material, "_SPECGLOSSMAP", true);
LightweightShaderHelper.SetKeyword(material, "_SPECGLOSSMAP_BASE_ALPHA", false);
}
LightweightShaderHelper.SetKeyword(material, "_SPECULAR_COLOR", false);
LightweightShaderHelper.SetKeyword(material, "_GLOSSINESS_FROM_BASE_ALPHA", false);
LightweightShaderHelper.SetKeyword(material, "_SPECGLOSSMAP", false);
LightweightShaderHelper.SetKeyword(material, "_SPECGLOSSMAP_BASE_ALPHA", false);
LightweightShaderHelper.SetKeyword(material, "_SPECULAR_COLOR", true);
}
}
private static void UpdateMaterialReflectionSource(Material material)
{
LightweightShaderHelper.SetKeyword(material, "_REFLECTION_CUBEMAP", false);
LightweightShaderHelper.SetKeyword(material, "_REFLECTION_PROBE", false);
ReflectionSource reflectionSource = (ReflectionSource)material.GetFloat("_ReflectionSource");
if (reflectionSource == ReflectionSource.Cubemap && material.GetTexture("_Cube"))
{
LightweightShaderHelper.SetKeyword(material, "_REFLECTION_CUBEMAP", true);
}
else if (reflectionSource == ReflectionSource.ReflectionProbe)
{
LightweightShaderHelper.SetKeyword(material, "_REFLECTION_PROBE", true);
GlossinessSource glossSource = (GlossinessSource)material.GetFloat("_GlossinessSource");
bool hasGlossMap = material.GetTexture("_SpecGlossMap");
LightweightShaderHelper.SetKeyword(material, "_SPECGLOSSMAP", hasGlossMap);
LightweightShaderHelper.SetKeyword(material, "_SPECULAR_COLOR", !hasGlossMap);
LightweightShaderHelper.SetKeyword(material, "_GLOSSINESS_FROM_BASE_ALPHA", glossSource == GlossinessSource.BaseAlpha);
}
}
}

public StandardUpgrader(string oldShaderName)
{
RenameShader(oldShaderName, "ScriptableRenderPipeline/LightweightPipeline/NonPBR");
RenameShader(oldShaderName, LightweightPipelineAsset.m_PBSShaderPath);
}
}

{
RenameShader(oldShaderName, "ScriptableRenderPipeline/LightweightPipeline/NonPBR");
RenameShader(oldShaderName, LightweightPipelineAsset.m_PBSShaderPath);
SetFloat("_Shininess", 1.0f);
}
}

133
ScriptableRenderPipeline/LightweightPipeline/Editor/ShaderGUI/LightweightStandardSimpleLightingGUI.cs


using System;
using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering;
public class LightweightPipelineMaterialEditor : ShaderGUI
public class LightweightStandardSimpleLightingGUI : ShaderGUI
{
private const float kMinShininessValue = 0.01f;
private MaterialProperty blendModeProp = null;

private MaterialProperty specularSourceProp = null;
private MaterialProperty glossinessSourceProp = null;
private MaterialProperty reflectionSourceProp = null;
private MaterialProperty specularGlossMapProp = null;
private MaterialProperty specularColorProp = null;
private MaterialProperty shininessProp = null;

private MaterialProperty reflectionMapProp = null;
private const float kMaxfp16 = 65536f; // Clamp to a value that fits into fp16.
private ColorPickerHDRConfig m_ColorPickerHDRConfig = new ColorPickerHDRConfig(0f, kMaxfp16, 1 / kMaxfp16, 3f);
private static class Styles
{

public static GUIContent[] specularGlossMapLabels =
{
new GUIContent("Specular Color (RGB)", "Specular Color (RGB)"),
new GUIContent("Specular Color (RGB) Glossiness (A)", "Specular Color (RGB) Glossiness (A)")
new GUIContent("Specular Map (RGB)", "Specular Color (RGB)"),
new GUIContent("Specular Map (RGB) Glossiness (A)", "Specular Color (RGB) Glossiness (A)")
public static GUIContent reflectionMapLabel = new GUIContent("Reflection Source", "Reflection Source Map");
public static GUIContent alphaCutoutWarning =
new GUIContent(
"This material has alpha cutout enabled. Alpha cutout has severe performance impact on mobile!");
public static GUIStyle warningStyle = new GUIStyle();
public static readonly string[] specSourceNames = Enum.GetNames(typeof(SpecularSource));
public static readonly string[] speculaSourceNames = Enum.GetNames(typeof(ReflectionSource));
public static string specularSourceLabel = "Specular Color Source";
public static string glossinessSourceLable = "Glossiness Source";
public static string specularSourceLabel = "Specular";
public static string glossinessSourceLabel = "Glossiness Source";
public static string glossinessSource = "Glossiness Source";
public static string albedoColorLabel = "Base Color";
public static string albedoMapAlphaLabel = "Base(RGB) Alpha(A)";

public static string normalMapLabel = "Normal map";
public static string emissionColorLabel = "Emission Color";
public static string reflectionSourceLabel = "Reflection Source";
}
private void FindMaterialProperties(MaterialProperty[] properties)

bumpMapProp = FindProperty("_BumpMap", properties);
emissionMapProp = FindProperty("_EmissionMap", properties);
emissionColorProp = FindProperty("_EmissionColor", properties);
reflectionMapProp = FindProperty("_Cube", properties);
reflectionSourceProp = FindProperty("_ReflectionSource", properties);
}
public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)

FindMaterialProperties(properties);
EditorGUI.BeginChangeCheck();
DoBlendMode();
{
DoBlendMode();
EditorGUILayout.Space();
DoSpecular();
EditorGUILayout.Space();
DoSpecular();
EditorGUILayout.Space();
m_MaterialEditor.TexturePropertySingleLine(Styles.normalMapText, bumpMapProp);
EditorGUILayout.Space();
m_MaterialEditor.TexturePropertySingleLine(Styles.normalMapText, bumpMapProp);
EditorGUILayout.Space();
DoEmission();
EditorGUILayout.Space();
DoEmissionArea(material);
EditorGUILayout.Space();
DoReflection();
EditorGUI.BeginChangeCheck();
m_MaterialEditor.TextureScaleOffsetProperty(albedoMapProp);
if (EditorGUI.EndChangeCheck())
emissionMapProp.textureScaleAndOffset = albedoMapProp.textureScaleAndOffset; // Apply the main texture scale and offset to the emission texture as well, for Enlighten's sake
}
if (EditorGUI.EndChangeCheck())
LegacyBlinnPhongUpgrader.UpdateMaterialKeywords(material);

EditorGUILayout.Space();
EditorGUILayout.Space();
if ((UpgradeBlendMode)blendModeProp.floatValue == UpgradeBlendMode.Cutout)
{
Styles.warningStyle.normal.textColor = Color.yellow;
EditorGUILayout.LabelField(Styles.alphaCutoutWarning, Styles.warningStyle);
}
}
public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader)

string oldShaderName = oldShader.name;
string[] shaderStrings = oldShaderName.Split('/');
if (shaderStrings[0].Equals("Legacy Shaders") || shaderStrings[0].Equals("Mobile") ||
shaderStrings[0].Equals("Reflective"))
if (shaderStrings[0].Equals("Legacy Shaders") || shaderStrings[0].Equals("Mobile"))
{
ConvertFromLegacy(material, oldShaderName);
}

int glossSource = (int)glossinessSourceProp.floatValue;
m_MaterialEditor.TexturePropertySingleLine(Styles.albedoGlosinessLabels[glossSource], albedoMapProp,
albedoColorProp);
m_MaterialEditor.TextureScaleOffsetProperty(albedoMapProp);
}
m_MaterialEditor.TextureScaleOffsetProperty(albedoMapProp);}
m_MaterialEditor.TextureScaleOffsetProperty(albedoMapProp);
if (mode == UpgradeBlendMode.Cutout)
m_MaterialEditor.RangeProperty(alphaCutoffProp, "Cutoff");
}

{
EditorGUILayout.Space();
int source = (int)specularSourceProp.floatValue;
SpecularSource specularSource = (SpecularSource)specularSourceProp.floatValue;
source = EditorGUILayout.Popup(Styles.specularSourceLabel, source, Styles.specSourceNames);
bool enabled = EditorGUILayout.Toggle(Styles.specularSourceLabel, specularSource == SpecularSource.SpecularTextureAndColor);
specularSourceProp.floatValue = source;
specularSourceProp.floatValue = enabled ? (float)SpecularSource.SpecularTextureAndColor : (float)SpecularSource.NoSpecular;
int glossinessSource = (int)glossinessSourceProp.floatValue;
bool hasSpecularMap = specularGlossMapProp.textureValue != null;
m_MaterialEditor.TexturePropertySingleLine(Styles.specularGlossMapLabels[(int)glossinessSourceProp.floatValue], specularGlossMapProp, hasSpecularMap ? null : specularColorProp);
EditorGUI.indentLevel += 2;
GUI.enabled = hasSpecularMap;
int glossinessSource = hasSpecularMap ? (int)glossinessSourceProp.floatValue : (int)GlossinessSource.BaseAlpha;
glossinessSource = EditorGUILayout.Popup(Styles.glossinessSourceLable, glossinessSource,
Styles.glossinessSourceNames);
glossinessSource = EditorGUILayout.Popup(Styles.glossinessSourceLabel, glossinessSource, Styles.glossinessSourceNames);
glossinessSourceProp.floatValue = (float)glossinessSource;
}
glossinessSourceProp.floatValue = glossinessSource;
GUI.enabled = true;
int glossSource = (int)glossinessSourceProp.floatValue;
if (specSource == SpecularSource.SpecularTextureAndColor)
{
m_MaterialEditor.TexturePropertySingleLine(Styles.specularGlossMapLabels[glossSource],
specularGlossMapProp, specularColorProp);
}
if (specSource != SpecularSource.NoSpecular)
{
EditorGUI.indentLevel -= 2;
private void DoEmission()
void DoEmissionArea(Material material)
// Emission for GI?
bool hadEmissionMap = emissionMapProp.textureValue != null;
m_MaterialEditor.TexturePropertySingleLine(Styles.emissionMapLabel, emissionMapProp, emissionColorProp);
bool hadEmissionTexture = emissionMapProp.textureValue != null;
float maxValue = emissionColorProp.colorValue.maxColorComponent;
if (emissionMapProp.textureValue != null && !hadEmissionMap && maxValue <= 0.0f)
// Texture and HDR color controls
m_MaterialEditor.TexturePropertyWithHDRColor(Styles.emissionMapLabel, emissionMapProp, emissionColorProp, m_ColorPickerHDRConfig, false);
// If texture was assigned and color was black set color to white
float brightness = emissionColorProp.colorValue.maxColorComponent;
if (emissionMapProp.textureValue != null && !hadEmissionTexture && brightness <= 0f)
m_MaterialEditor.LightmapEmissionFlagsProperty(MaterialEditor.kMiniTextureFieldLabelIndentLevel, true);
// LW does not support RealtimeEmissive. We set it to bake emissive and handle the emissive is black right.
material.globalIlluminationFlags = MaterialGlobalIlluminationFlags.BakedEmissive;
if (brightness <= 0f)
material.globalIlluminationFlags |= MaterialGlobalIlluminationFlags.EmissiveIsBlack;
private void DoReflection()
{
EditorGUILayout.Space();
int source = (int)reflectionSourceProp.floatValue;
EditorGUI.BeginChangeCheck();
source = EditorGUILayout.Popup(Styles.reflectionSourceLabel, source, Styles.speculaSourceNames);
if (EditorGUI.EndChangeCheck())
reflectionSourceProp.floatValue = (float)source;
EditorGUILayout.Space();
ReflectionSource reflectionSource = (ReflectionSource)reflectionSourceProp.floatValue;
if (reflectionSource == ReflectionSource.Cubemap)
m_MaterialEditor.TexturePropertySingleLine(Styles.reflectionMapLabel, reflectionMapProp);
}
private void ConvertFromLegacy(Material material, string oldShaderName)
{
UpgradeParams shaderUpgradeParams;

else
shaderUpgradeParams.specularSource = SpecularSource.NoSpecular;
if (oldShaderName.Contains("Reflective"))
shaderUpgradeParams.reflectionSource = ReflectionSource.Cubemap;
else
shaderUpgradeParams.reflectionSource = ReflectionSource.NoReflection;
material.SetFloat("_ReflectionSource", (float)shaderUpgradeParams.reflectionSource);
if (oldShaderName.Contains("Self-Illumin"))
{

42
ScriptableRenderPipeline/LightweightPipeline/Editor/ShaderGUI/LightweightStandardGUI.cs


namespace UnityEditor
{
internal class LightweightStandardShaderGUI : ShaderGUI
internal class LightweightStandardGUI : ShaderGUI
{
public enum WorkflowMode : int
{

private MaterialProperty metallic = null;
private MaterialProperty specColor = null;
private MaterialProperty metallicSpecMap = null;
private MaterialProperty metallicGlossMap = null;
private MaterialProperty specGlossMap = null;
private MaterialProperty highlights = null;
private MaterialProperty reflections = null;

metallic = FindProperty("_Metallic", props);
specColor = FindProperty("_SpecColor", props);
metallicSpecMap = FindProperty("_MetallicSpecGlossMap", props);
metallicGlossMap = FindProperty("_MetallicGlossMap", props);
specGlossMap = FindProperty("_SpecGlossMap", props);
highlights = FindProperty("_SpecularHighlights", props);
reflections = FindProperty("_GlossyReflections", props);

void DoMetallicSpecularArea()
{
GUIContent metallicSpecMapName;
MaterialProperty metallicSpecColorProp;
bool hasGlossMap = false;
metallicSpecMapName = Styles.metallicMapText;
hasGlossMap = metallicGlossMap.textureValue != null;
metallicSpecColorProp = metallic;
m_MaterialEditor.TexturePropertySingleLine(Styles.metallicMapText, metallicGlossMap,
hasGlossMap ? null : metallic);
metallicSpecMapName = Styles.specularMapText;
hasGlossMap = specGlossMap.textureValue != null;
metallicSpecColorProp = specColor;
m_MaterialEditor.TexturePropertySingleLine(Styles.specularMapText, specGlossMap,
hasGlossMap ? null : specColor);
bool hasGlossMap = metallicSpecMap.textureValue != null;
m_MaterialEditor.TexturePropertySingleLine(metallicSpecMapName, metallicSpecMap, hasGlossMap ? null : metallicSpecColorProp);
bool showSmoothnessScale = hasGlossMap;
if (smoothnessMapChannel != null)
{

// Note: keywords must be based on Material value not on MaterialProperty due to multi-edit & material animation
// (MaterialProperty value might come from renderer material property block)
bool isSpecularWorkFlow = (WorkflowMode)material.GetFloat("_WorkflowMode") == WorkflowMode.Specular;
bool hasGlossMap = false;
if (isSpecularWorkFlow)
hasGlossMap = material.GetTexture("_SpecGlossMap");
else
hasGlossMap = material.GetTexture("_MetallicGlossMap");
LightweightShaderHelper.SetKeyword(material, "_METALLICSPECGLOSSMAP", hasGlossMap);
LightweightShaderHelper.SetKeyword(material, "_SPECGLOSSMAP", hasGlossMap && isSpecularWorkFlow);
LightweightShaderHelper.SetKeyword(material, "_METALLICGLOSSMAP", hasGlossMap && !isSpecularWorkFlow);
LightweightShaderHelper.SetKeyword(material, "_SPECULARHIGHLIGHTS_ON", material.GetFloat("_SpecularHighlights") > 0.0f);
LightweightShaderHelper.SetKeyword(material, "_GLOSSYREFLECTIONS_ON", material.GetFloat("_GlossyReflections") > 0.0f);
LightweightShaderHelper.SetKeyword(material, "_METALLICSPECGLOSSMAP", material.GetTexture("_MetallicSpecGlossMap") != null);
LightweightShaderHelper.SetKeyword(material, "_SPECULARHIGHLIGHTS_OFF", material.GetFloat("_SpecularHighlights") == 0.0f);
LightweightShaderHelper.SetKeyword(material, "_GLOSSYREFLECTIONS_OFF", material.GetFloat("_GlossyReflections") == 0.0f);
LightweightShaderHelper.SetKeyword(material, "_OCCLUSIONMAP", material.GetTexture("_OcclusionMap"));
LightweightShaderHelper.SetKeyword(material, "_PARALLAXMAP", material.GetTexture("_ParallaxMap"));
LightweightShaderHelper.SetKeyword(material, "_DETAIL_MULX2", material.GetTexture("_DetailAlbedoMap") || material.GetTexture("_DetailNormalMap"));

1
ScriptableRenderPipeline/LightweightPipeline/Editor/UpgradeCommon.cs


public UpgradeBlendMode blendMode;
public SpecularSource specularSource;
public GlossinessSource glosinessSource;
public ReflectionSource reflectionSource;
}
}

483
ScriptableRenderPipeline/LightweightPipeline/LightweightPipeline.cs


using System;
using System.Collections.Generic;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.XR;

public struct LightData
{
public int pixelLightsCount;
public int additionalPixelLightsCount;
public int shadowLightIndex;
public bool isSingleLight;
public int mainLightIndex;
public bool hasAdditionalLights;
public bool shadowsRendered;
}

private Vector4[] m_LightSpotDirections = new Vector4[kMaxVisibleLights];
private Camera m_CurrCamera = null;
private LightType m_SingleLightType = LightType.Directional;
private int m_LightIndicesCount = 0;
private ComputeBuffer m_LightIndexListBuffer;

private static readonly ShaderPassName m_LitPassName = new ShaderPassName("LightweightForward");
private static readonly ShaderPassName m_UnlitPassName = new ShaderPassName("SRPDefaultUnlit");
private RenderTextureFormat m_ColorFormat = RenderTextureFormat.ARGB32;
private RenderTextureFormat m_ColorFormat;
private PostProcessRenderContext m_PostProcessRenderContext;
private CameraComparer m_CameraComparer = new CameraComparer();

m_Asset = asset;
BuildShadowSettings();
PerFrameBuffer._GlossyEnvironmentColor = Shader.PropertyToID("_GlossyEnvironmentColor");
PerFrameBuffer._AttenuationTexture = Shader.PropertyToID("_AttenuationTexture");
PerCameraBuffer._MainLightPosition = Shader.PropertyToID("_MainLightPosition");
PerCameraBuffer._MainLightColor = Shader.PropertyToID("_MainLightColor");
PerCameraBuffer._MainLightAttenuationParams = Shader.PropertyToID("_MainLightAttenuationParams");
PerCameraBuffer._MainLightSpotDir = Shader.PropertyToID("_MainLightSpotDir");
PerCameraBuffer._AdditionalLightCount = Shader.PropertyToID("_AdditionalLightCount");
PerCameraBuffer._AdditionalLightPosition = Shader.PropertyToID("_AdditionalLightPosition");
PerCameraBuffer._AdditionalLightColor = Shader.PropertyToID("_AdditionalLightColor");
PerCameraBuffer._AdditionalLightAttenuationParams = Shader.PropertyToID("_AdditionalLightAttenuationParams");
PerCameraBuffer._AdditionalLightSpotDir = Shader.PropertyToID("_AdditionalLightSpotDir");
m_ShadowMapTexture = Shader.PropertyToID("_ShadowMap");
m_CameraColorTexture = Shader.PropertyToID("_CameraRT");
m_CameraDepthTexture = Shader.PropertyToID("_CameraDepthTexture");

// instead this should be forced when using SRP, since all SRP use linear lighting.
GraphicsSettings.lightsUseLinearIntensity = true;
SetupPerFrameShaderConstants(ref context);
// Sort cameras array by camera depth
PostProcessLayer postProcessLayer;
RenderingConfiguration renderingConfig = SetupRendering(out postProcessLayer);
bool postProcessEnabled = LightweightUtils.HasFlag(renderingConfig, RenderingConfiguration.PostProcess);
ScriptableCullingParameters cullingParameters;
if (!CullResults.GetCullingParameters(m_CurrCamera, stereoEnabled, out cullingParameters))
continue;

#if UNITY_EDITOR
// emit scene view UI
// Emit scene view UI
// Render Shadow Map
if (lightData.shadowLightIndex > -1)
lightData.shadowsRendered = RenderShadows(ref m_CullResults,
ref visibleLights[lightData.shadowLightIndex], lightData.shadowLightIndex, ref context);
ShadowPass(visibleLights, ref context, ref lightData);
ForwardPass(visibleLights, ref context, ref lightData, stereoEnabled);
// Setup camera matrices
context.SetupCameraProperties(m_CurrCamera, stereoEnabled);
context.Submit();
}
}
// Setup light and shadow shader constants
SetupShaderLightConstants(visibleLights, ref lightData, ref m_CullResults, ref context);
if (lightData.shadowsRendered)
SetupShadowShaderConstants(ref context, ref visibleLights[lightData.shadowLightIndex],
lightData.shadowLightIndex, m_ShadowCasterCascadesCount);
SetShaderKeywords(ref lightData, ref context);
private void ShadowPass(VisibleLight[] visibleLights, ref ScriptableRenderContext context, ref LightData lightData)
{
if (m_Asset.AreShadowsEnabled() && lightData.mainLightIndex != -1)
{
VisibleLight mainLight = visibleLights[lightData.mainLightIndex];
if (mainLight.light.shadows != LightShadows.None)
lightData.shadowsRendered = RenderShadows (ref m_CullResults,
ref mainLight, lightData.mainLightIndex, ref context);
}
}
RendererConfiguration configuration = RendererConfiguration.PerObjectReflectionProbes | RendererConfiguration.PerObjectLightmaps | RendererConfiguration.PerObjectLightProbe;
if (!lightData.isSingleLight)
configuration |= RendererConfiguration.PerObjectLightIndices8;
private void ForwardPass(VisibleLight[] visibleLights, ref ScriptableRenderContext context, ref LightData lightData, bool stereoEnabled)
{
PostProcessLayer postProcessLayer;
RenderingConfiguration renderingConfig = SetupRendering(out postProcessLayer);
bool postProcessEnabled = LightweightUtils.HasFlag(renderingConfig, RenderingConfiguration.PostProcess);
BeginForwardRendering(ref context, renderingConfig);
CommandBuffer cmd = CommandBufferPool.Get("SetupShaderConstants");
SetupShaderLightConstants(cmd, visibleLights, ref lightData, ref m_CullResults, ref context);
SetShaderKeywords(cmd, ref lightData, visibleLights);
context.ExecuteCommandBuffer(cmd);
CommandBufferPool.Release(cmd);
var litDrawSettings = new DrawRendererSettings(m_CurrCamera, m_LitPassName);
litDrawSettings.sorting.flags = SortFlags.CommonOpaque;
litDrawSettings.rendererConfiguration = configuration;
// Setup camera matrices
context.SetupCameraProperties(m_CurrCamera, stereoEnabled);
RendererConfiguration rendererSettings = GetRendererSettings(ref lightData);
var unlitDrawSettings = new DrawRendererSettings(m_CurrCamera, m_UnlitPassName);
unlitDrawSettings.sorting.flags = SortFlags.CommonTransparent;
BeginForwardRendering(ref context, renderingConfig);
RenderOpaques(ref context, rendererSettings);
context.DrawSkybox(m_CurrCamera);
// Render Opaques
var opaqueFilterSettings = new FilterRenderersSettings(true)
{
renderQueueRange = RenderQueueRange.opaque
};
if (postProcessEnabled)
RenderPostProcess(ref context, postProcessLayer, true);
context.DrawRenderers(m_CullResults.visibleRenderers, ref litDrawSettings, opaqueFilterSettings);
RenderTransparents(ref context, rendererSettings);
// TODO: Check skybox shader
context.DrawSkybox(m_CurrCamera);
if (postProcessEnabled)
RenderPostProcess(ref context, postProcessLayer, false);
if (postProcessEnabled)
RenderPostProcess(ref context, postProcessLayer, true);
EndForwardRendering(ref context, renderingConfig);
// Render Alpha blended
var transparentFilterSettings = new FilterRenderersSettings(true)
{
renderQueueRange = RenderQueueRange.transparent
};
// Release temporary RT
var discardRT = CommandBufferPool.Get();
discardRT.ReleaseTemporaryRT(m_ShadowMapTexture);
discardRT.ReleaseTemporaryRT(m_CameraColorTexture);
discardRT.ReleaseTemporaryRT(m_CameraDepthTexture);
context.ExecuteCommandBuffer(discardRT);
CommandBufferPool.Release(discardRT);
}
litDrawSettings.sorting.flags = SortFlags.CommonTransparent;
context.DrawRenderers(m_CullResults.visibleRenderers, ref litDrawSettings, transparentFilterSettings);
context.DrawRenderers(m_CullResults.visibleRenderers, ref unlitDrawSettings, transparentFilterSettings);
private void RenderOpaques(ref ScriptableRenderContext context, RendererConfiguration settings)
{
var opaqueDrawSettings = new DrawRendererSettings(m_CurrCamera, m_LitPassName);
opaqueDrawSettings.sorting.flags = SortFlags.CommonOpaque;
opaqueDrawSettings.rendererConfiguration = settings;
if (postProcessEnabled)
RenderPostProcess(ref context, postProcessLayer, false);
var opaqueFilterSettings = new FilterRenderersSettings(true)
{
renderQueueRange = RenderQueueRange.opaque
};
EndForwardRendering(ref context, renderingConfig);
context.DrawRenderers(m_CullResults.visibleRenderers, ref opaqueDrawSettings, opaqueFilterSettings);
}
private void RenderTransparents(ref ScriptableRenderContext context, RendererConfiguration settings)
{
var transparentSettings = new DrawRendererSettings(m_CurrCamera, m_LitPassName);
transparentSettings.SetShaderPassName(1, m_UnlitPassName);
transparentSettings.sorting.flags = SortFlags.CommonTransparent;
transparentSettings.rendererConfiguration = settings;
// Release temporary RT
var discardRT = CommandBufferPool.Get();
discardRT.ReleaseTemporaryRT(m_ShadowMapTexture);
discardRT.ReleaseTemporaryRT(m_CameraColorTexture);
discardRT.ReleaseTemporaryRT(m_CameraDepthTexture);
context.ExecuteCommandBuffer(discardRT);
CommandBufferPool.Release(discardRT);
var transparentFilterSettings = new FilterRenderersSettings(true)
{
renderQueueRange = RenderQueueRange.transparent
};
context.Submit();
}
context.DrawRenderers(m_CullResults.visibleRenderers, ref transparentSettings, transparentFilterSettings);
}
private void BuildShadowSettings()

if (XRSettings.eyeTextureDesc.dimension == TextureDimension.Tex2DArray)
renderingConfig |= RenderingConfiguration.IntermediateTextureArray;
m_ColorFormat = m_CurrCamera.allowHDR ? RenderTextureFormat.ARGBHalf : RenderTextureFormat.ARGB32;
postProcessLayer = m_CurrCamera.GetComponent<PostProcessLayer>();
bool intermediateTexture = false;
if (postProcessLayer != null && postProcessLayer.enabled)

else
renderingConfig |= RenderingConfiguration.DefaultViewport;
intermediateTexture |= (m_CurrCamera.targetTexture != null || m_Asset.RenderScale < 1.0f);
intermediateTexture |= (m_CurrCamera.targetTexture != null || m_Asset.RenderScale < 1.0f || m_CurrCamera.allowHDR);
if (intermediateTexture && !LightweightUtils.HasFlag(renderingConfig, RenderingConfiguration.IntermediateTextureArray))
renderingConfig |= RenderingConfiguration.IntermediateTexture;

private void InitializeLightData(VisibleLight[] lights, out LightData lightData)
private void InitializeLightData(VisibleLight[] visibleLights, out LightData lightData)
int lightsCount = lights.Length;
int maxPerPixelLights = Math.Min(m_Asset.MaxSupportedPixelLights, kMaxPerObjectLights);
lightData.pixelLightsCount = Math.Min(lightsCount, maxPerPixelLights);
lightData.vertexLightsCount = (m_Asset.SupportsVertexLight) ? Math.Min(lightsCount - lightData.pixelLightsCount, kMaxPerObjectLights) : 0;
int visibleLightsCount = visibleLights.Length;
// TODO: Handle Vertex lights in this case
lightData.isSingleLight = lightData.pixelLightsCount <= 1;
if (lightData.isSingleLight)
m_SingleLightType = (lightData.pixelLightsCount == 1) ? lights[0].lightType : LightType.Directional;
// kMaxPerObjectLights + 1 main light
int maxSupportedPixelLights = Math.Min(m_Asset.MaxSupportedPixelLights, kMaxPerObjectLights + 1);
int maxPixelLights = Math.Min(maxSupportedPixelLights, visibleLightsCount);
if (maxPixelLights <= 1)
{
lightData.mainLightIndex = maxPixelLights - 1;
lightData.additionalPixelLightsCount = 0;
}
else
{
lightData.mainLightIndex = GetMainLightIndex(visibleLights);
lightData.additionalPixelLightsCount = maxPixelLights - 1;
}
lightData.vertexLightsCount = (m_Asset.SupportsVertexLight) ? Math.Min(visibleLightsCount - maxPixelLights, kMaxPerObjectLights) : 0;
lightData.hasAdditionalLights = (lightData.additionalPixelLightsCount + lightData.vertexLightsCount) > 0;
InitializeMainShadowLightIndex(lights, out lightData.shadowLightIndex);
private void SetupShaderLightConstants(VisibleLight[] lights, ref LightData lightData, ref CullResults cullResults, ref ScriptableRenderContext context)
// How main light is decided:
// 1) If shadows are enabled and at least a shadow light is present:
// Main light is a shadow light. Directional shadow light has priority over the other supported
// shadow lights types.
// Lightweight pipeline only supports 1 single directional shadow light.
// Any additional pixel lights don't cast shadows.
//
// 2) If shadows are disabled or no shadow light is present then main light is the main brighest directional
// 3) If neither a shadow light or main light is first visible light.
private int GetMainLightIndex(VisibleLight[] lights)
if (lightData.isSingleLight)
SetupShaderSingleLightConstants(lights, (lightData.pixelLightsCount > 0) ? 0 : -1, ref context);
else
SetupShaderLightListConstants(lights, ref lightData, ref context);
bool shadowsEnabled = m_Asset.AreShadowsEnabled();
int mainDirectional = -1;
int mainShadowLight = -1;
for (int i = 0; i < lights.Length; ++i)
{
if (shadowsEnabled && LightweightUtils.IsSupportedShadowType (lights[i].lightType) && lights[i].light.shadows != LightShadows.None)
{
// Shadow Type priority: Soft > Hard > None
if (mainShadowLight < 0 || lights[i].light.shadows > lights[mainShadowLight].light.shadows)
mainShadowLight = i;
}
if (lights[i].lightType == LightType.Directional)
{
if (mainDirectional < 0 || lights[i].light.intensity > lights[mainDirectional].light.intensity)
mainDirectional = i;
}
}
if (mainShadowLight >= 0)
{
if (mainDirectional > 0 && lights[mainDirectional].light.shadows != LightShadows.None)
return mainDirectional;
else
return mainShadowLight;
}
if (mainDirectional > 0)
return mainDirectional;
return 0;
}
private void InitializeLightConstants(VisibleLight[] lights, int lightIndex, out Vector4 lightPos, out Vector4 lightColor, out Vector4 lightSpotDir,

}
}
private void SetupShaderSingleLightConstants(VisibleLight[] lights, int lightIndex, ref ScriptableRenderContext context)
private void SetupPerFrameShaderConstants(ref ScriptableRenderContext context)
{
// When glossy reflections are OFF in the shader we set a constant color to use as indirect specular
SphericalHarmonicsL2 ambientSH = RenderSettings.ambientProbe;
Vector4 glossyEnvColor = new Vector4(ambientSH[0, 0], ambientSH[1, 0], ambientSH[2, 0]) * RenderSettings.reflectionIntensity;
CommandBuffer cmd = CommandBufferPool.Get("SetupPerFrameConstants");
cmd.SetGlobalVector(PerFrameBuffer._GlossyEnvironmentColor, glossyEnvColor);
if (m_Asset.AttenuationTexture != null) cmd.SetGlobalTexture(PerFrameBuffer._AttenuationTexture, m_Asset.AttenuationTexture);
context.ExecuteCommandBuffer(cmd);
CommandBufferPool.Release (cmd);
}
private void SetupShaderLightConstants(CommandBuffer cmd, VisibleLight[] lights, ref LightData lightData, ref CullResults cullResults, ref ScriptableRenderContext context)
{
// Main light has an optimized shader path for main light. This will benefit games that only care about a single light.
// Lightweight pipeline also supports only a single shadow light, if available it will be the main light.
if (lightData.mainLightIndex != -1)
{
SetupMainLightConstants (cmd, lights, lightData.mainLightIndex, ref context);
if (lightData.shadowsRendered)
SetupShadowShaderConstants (cmd, ref context, ref lights[lightData.mainLightIndex], m_ShadowCasterCascadesCount);
}
if (lightData.hasAdditionalLights)
SetupAdditionalListConstants(cmd, lights, ref lightData, ref context);
}
private void SetupMainLightConstants(CommandBuffer cmd, VisibleLight[] lights, int lightIndex, ref ScriptableRenderContext context)
CommandBuffer cmd = new CommandBuffer() { name = "SetupSingleLightConstants" };
cmd.SetGlobalVector("_LightPosition", lightPos);
cmd.SetGlobalColor("_LightColor", lightColor);
cmd.SetGlobalVector("_LightSpotDir", lightSpotDir);
cmd.SetGlobalVector("_LightAttenuationParams", lightAttenuationParams);
if (m_Asset.AttenuationTexture != null) cmd.SetGlobalTexture("_AttenuationTexture", m_Asset.AttenuationTexture);
context.ExecuteCommandBuffer(cmd);
cmd.Dispose();
cmd.SetGlobalVector(PerCameraBuffer._MainLightPosition, lightPos);
cmd.SetGlobalColor(PerCameraBuffer._MainLightColor, lightColor);
cmd.SetGlobalVector(PerCameraBuffer._MainLightSpotDir, lightSpotDir);
cmd.SetGlobalVector(PerCameraBuffer._MainLightAttenuationParams, lightAttenuationParams);
private void SetupShaderLightListConstants(VisibleLight[] lights, ref LightData lightData, ref ScriptableRenderContext context)
private void SetupAdditionalListConstants(CommandBuffer cmd, VisibleLight[] lights, ref LightData lightData, ref ScriptableRenderContext context)
int maxLights = Math.Min(kMaxVisibleLights, lights.Length);
int totalLightCount = lights.Length;
int maxLights = Math.Min(kMaxVisibleLights, totalLightCount);
for (int i = 0; i < maxLights; ++i)
InitializeLightConstants(lights, i, out m_LightPositions[i], out m_LightColors[i], out m_LightSpotDirections[i], out m_LightAttenuations[i]);
// Lightweight pipeline only upload kMaxVisibleLights to shader cbuffer.
// We tell the pipe to disable remaining lights by setting it to -1.
for (int i = kMaxVisibleLights; i < lightIndexMap.Length; ++i)
lightIndexMap[i] = -1;
int lightIter = 0;
for (int i = 0; i < totalLightCount; ++i)
{
if (i == lightData.mainLightIndex || lightIter >= maxLights)
{
lightIndexMap[i] = -1;
continue;
}
InitializeLightConstants(lights, i, out m_LightPositions[lightIter], out m_LightColors[lightIter], out m_LightSpotDirections[lightIter], out m_LightAttenuations[lightIter]);
lightIndexMap[i] = lightIter;
lightIter++;
}
CommandBuffer cmd = CommandBufferPool.Get("SetupLightShaderConstants");
cmd.SetGlobalVector("globalLightCount", new Vector4 (lightData.pixelLightsCount, lightData.vertexLightsCount, 0.0f, 0.0f));
cmd.SetGlobalVectorArray ("globalLightPos", m_LightPositions);
cmd.SetGlobalVectorArray ("globalLightColor", m_LightColors);
cmd.SetGlobalVectorArray ("globalLightAtten", m_LightAttenuations);
cmd.SetGlobalVectorArray ("globalLightSpotDir", m_LightSpotDirections);
if (m_Asset.AttenuationTexture != null) cmd.SetGlobalTexture("_AttenuationTexture", m_Asset.AttenuationTexture);
context.ExecuteCommandBuffer(cmd);
CommandBufferPool.Release(cmd);
cmd.SetGlobalVector(PerCameraBuffer._AdditionalLightCount, new Vector4 (lightData.additionalPixelLightsCount, lightData.vertexLightsCount, 0.0f, 0.0f));
cmd.SetGlobalVectorArray (PerCameraBuffer._AdditionalLightPosition, m_LightPositions);
cmd.SetGlobalVectorArray (PerCameraBuffer._AdditionalLightColor, m_LightColors);
cmd.SetGlobalVectorArray (PerCameraBuffer._AdditionalLightAttenuationParams, m_LightAttenuations);
cmd.SetGlobalVectorArray (PerCameraBuffer._AdditionalLightSpotDir, m_LightSpotDirections);
private void SetShaderKeywords(ref LightData lightData, ref ScriptableRenderContext context)
private void SetupShadowShaderConstants(CommandBuffer cmd, ref ScriptableRenderContext context, ref VisibleLight shadowLight, int cascadeCount)
CommandBuffer cmd = new CommandBuffer() { name = "SetShaderKeywords" };
SetShaderKeywords(cmd, lightData.shadowsRendered, lightData.isSingleLight, lightData.vertexLightsCount > 0);
context.ExecuteCommandBuffer(cmd);
cmd.Dispose();
Vector3 shadowLightDir = Vector3.Normalize(shadowLight.localToWorld.GetColumn(2));
float bias = shadowLight.light.shadowBias * 0.1f;
float normalBias = shadowLight.light.shadowNormalBias;
float shadowResolution = m_ShadowSlices[0].shadowResolution;
const int maxShadowCascades = 4;
Matrix4x4[] shadowMatrices = new Matrix4x4[maxShadowCascades];
for (int i = 0; i < cascadeCount; ++i)
shadowMatrices[i] = (cascadeCount >= i) ? m_ShadowSlices[i].shadowTransform : Matrix4x4.identity;
// TODO: shadow resolution per cascade in case cascades endup being supported.
float invShadowResolution = 1.0f / shadowResolution;
float[] pcfKernel =
{
-0.5f * invShadowResolution, 0.5f * invShadowResolution,
0.5f * invShadowResolution, 0.5f * invShadowResolution,
-0.5f * invShadowResolution, -0.5f * invShadowResolution,
0.5f * invShadowResolution, -0.5f * invShadowResolution
};
cmd.SetGlobalMatrixArray("_WorldToShadow", shadowMatrices);
cmd.SetGlobalVectorArray("_DirShadowSplitSpheres", m_DirectionalShadowSplitDistances);
cmd.SetGlobalVector("_ShadowLightDirection", new Vector4(-shadowLightDir.x, -shadowLightDir.y, -shadowLightDir.z, 0.0f));
cmd.SetGlobalVector("_ShadowData", new Vector4(0.0f, bias, normalBias, 0.0f));
cmd.SetGlobalFloatArray("_PCFKernel", pcfKernel);
}
private void SetShaderKeywords(CommandBuffer cmd, ref LightData lightData, VisibleLight[] visibleLights)
{
LightweightUtils.SetKeyword(cmd, "_LIGHTWEIGHT_FORCE_LINEAR", m_Asset.ForceLinearRendering);
LightweightUtils.SetKeyword(cmd, "_VERTEX_LIGHTS", lightData.vertexLightsCount > 0);
LightweightUtils.SetKeyword(cmd, "_ATTENUATION_TEXTURE", m_Asset.AttenuationTexture != null);
int mainLightIndex = lightData.mainLightIndex;
LightweightUtils.SetKeyword (cmd, "_MAIN_DIRECTIONAL_LIGHT", mainLightIndex != -1 && visibleLights[mainLightIndex].lightType == LightType.Directional);
LightweightUtils.SetKeyword (cmd, "_MAIN_SPOT_LIGHT", mainLightIndex != -1 && visibleLights[mainLightIndex].lightType == LightType.Spot);
LightweightUtils.SetKeyword (cmd, "_MAIN_POINT_LIGHT", mainLightIndex != -1 && visibleLights[mainLightIndex].lightType == LightType.Point);
LightweightUtils.SetKeyword(cmd, "_ADDITIONAL_PIXEL_LIGHTS", lightData.additionalPixelLightsCount > 0);
string[] shadowKeywords = new string[] { "_HARD_SHADOWS", "_SOFT_SHADOWS", "_HARD_SHADOWS_CASCADES", "_SOFT_SHADOWS_CASCADES" };
for (int i = 0; i < shadowKeywords.Length; ++i)
cmd.DisableShaderKeyword(shadowKeywords[i]);
if (m_Asset.AreShadowsEnabled() && lightData.shadowsRendered)
{
int keywordIndex = (int)m_Asset.ShadowSetting - 1;
if (m_Asset.CascadeCount > 1)
keywordIndex += 2;
cmd.EnableShaderKeyword(shadowKeywords[keywordIndex]);
}
}
private bool RenderShadows(ref CullResults cullResults, ref VisibleLight shadowLight, int shadowLightIndex, ref ScriptableRenderContext context)

return resolution;
}
private void SetupShadowShaderConstants(ref ScriptableRenderContext context, ref VisibleLight shadowLight, int shadowLightIndex, int cascadeCount)
{
Vector3 shadowLightDir = Vector3.Normalize(shadowLight.localToWorld.GetColumn(2));
float bias = shadowLight.light.shadowBias * 0.1f;
float normalBias = shadowLight.light.shadowNormalBias;
float shadowResolution = m_ShadowSlices[0].shadowResolution;
const int maxShadowCascades = 4;
Matrix4x4[] shadowMatrices = new Matrix4x4[maxShadowCascades];
for (int i = 0; i < cascadeCount; ++i)
shadowMatrices[i] = (cascadeCount >= i) ? m_ShadowSlices[i].shadowTransform : Matrix4x4.identity;
// TODO: shadow resolution per cascade in case cascades endup being supported.
float invShadowResolution = 1.0f / shadowResolution;
float[] pcfKernel =
{
-0.5f * invShadowResolution, 0.5f * invShadowResolution,
0.5f * invShadowResolution, 0.5f * invShadowResolution,
-0.5f * invShadowResolution, -0.5f * invShadowResolution,
0.5f * invShadowResolution, -0.5f * invShadowResolution
};
var setupShadow = CommandBufferPool.Get("SetupShadowShaderConstants");
setupShadow.SetGlobalMatrixArray("_WorldToShadow", shadowMatrices);
setupShadow.SetGlobalVectorArray("_DirShadowSplitSpheres", m_DirectionalShadowSplitDistances);
setupShadow.SetGlobalVector("_ShadowLightDirection", new Vector4(-shadowLightDir.x, -shadowLightDir.y, -shadowLightDir.z, 0.0f));
setupShadow.SetGlobalVector("_ShadowData", new Vector4(shadowLightIndex, bias, normalBias, 0.0f));
setupShadow.SetGlobalFloatArray("_PCFKernel", pcfKernel);
context.ExecuteCommandBuffer(setupShadow);
CommandBufferPool.Release(setupShadow);
}
private void SetShaderKeywords(CommandBuffer cmd, bool renderShadows, bool singleLight, bool vertexLightSupport)
{
LightweightUtils.SetKeyword(cmd, "_LIGHTWEIGHT_FORCE_LINEAR", m_Asset.ForceLinearRendering);
LightweightUtils.SetKeyword(cmd, "_VERTEX_LIGHTS", vertexLightSupport);
LightweightUtils.SetKeyword(cmd, "_ATTENUATION_TEXTURE", m_Asset.AttenuationTexture != null);
if (!singleLight)
{
LightweightUtils.SetKeyword(cmd, "_SINGLE_DIRECTIONAL_LIGHT", false);
LightweightUtils.SetKeyword(cmd, "_SINGLE_SPOT_LIGHT", false);
LightweightUtils.SetKeyword(cmd, "_SINGLE_POINT_LIGHT", false);
}
else
{
switch (m_SingleLightType)
{
case LightType.Directional:
LightweightUtils.SetKeyword(cmd, "_SINGLE_DIRECTIONAL_LIGHT", true);
LightweightUtils.SetKeyword(cmd, "_SINGLE_SPOT_LIGHT", false);
LightweightUtils.SetKeyword(cmd, "_SINGLE_POINT_LIGHT", false);
break;
case LightType.Spot:
LightweightUtils.SetKeyword(cmd, "_SINGLE_DIRECTIONAL_LIGHT", false);
LightweightUtils.SetKeyword(cmd, "_SINGLE_SPOT_LIGHT", true);
LightweightUtils.SetKeyword(cmd, "_SINGLE_POINT_LIGHT", false);
break;
case LightType.Point:
LightweightUtils.SetKeyword(cmd, "_SINGLE_DIRECTIONAL_LIGHT", false);
LightweightUtils.SetKeyword(cmd, "_SINGLE_SPOT_LIGHT", false);
LightweightUtils.SetKeyword(cmd, "_SINGLE_POINT_LIGHT", true);
break;
}
}
string[] shadowKeywords = new string[] { "_HARD_SHADOWS", "_SOFT_SHADOWS", "_HARD_SHADOWS_CASCADES", "_SOFT_SHADOWS_CASCADES" };
for (int i = 0; i < shadowKeywords.Length; ++i)
cmd.DisableShaderKeyword(shadowKeywords[i]);
if (renderShadows && m_Asset.CurrShadowType != ShadowType.NO_SHADOW)
{
int keywordIndex = (int)m_Asset.CurrShadowType - 1;
if (m_Asset.CascadeCount > 1)
keywordIndex += 2;
cmd.EnableShaderKeyword(shadowKeywords[keywordIndex]);
}
}
private void InitializeMainShadowLightIndex(VisibleLight[] lights, out int shadowIndex)
{
shadowIndex = -1;
if (m_Asset.CurrShadowType == ShadowType.NO_SHADOW)
return;
float maxIntensity = -1;
for (int i = 0; i < lights.Length; ++i)
{
Light light = lights[i].light;
if (light.shadows != LightShadows.None && IsSupportedShadowType(light.type) && light.intensity > maxIntensity)
{
shadowIndex = i;
maxIntensity = light.intensity;
}
}
}
private bool IsSupportedShadowType(LightType type)
{
return (type == LightType.Directional || type == LightType.Spot);
}
private void BeginForwardRendering(ref ScriptableRenderContext context, RenderingConfiguration renderingConfig)
{
RenderTargetIdentifier colorRT = BuiltinRenderTextureType.CameraTarget;

context.StopMultiEye(m_CurrCamera);
context.StereoEndRender(m_CurrCamera);
}
}
RendererConfiguration GetRendererSettings(ref LightData lightData)
{
RendererConfiguration settings = RendererConfiguration.PerObjectReflectionProbes | RendererConfiguration.PerObjectLightmaps | RendererConfiguration.PerObjectLightProbe;
if (lightData.hasAdditionalLights)
settings |= RendererConfiguration.PerObjectLightIndices8;
return settings;
}
private void SetupRenderTargets(CommandBuffer cmd, RenderTargetIdentifier colorRT, RenderTargetIdentifier depthRT)

2
ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.asset


m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3}
m_Name: LightweightPipelineAsset
m_EditorClassIdentifier:
m_MaxPixelLights: 4
m_MaxPixelLights: 5
m_SupportsVertexLight: 1
m_MSAA: 4
m_RenderScale: 1

52
ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.cs


public class LightweightPipelineAsset : RenderPipelineAsset
{
public static readonly string m_SimpleLightShaderPath = "ScriptableRenderPipeline/LightweightPipeline/Standard (Simple Lighting)";
public static readonly string m_PBSShaderPath = "ScriptableRenderPipeline/LightweightPipeline/Standard (Simple Lighting)";
public static readonly string m_BlitShaderPath = "Hidden/ScriptableRenderPipeline/LightweightPipeline/Blit";
[SerializeField] private int m_MaxPixelLights = 1;
[SerializeField] private bool m_SupportsVertexLight = true;
[SerializeField] private MSAAQuality m_MSAA = MSAAQuality.Disabled;
[SerializeField] private float m_RenderScale = 1.0f;
[SerializeField] private ShadowType m_ShadowType = ShadowType.HARD_SHADOWS;
[SerializeField] private ShadowResolution m_ShadowAtlasResolution = ShadowResolution._1024;
[SerializeField] private float m_ShadowNearPlaneOffset = 2.0f;
[SerializeField] private float m_ShadowDistance = 50.0f;
[SerializeField] private ShadowCascades m_ShadowCascades = ShadowCascades.NO_CASCADES;
[SerializeField] private float m_Cascade2Split = 0.25f;
[SerializeField] private Vector3 m_Cascade4Split = new Vector3(0.067f, 0.2f, 0.467f);
[SerializeField] private bool m_LinearRendering = true;
[SerializeField] private Texture2D m_AttenuationTexture;
[SerializeField] private Material m_DefaultDiffuseMaterial;
[SerializeField] private Material m_DefaultParticleMaterial;
[SerializeField] private Material m_DefaultLineMaterial;
[SerializeField] private Material m_DefaultSpriteMaterial;
[SerializeField] private Material m_DefaultUIMaterial;
[SerializeField] private Shader m_DefaultShader;
#if UNITY_EDITOR
[UnityEditor.MenuItem("RenderPipeline/LightweightPipeline/Create Pipeline Asset", false, 15)]

DestroyCreatedInstances();
}
[SerializeField] private int m_MaxPixelLights = 1;
[SerializeField] private bool m_SupportsVertexLight = true;
[SerializeField] private MSAAQuality m_MSAA = MSAAQuality.Disabled;
[SerializeField] private float m_RenderScale = 1.0f;
[SerializeField] private ShadowType m_ShadowType = ShadowType.HARD_SHADOWS;
[SerializeField] private ShadowResolution m_ShadowAtlasResolution = ShadowResolution._1024;
[SerializeField] private float m_ShadowNearPlaneOffset = 2.0f;
[SerializeField] private float m_ShadowDistance = 50.0f;
[SerializeField] private ShadowCascades m_ShadowCascades = ShadowCascades.NO_CASCADES;
[SerializeField] private float m_Cascade2Split = 0.25f;
[SerializeField] private Vector3 m_Cascade4Split = new Vector3(0.067f, 0.2f, 0.467f);
[SerializeField] private bool m_LinearRendering = true;
[SerializeField] private Texture2D m_AttenuationTexture;
[SerializeField] private Material m_DefaultDiffuseMaterial;
[SerializeField] private Material m_DefaultParticleMaterial;
[SerializeField] private Material m_DefaultLineMaterial;
[SerializeField] private Material m_DefaultSpriteMaterial;
[SerializeField] private Material m_DefaultUIMaterial;
[SerializeField] private Shader m_DefaultShader;
public bool AreShadowsEnabled()
{
return ShadowSetting != ShadowType.NO_SHADOW;
}
public int MaxSupportedPixelLights
{

set { m_RenderScale = value; }
}
public ShadowType CurrShadowType
public ShadowType ShadowSetting
{
get { return m_ShadowType; }
private set { m_ShadowType = value; }

public Shader BlitShader
{
get { return Shader.Find("Hidden/ScriptableRenderPipeline/LightweightPipeline/Blit"); }
get { return Shader.Find(LightweightPipelineAsset.m_BlitShaderPath); }
}
}
}

5
ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineUtils.cs


cmd.DisableShaderKeyword(keyword);
}
public static bool IsSupportedShadowType(LightType lightType)
{
return lightType == LightType.Directional || lightType == LightType.Spot;
}
public static bool PlatformSupportsMSAABackBuffer()
{
#if UNITY_ANDROID || UNITY_IPHONE || UNITY_TVOS || UNITY_SAMSUNGTV

2
ScriptableRenderPipeline/LightweightPipeline/Materials/Lightweight-StandardShader.mat


m_PrefabInternal: {fileID: 0}
m_Name: Lightweight-StandardShader
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLIC_SETUP _SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLIC_SETUP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

2
ScriptableRenderPipeline/LightweightPipeline/Materials/Lightweight-StandardSimpleLighting.mat


m_PrefabInternal: {fileID: 0}
m_Name: Lightweight-StandardSimpleLighting
m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3}
m_ShaderKeywords: _SPECULAR_COLOR
m_ShaderKeywords: _GLOSSINESS_FROM_BASE_ALPHA _SPECULAR_COLOR
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

5
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightBlit.shader


Shader "Hidden/ScriptableRenderPipeline/LightweightPipeline/Blit"
{
Properties
{
_BlitTex("Texture", 2D) = "" {}
}
SubShader
{
Tags { "RenderType" = "Opaque" "RenderPipeline" = "LightweightPipeline"}

75
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightCore.cginc


#include "LightweightInput.cginc"
#include "LightweightLighting.cginc"
#include "LightweightBRDF.cginc"
#if defined(_HARD_SHADOWS) || defined(_SOFT_SHADOWS) || defined(_HARD_SHADOWS_CASCADES) || defined(_SOFT_SHADOWS_CASCADES)
#define _SHADOWS
#endif
#if defined(_HARD_SHADOWS_CASCADES) || defined(_SOFT_SHADOWS_CASCADES)
#define _SHADOW_CASCADES
#endif
#ifdef _SHADOWS
#endif
#if defined(_SPECGLOSSMAP_BASE_ALPHA) || defined(_SPECGLOSSMAP) || defined(_SPECULAR_COLOR)
#if defined(_SPECGLOSSMAP) || defined(_SPECULAR_COLOR)
#define _DieletricSpec half4(0.04, 0.04, 0.04, 1.0 - 0.04) // standard dielectric reflectivity coef at incident angle (= 4%)
#define kDieletricSpec half4(0.04, 0.04, 0.04, 1.0 - 0.04) // standard dielectric reflectivity coef at incident angle (= 4%)
half SpecularReflectivity(half3 specular)
{

#endif
}
half3 MetallicSetup(float2 uv, half3 albedo, half albedoAlpha, out half3 specular, out half smoothness, out half oneMinusReflectivity)
inline void InitializeSurfaceData(LightweightVertexOutput i, out SurfaceData outSurfaceData)
half2 metallicGloss = MetallicSpecGloss(uv, albedoAlpha).ra;
float2 uv = i.uv01.xy;
half4 albedoAlpha = tex2D(_MainTex, uv);
outSurfaceData.albedo = LIGHTWEIGHT_GAMMA_TO_LINEAR(albedoAlpha.rgb) * _Color.rgb;
outSurfaceData.alpha = Alpha(albedoAlpha.a);
outSurfaceData.metallicSpecGloss = MetallicSpecGloss(uv, albedoAlpha);
outSurfaceData.normalWorld = Normal(i);
outSurfaceData.ao = OcclusionLW(uv);
outSurfaceData.emission = EmissionLW(uv);
}
inline void InitializeBRDFData(SurfaceData surfaceData, out BRDFData outBRDFData)
{
// BRDF SETUP
#ifdef _METALLIC_SETUP
half2 metallicGloss = surfaceData.metallicSpecGloss.ra;
smoothness = metallicGloss.g;
half smoothness = metallicGloss.g;
// store (1-dielectricSpec) in unity_ColorSpaceDielectricSpec.a, then
// store (1-dielectricSpec) in kDieletricSpec.a, then
half oneMinusDielectricSpec = _DieletricSpec.a;
oneMinusReflectivity = oneMinusDielectricSpec - metallic * oneMinusDielectricSpec;
specular = lerp(_DieletricSpec.rgb, albedo, metallic);
half oneMinusDielectricSpec = kDieletricSpec.a;
half oneMinusReflectivity = oneMinusDielectricSpec - metallic * oneMinusDielectricSpec;
half reflectivity = 1.0 - oneMinusReflectivity;
outBRDFData.diffuse = surfaceData.albedo * oneMinusReflectivity;
outBRDFData.specular = lerp(kDieletricSpec.rgb, surfaceData.albedo, metallic);
#else
half3 specular = surfaceData.metallicSpecGloss.rgb;
half smoothness = surfaceData.metallicSpecGloss.a;
half reflectivity = SpecularReflectivity(specular);
outBRDFData.diffuse = surfaceData.albedo * (half3(1.0h, 1.0h, 1.0h) - specular);
outBRDFData.specular = specular;
#endif
return albedo * oneMinusReflectivity;
}
outBRDFData.grazingTerm = saturate(smoothness + reflectivity);
outBRDFData.perceptualRoughness = 1.0h - smoothness;
outBRDFData.roughness = outBRDFData.perceptualRoughness * outBRDFData.perceptualRoughness;
half3 SpecularSetup(float2 uv, half3 albedo, half albedoAlpha, out half3 specular, out half smoothness, out half oneMinusReflectivity)
{
half4 specGloss = MetallicSpecGloss(uv, albedoAlpha);
specular = specGloss.rgb;
smoothness = specGloss.a;
oneMinusReflectivity = 1.0h - SpecularReflectivity(specular);
return albedo * (half3(1, 1, 1) - specular);
#ifdef _ALPHAPREMULTIPLY_ON
half alpha = surfaceData.alpha;
outBRDFData.diffuse *= alpha;
surfaceData.alpha = reflectivity + alpha * (1.0 - reflectivity);
#endif
}
half4 OutputColor(half3 color, half alpha)

return half4(LIGHTWEIGHT_LINEAR_TO_GAMMA(color), 1);
#endif
}
#endif

162
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightInput.cginc


// Main light initialized without indexing
#define INITIALIZE_MAIN_LIGHT(light) \
light.pos = _LightPosition; \
light.color = _LightColor; \
light.atten = _LightAttenuationParams; \
light.spotDir = _LightSpotDir;
light.pos = _MainLightPosition; \
light.color = _MainLightColor; \
light.atten = _MainLightAttenuationParams; \
light.spotDir = _MainLightSpotDir;
light.pos = globalLightPos[lightIndex]; \
light.color = globalLightColor[lightIndex]; \
light.atten = globalLightAtten[lightIndex]; \
light.spotDir = globalLightSpotDir[lightIndex]
light.pos = _AdditionalLightPosition[lightIndex]; \
light.color = _AdditionalLightColor[lightIndex]; \
light.atten = _AdditionalLightAttenuationParams[lightIndex]; \
light.spotDir = _AdditionalLightSpotDir[lightIndex]
#if !(defined(_SINGLE_DIRECTIONAL_LIGHT) || defined(_SINGLE_SPOT_LIGHT) || defined(_SINGLE_POINT_LIGHT))
#define _MULTIPLE_LIGHTS
#if (defined(_MAIN_DIRECTIONAL_LIGHT) || defined(_MAIN_SPOT_LIGHT) || defined(_MAIN_POINT_LIGHT))
#define _MAIN_LIGHT
#endif
#ifdef _SPECULAR_SETUP
#define SAMPLE_METALLICSPECULAR(uv) tex2D(_SpecGlossMap, uv)
#else
#define SAMPLE_METALLICSPECULAR(uv) tex2D(_MetallicGlossMap, uv)
// Ideally we want an approximation of gamma curve 2.0 to save ALU on GPU but as off now it won't match the GammaToLinear conversion of props in engine
//#define LIGHTWEIGHT_GAMMA_TO_LINEAR(sRGB) sRGB * (sRGB * (sRGB * 0.305306011h + 0.682171111h) + 0.012522878h)
//#define LIGHTWEIGHT_LINEAR_TO_GAMMA(linRGB) max(1.055h * pow(max(linRGB, 0.h), 0.416666667h) - 0.055h, 0.h)
struct LightInput
{
float4 pos;

};
sampler2D _AttenuationTexture;
// Per object light list data
#ifdef _MULTIPLE_LIGHTS
CBUFFER_START(_PerObject)
half _Shininess;
CBUFFER_END
// The variables are very similar to built-in unity_LightColor, unity_LightPosition,
// unity_LightAtten, unity_SpotDirection as used by the VertexLit shaders, except here
// we use world space positions instead of view space.
half4 globalLightCount;
half4 globalLightColor[MAX_VISIBLE_LIGHTS];
float4 globalLightPos[MAX_VISIBLE_LIGHTS];
half4 globalLightSpotDir[MAX_VISIBLE_LIGHTS];
float4 globalLightAtten[MAX_VISIBLE_LIGHTS];
#else
float4 _LightPosition;
half4 _LightColor;
float4 _LightAttenuationParams;
half4 _LightSpotDir;
#endif
CBUFFER_START(_PerCamera)
float4 _MainLightPosition;
half4 _MainLightColor;
float4 _MainLightAttenuationParams;
half4 _MainLightSpotDir;
sampler2D _MetallicSpecGlossMap;
half4 _AdditionalLightCount;
float4 _AdditionalLightPosition[MAX_VISIBLE_LIGHTS];
half4 _AdditionalLightColor[MAX_VISIBLE_LIGHTS];
float4 _AdditionalLightAttenuationParams[MAX_VISIBLE_LIGHTS];
half4 _AdditionalLightSpotDir[MAX_VISIBLE_LIGHTS];
CBUFFER_END
half4 _DieletricSpec;
half _Shininess;
samplerCUBE _Cube;
half4 _ReflectColor;
CBUFFER_START(_PerFrame)
half4 _GlossyEnvironmentColor;
sampler2D _AttenuationTexture;
CBUFFER_END
struct LightweightVertexInput
{

UNITY_VERTEX_OUTPUT_STEREO
};
inline void NormalMap(LightweightVertexOutput i, out half3 normal)
struct SurfaceData
#if _NORMALMAP
half3 normalmap = UnpackNormal(tex2D(_BumpMap, i.uv01.xy));
half3 albedo;
half alpha;
half4 metallicSpecGloss;
half3 normalWorld;
half ao;
half3 emission;
};
struct BRDFData
{
half3 diffuse;
half3 specular;
half perceptualRoughness;
half roughness;
half grazingTerm;
};
inline half Alpha(half albedoAlpha)
{
#if defined(_SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A)
half alpha = _Color.a;
#else
half alpha = albedoAlpha * _Color.a;
#endif
#if defined(_ALPHATEST_ON)
clip(alpha - _Cutoff);
#endif
return alpha;
}
inline half3 Normal(LightweightVertexOutput i)
{
#if _NORMALMAP
half3 normalTangent = UnpackNormal(tex2D(_BumpMap, i.uv01.xy));
normal = normalize(half3(dot(normalmap, i.tangentToWorld0), dot(normalmap, i.tangentToWorld1), dot(normalmap, i.tangentToWorld2)));
half3 normalWorld = normalize(half3(dot(normalTangent, i.tangentToWorld0), dot(normalTangent, i.tangentToWorld1), dot(normalTangent, i.tangentToWorld2)));
normal = normalize(i.normal);
half3 normalWorld = normalize(i.normal);
return normalWorld;
specularGloss = half4(0, 0, 0, 1);
#if defined(UNITY_COLORSPACE_GAMMA) && defined(_LIGHTWEIGHT_FORCE_LINEAR)
#elif defined(_SPECULAR_COLOR)
specularGloss = _SpecColor;
#elif defined(_SPECGLOSSMAP_BASE_ALPHA)
specularGloss.rgb = LIGHTWEIGHT_GAMMA_TO_LINEAR(tex2D(_SpecGlossMap, uv).rgb) * _SpecColor.rgb;
#ifdef _GLOSSINESS_FROM_BASE_ALPHA
#else
specularGloss = _SpecColor;
#endif
}

#ifdef _METALLICSPECGLOSSMAP
specGloss = specGloss = SAMPLE_METALLICSPECULAR(uv);
specGloss.rgb = tex2D(_MetallicSpecGlossMap, uv).rgb;
specGloss.a = albedoAlpha;
specGloss.a = albedoAlpha * _GlossMapScale;
specGloss = tex2D(_MetallicSpecGlossMap, uv).rgba;
#endif
#endif
specGloss.r = _Metallic;
specGloss.rgb = _Metallic.rrr;
#else
specGloss.rgb = _SpecColor.rgb;
#endif

#endif
return specGloss;
}
half OcclusionLW(float2 uv)
{
#ifdef _OCCLUSIONMAP
#if (SHADER_TARGET < 30)
// SM20: instruction count limitation
// SM20: simpler occlusion
return tex2D(_OcclusionMap, uv).g;
#else
half occ = tex2D(_OcclusionMap, uv).g;
return LerpOneTo(occ, _OcclusionStrength);
#endif
#else
return 1.0;
#endif
}
half3 EmissionLW(float2 uv)
{
#ifndef _EMISSION
return 0;
#else
return LIGHTWEIGHT_GAMMA_TO_LINEAR(tex2D(_EmissionMap, uv).rgb) * _EmissionColor.rgb;
#endif
}
#endif

94
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightLighting.cginc


#ifndef LIGHTWEIGHT_LIGHTING_INCLUDED
#ifndef LIGHTWEIGHT_LIGHTING_INCLUDED
UnityIndirect LightweightGI(float2 lightmapUV, half3 ambientColor, half3 reflectVec, half occlusion, half roughness)
#define PI 3.14159265359f
// Based on Minimalist CookTorrance BRDF
// Implementation is slightly different from original derivation: http://www.thetenthplanet.de/archives/255
//
// * NDF [Modified] GGX
// * Modified Kelemen and Szirmay-​Kalos for Visibility term
// * Fresnel approximated with 1/LdotH
half3 LightweightBDRF(BRDFData brdfData, half roughness2, half3 normal, half3 lightDirection, half3 viewDir)
{
#ifndef _SPECULARHIGHLIGHTS_OFF
half3 halfDir = Unity_SafeNormalize(lightDirection + viewDir);
half NoH = saturate(dot(normal, halfDir));
half LoH = saturate(dot(lightDirection, halfDir));
// GGX Distribution multiplied by combined approximation of Visibility and Fresnel
// See "Optimizing PBR for Mobile" from Siggraph 2015 moving mobile graphics course
// https://community.arm.com/events/1155
half d = NoH * NoH * (roughness2 - 1.h) + 1.00001h;
half LoH2 = LoH * LoH;
half specularTerm = roughness2 / ((d * d) * max(0.1h, LoH2) * (brdfData.roughness + 0.5h) * 4);
// on mobiles (where half actually means something) denominator have risk of overflow
// clamp below was added specifically to "fix" that, but dx compiler (we convert bytecode to metal/gles)
// sees that specularTerm have only non-negative terms, so it skips max(0,..) in clamp (leaving only min(100,...))
#if defined (SHADER_API_MOBILE)
specularTerm = specularTerm - 1e-4h;
#endif
#if defined (SHADER_API_MOBILE)
specularTerm = clamp(specularTerm, 0.0, 100.0); // Prevent FP16 overflow on mobiles
#endif
half3 color = specularTerm * brdfData.specular + brdfData.diffuse;
return color;
#else
return brdfData.diffuse;
#endif
}
half3 LightweightBRDFIndirect(BRDFData brdfData, UnityIndirect indirect, half roughness2, half fresnelTerm)
{
half3 c = indirect.diffuse * brdfData.diffuse;
float surfaceReduction = 1.0 / (roughness2 + 1.0);
c += surfaceReduction * indirect.specular * lerp(brdfData.specular, brdfData.grazingTerm, fresnelTerm);
return c;
}
UnityIndirect LightweightGI(float2 lightmapUV, half3 ambientColor, half3 normalWorld, half3 reflectVec, half occlusion, half perceptualRoughness)
o.diffuse = (DecodeLightmap(UNITY_SAMPLE_TEX2D(unity_Lightmap, lightmapUV)));
ambientColor = (DecodeLightmap(UNITY_SAMPLE_TEX2D(unity_Lightmap, lightmapUV)));
#else
ambientColor += SHEvalLinearL0L1(half4(normalWorld, 1.0));
ambientColor = max(half3(0.0, 0.0, 0.0), ambientColor);
#if defined(_VERTEX_LIGHTS) || !defined(LIGHTMAP_ON)
o.diffuse += ambientColor;
#endif
o.diffuse *= occlusion;
o.diffuse = ambientColor * occlusion;
#ifdef _GLOSSYREFLECTIONS_ON
// perceptualRoughness
#ifndef _GLOSSYREFLECTIONS_OFF
g.roughness = roughness;
g.roughness = perceptualRoughness;
o.specular = half3(0, 0, 0);
o.specular = _GlossyEnvironmentColor * occlusion;
#endif
return o;

// normalized light dir
lightDirection = half3(posToLightVec * rsqrt(distanceSqr));
#if !(defined(_SINGLE_POINT_LIGHT) || defined(_SINGLE_DIRECTIONAL_LIGHT))
#endif
return half(lightAtten);
}

float4 attenuationParams = lightInput.atten;
#ifdef _SINGLE_DIRECTIONAL_LIGHT
// Light pos holds normalized light dir
lightDirection = lightInput.pos;
return 1.0;
#else
// TODO: Test separating dir lights into diff loop by sorting on the pipe and setting -1 on LightIndexMap.
#ifdef _ATTENUATION_TEXTURE
float u = (distanceSqr * attenuationParams.z) / attenuationParams.w;
float lightAtten = tex2D(_AttenuationTexture, float2(u, 0.0)).a;

// normalized light dir
lightDirection = half3(posToLightVec * rsqrt(distanceSqr));
#ifndef _SINGLE_POINT_LIGHT
#endif
}
#endif // _SINGLE_DIRECTIONAL_LIGHT
inline half ComputeMainLightAttenuation(LightInput lightInput, half3 normal, float3 worldPos, out half3 lightDirection)
{
#ifdef _MAIN_DIRECTIONAL_LIGHT
// Light pos holds normalized light dir
lightDirection = lightInput.pos;
return 1.0;
#else
return ComputeLightAttenuation(lightInput, normal, worldPos, lightDirection);
#endif
}
inline half3 LightingLambert(half3 diffuseColor, half3 lightDir, half3 normal, half atten)

half3 halfVec = normalize(lightDir + viewDir);
half NdotH = saturate(dot(normal, halfVec));
half3 specular = specularGloss.rgb * (pow(NdotH, _Shininess * 128.0) * specularGloss.a);
half3 specular = specularGloss.rgb * pow(NdotH, _Shininess * 128.0) * specularGloss.a;
return (diffuse + specular) * atten;
}

136
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightPassLit.cginc


//#endif
#if !defined(LIGHTMAP_ON)
o.fogCoord.yzw += max(half3(0, 0, 0), ShadeSH9(half4(normal, 1)));
o.fogCoord.yzw = SHEvalLinearL2(half4(normal, 1.0));
#endif
UNITY_TRANSFER_FOG(o, o.hpos);

half4 LitPassFragment(LightweightVertexOutput i) : SV_Target
{
float2 uv = i.uv01.xy;
float2 lightmapUV = i.uv01.zw;
half4 albedoTex = tex2D(_MainTex, i.uv01.xy);
half3 albedo = LIGHTWEIGHT_GAMMA_TO_LINEAR(albedoTex.rgb) * _Color.rgb;
#if defined(_SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A)
half alpha = _Color.a;
#else
half alpha = albedoTex.a * _Color.a;
#endif
#if defined(_ALPHATEST_ON)
clip(alpha - _Cutoff);
#endif
SurfaceData surfaceData;
InitializeSurfaceData(i, surfaceData);
half3 specColor;
half smoothness;
half oneMinusReflectivity;
#ifdef _METALLIC_SETUP
half3 diffColor = MetallicSetup(uv, albedo, alpha, specColor, smoothness, oneMinusReflectivity);
#else
half3 diffColor = SpecularSetup(uv, albedo, alpha, specColor, smoothness, oneMinusReflectivity);
#endif
diffColor = PreMultiplyAlpha(diffColor, alpha, oneMinusReflectivity, /*out*/ alpha);
// Roughness is (1.0 - smoothness)�
half perceptualRoughness = 1.0h - smoothness;
half3 normal;
NormalMap(i, normal);
BRDFData brdfData;
InitializeBRDFData(surfaceData, brdfData);
// TODO: shader keyword for occlusion
// TODO: Reflection Probe blend support.
float2 lightmapUV = i.uv01.zw;
half3 normal = surfaceData.normalWorld;
half occlusion = Occlusion(uv);
UnityIndirect indirectLight = LightweightGI(lightmapUV, i.fogCoord.yzw, reflectVec, occlusion, perceptualRoughness);
half roughness2 = brdfData.roughness * brdfData.roughness;
UnityIndirect indirectLight = LightweightGI(lightmapUV, i.fogCoord.yzw, normal, reflectVec, surfaceData.ao, brdfData.perceptualRoughness);
// grazingTerm = F90
half grazingTerm = saturate(smoothness + (1 - oneMinusReflectivity));
half3 color = LightweightBRDFIndirect(diffColor, specColor, indirectLight, perceptualRoughness * perceptualRoughness, grazingTerm, fresnelTerm);
half3 color = LightweightBRDFIndirect(brdfData, indirectLight, roughness2, fresnelTerm);
#ifndef _MULTIPLE_LIGHTS
#ifdef _MAIN_LIGHT
half lightAtten = ComputeLightAttenuation(light, normal, i.posWS.xyz, lightDirection);
half lightAtten = ComputeMainLightAttenuation(light, normal, i.posWS.xyz, lightDirection);
#ifdef _SHADOWS
lightAtten *= ComputeShadowAttenuation(i, _ShadowLightDirection.xyz);

half3 radiance = light.color * (lightAtten * NdotL);
color += LightweightBDRF(diffColor, specColor, oneMinusReflectivity, perceptualRoughness, normal, lightDirection, i.viewDir.xyz) * radiance;
#else
color += LightweightBDRF(brdfData, roughness2, normal, lightDirection, i.viewDir.xyz) * radiance;
#endif
#ifdef _SHADOWS
half shadowAttenuation = ComputeShadowAttenuation(i, _ShadowLightDirection.xyz);
#endif
int pixelLightCount = min(globalLightCount.x, unity_LightIndicesOffsetAndCount.y);
#ifdef _ADDITIONAL_PIXEL_LIGHTS
int pixelLightCount = min(_AdditionalLightCount.x, unity_LightIndicesOffsetAndCount.y);
for (int lightIter = 0; lightIter < pixelLightCount; ++lightIter)
{
LightInput light;

#ifdef _SHADOWS
lightAtten *= max(shadowAttenuation, half(lightIndex != _ShadowData.x));
#endif
color += LightweightBDRF(diffColor, specColor, oneMinusReflectivity, perceptualRoughness, normal, lightDirection, i.viewDir.xyz) * radiance;
color += LightweightBDRF(brdfData, roughness2, normal, lightDirection, i.viewDir.xyz) * radiance;
color += Emission(uv);
color += surfaceData.emission;
return OutputColor(color, alpha);
return OutputColor(color, surfaceData.alpha);
}
half4 LitPassFragmentSimple(LightweightVertexOutput i) : SV_Target

#ifdef _GLOSSINESS_FROM_BASE_ALPHA
half alpha = _Color.a;
#else
#endif
// Keep for compatibility reasons. Shader Inpector throws a warning when using cutoff
// due overdraw performance impact.

half3 normal;
NormalMap(i, normal);
half3 normal = Normal(i);
half4 specularGloss;
SpecularGloss(i.uv01.xy, alpha, specularGloss);

half3 lightDirection;
#ifndef _MULTIPLE_LIGHTS
#if defined(LIGHTMAP_ON)
half3 color = DecodeLightmap(UNITY_SAMPLE_TEX2D(unity_Lightmap, i.uv01.zw)) * diffuse;
#else
half3 color = (SHEvalLinearL0L1(half4(normal, 1.0)) + i.fogCoord.yzw) * diffuse;
#endif
#ifdef _MAIN_LIGHT
half lightAtten = ComputeLightAttenuation(lightInput, normal, worldPos, lightDirection);
half lightAtten = ComputeMainLightAttenuation(lightInput, normal, worldPos, lightDirection);
half3 color = LightingBlinnPhong(diffuse, specularGloss, lightDirection, normal, viewDir, lightAtten) * lightInput.color;
color += LightingBlinnPhong(diffuse, specularGloss, lightDirection, normal, viewDir, lightAtten) * lightInput.color;
half3 color = LightingLambert(diffuse, lightDirection, normal, lightAtten) * lightInput.color;
color += LightingLambert(diffuse, lightDirection, normal, lightAtten) * lightInput.color;
#else
half3 color = half3(0, 0, 0);
#ifdef _SHADOWS
half shadowAttenuation = ComputeShadowAttenuation(i, _ShadowLightDirection.xyz);
int pixelLightCount = min(globalLightCount.x, unity_LightIndicesOffsetAndCount.y);
#ifdef _ADDITIONAL_PIXEL_LIGHTS
int pixelLightCount = min(_AdditionalLightCount.x, unity_LightIndicesOffsetAndCount.y);
for (int lightIter = 0; lightIter < pixelLightCount; ++lightIter)
{
LightInput lightData;

#ifdef _SHADOWS
lightAtten *= max(shadowAttenuation, half(lightIndex != _ShadowData.x));
#endif
#ifdef LIGHTWEIGHT_SPECULAR_HIGHLIGHTS
color += LightingBlinnPhong(diffuse, specularGloss, lightDirection, normal, viewDir, lightAtten) * lightData.color;

}
#endif // _MULTIPLE_LIGHTS
#ifdef _EMISSION
color += LIGHTWEIGHT_GAMMA_TO_LINEAR(tex2D(_EmissionMap, i.uv01.xy).rgb) * _EmissionColor;
#else
color += _EmissionColor;
#endif
#if defined(LIGHTMAP_ON)
color += (DecodeLightmap(UNITY_SAMPLE_TEX2D(unity_Lightmap, i.uv01.zw)) + i.fogCoord.yzw) * diffuse;
#endif
#endif // _ADDITIONAL_PIXEL_LIGHTS
#if defined(_VERTEX_LIGHTS) || !defined(LIGHTMAP_ON)
color += i.fogCoord.yzw * diffuse;
#endif
#if _REFLECTION_CUBEMAP
// TODO: we can use reflect vec to compute specular instead of half when computing cubemap reflection
half3 reflectVec = reflect(-i.viewDir.xyz, normal);
color += texCUBE(_Cube, reflectVec).rgb * specularGloss.rgb;
#elif defined(_REFLECTION_PROBE)
half3 reflectVec = reflect(-i.viewDir.xyz, normal);
half4 reflectionProbe = UNITY_SAMPLE_TEXCUBE(unity_SpecCube0, reflectVec);
color += reflectionProbe.rgb * (reflectionProbe.a * unity_SpecCube0_HDR.x) * specularGloss.rgb;
#endif
color += EmissionLW(i.uv01.xy);
return OutputColor(color, alpha);
};

14
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightShadows.cginc


#define LIGHTWEIGHT_SHADOWS_INCLUDED
#define MAX_SHADOW_CASCADES 4
#if defined(_HARD_SHADOWS) || defined(_SOFT_SHADOWS) || defined(_HARD_SHADOWS_CASCADES) || defined(_SOFT_SHADOWS_CASCADES)
#define _SHADOWS
#endif
#if defined(_HARD_SHADOWS_CASCADES) || defined(_SOFT_SHADOWS_CASCADES)
#define _SHADOW_CASCADES
#endif
#ifdef _SHADOWS
#define SHADOW_ATTENUATION(vertexOutput, shadowDir) ComputeShadowAttenuation(vertexOutput, shadowDir)
#else
#define SHADOW_ATTENUATION(vertexOutput, shadowDir) 1.0h
#endif
sampler2D_float _ShadowMap;
float _PCFKernel[8];
float4x4 _WorldToShadow[MAX_SHADOW_CASCADES];

12
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandardSimpleLighting.shader


_Glossiness("Glossiness", Range(0.0, 1.0)) = 0.5
[Enum(Specular Alpha,0,Albedo Alpha,1)] _SmoothnessTextureChannel("Smoothness texture channel", Float) = 0
_Cube ("Reflection Cubemap", CUBE) = "" {}
_ReflectionSource("Reflection Source", Float) = 0
[HideInInspector] _SpecSource("Specular Color Source", Float) = 0.0
_SpecColor("Specular", Color) = (1.0, 1.0, 1.0)
_SpecGlossMap("Specular", 2D) = "white" {}

CGPROGRAM
#pragma target 3.0
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON
#pragma shader_feature _ _SPECGLOSSMAP _SPECGLOSSMAP_BASE_ALPHA _SPECULAR_COLOR
#pragma shader_feature _ _SPECGLOSSMAP _SPECULAR_COLOR
#pragma shader_feature _ _GLOSSINESS_FROM_BASE_ALPHA
#pragma shader_feature _ _REFLECTION_CUBEMAP _REFLECTION_PROBE
#pragma multi_compile _ _MAIN_DIRECTIONAL_LIGHT _MAIN_SPOT_LIGHT _MAIN_POINT_LIGHT
#pragma multi_compile _ _ADDITIONAL_PIXEL_LIGHTS
#pragma multi_compile _ _SINGLE_DIRECTIONAL_LIGHT _SINGLE_SPOT_LIGHT _SINGLE_POINT_LIGHT
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile _ _HARD_SHADOWS _SOFT_SHADOWS _HARD_SHADOWS_CASCADES _SOFT_SHADOWS_CASCADES
#pragma multi_compile _ _VERTEX_LIGHTS

}
}
Fallback "Standard (Specular setup)"
CustomEditor "LightweightPipelineMaterialEditor"
CustomEditor "LightweightStandardSimpleLightingGUI"
}

16
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandard.shader


_SmoothnessTextureChannel("Smoothness texture channel", Float) = 0
[Gamma] _Metallic("Metallic", Range(0.0, 1.0)) = 0.0
_MetallicGlossMap("Metallic", 2D) = "white" {}
_MetallicSpecGlossMap("MetallicSpecGlossMap", 2D) = "white" {} // SpecGloss map when _SPECULAR_SETUP, MetallicGloss otherwise
_SpecGlossMap("Specular", 2D) = "white" {}
[Toggle] _SpecularHighlights("Specular Highlights", Float) = 1.0
[Toggle] _GlossyReflections("Glossy Reflections", Float) = 1.0

#pragma shader_feature _NORMALMAP
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICSPECGLOSSMAP
#pragma shader_feature _ _METALLICSPECGLOSSMAP
#pragma shader_feature _ _SPECULARHIGHLIGHTS_ON
#pragma shader_feature _ _GLOSSYREFLECTIONS_ON
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
#pragma shader_feature _ _GLOSSYREFLECTIONS_OFF
#pragma shader_feature _ _OCCLUSIONMAP
#pragma multi_compile _ _SINGLE_DIRECTIONAL_LIGHT _SINGLE_SPOT_LIGHT _SINGLE_POINT_LIGHT
#pragma multi_compile _ _MAIN_DIRECTIONAL_LIGHT _MAIN_SPOT_LIGHT _MAIN_POINT_LIGHT
#pragma multi_compile _ _ADDITIONAL_PIXEL_LIGHTS
#pragma multi_compile _ _LIGHTWEIGHT_FORCE_LINEAR
#pragma multi_compile _ UNITY_SINGLE_PASS_STEREO STEREO_INSTANCING_ON STEREO_MULTIVIEW_ON
#pragma multi_compile _ LIGHTMAP_ON

}
}
FallBack "Standard"
CustomEditor "LightweightStandardShaderGUI"
CustomEditor "LightweightStandardGUI"
}

357
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/010_MultiplePointLights.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.18028474, g: 0.22571635, b: 0.3069243, a: 1}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0

m_LocalScale: {x: 2, y: 2, z: 2}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &113058813
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 113058818}
- component: {fileID: 113058817}
- component: {fileID: 113058816}
- component: {fileID: 113058815}
- component: {fileID: 113058814}
m_Layer: 0
m_Name: Sphere (2)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!215 &113058814
ReflectionProbe:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 113058813}
m_Enabled: 1
serializedVersion: 2
m_Type: 0
m_Mode: 0
m_RefreshMode: 0
m_TimeSlicingMode: 0
m_Resolution: 128
m_UpdateFrequency: 0
m_BoxSize: {x: 10, y: 10, z: 10}
m_BoxOffset: {x: 0, y: 0, z: 0}
m_NearClip: 0.3
m_FarClip: 1000
m_ShadowDistance: 100
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_IntensityMultiplier: 1
m_BlendDistance: 1
m_HDR: 1
m_BoxProjection: 0
m_RenderDynamicObjects: 0
m_UseOcclusionCulling: 1
m_Importance: 1
m_CustomBakedTexture: {fileID: 0}
--- !u!23 &113058815
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 113058813}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: c93c9e065d18f0b419ba14e6c5cbb204, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!135 &113058816
SphereCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 113058813}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &113058817
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 113058813}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &113058818
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 113058813}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -27.7, y: -1.63, z: 9.81}
m_LocalScale: {x: 2, y: 2, z: 2}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 11
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &114301901
GameObject:

m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 232121470}
m_Enabled: 1
m_ExtensionPropertyValues: []
--- !u!124 &232121472
Behaviour:
m_ObjectHideFlags: 0

m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!4 &232121475
Transform:
m_ObjectHideFlags: 0

m_EditorClassIdentifier:
m_RotationPivot: {fileID: 1239630103}
m_DegreePerSecond: 45
--- !u!1 &550164217
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 550164222}
- component: {fileID: 550164221}
- component: {fileID: 550164220}
- component: {fileID: 550164219}
- component: {fileID: 550164218}
m_Layer: 0
m_Name: Sphere (3)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!215 &550164218
ReflectionProbe:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 550164217}
m_Enabled: 1
serializedVersion: 2
m_Type: 0
m_Mode: 0
m_RefreshMode: 0
m_TimeSlicingMode: 0
m_Resolution: 128
m_UpdateFrequency: 0
m_BoxSize: {x: 10, y: 10, z: 10}
m_BoxOffset: {x: 0, y: 0, z: 0}
m_NearClip: 0.3
m_FarClip: 1000
m_ShadowDistance: 100
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_IntensityMultiplier: 1
m_BlendDistance: 1
m_HDR: 1
m_BoxProjection: 0
m_RenderDynamicObjects: 0
m_UseOcclusionCulling: 1
m_Importance: 1
m_CustomBakedTexture: {fileID: 0}
--- !u!23 &550164219
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 550164217}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: c93c9e065d18f0b419ba14e6c5cbb204, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!135 &550164220
SphereCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 550164217}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &550164221
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 550164217}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &550164222
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 550164217}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -20.22, y: -1.63, z: 9.81}
m_LocalScale: {x: 2, y: 2, z: 2}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &632949760
GameObject:
m_ObjectHideFlags: 0

m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1408941340}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1483356817
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1483356822}
- component: {fileID: 1483356821}
- component: {fileID: 1483356820}
- component: {fileID: 1483356819}
- component: {fileID: 1483356818}
m_Layer: 0
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!215 &1483356818
ReflectionProbe:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1483356817}
m_Enabled: 1
serializedVersion: 2
m_Type: 0
m_Mode: 0
m_RefreshMode: 0
m_TimeSlicingMode: 0
m_Resolution: 128
m_UpdateFrequency: 0
m_BoxSize: {x: 10, y: 10, z: 10}
m_BoxOffset: {x: 0, y: 0, z: 0}
m_NearClip: 0.3
m_FarClip: 1000
m_ShadowDistance: 100
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_IntensityMultiplier: 1
m_BlendDistance: 1
m_HDR: 1
m_BoxProjection: 0
m_RenderDynamicObjects: 0
m_UseOcclusionCulling: 1
m_Importance: 1
m_CustomBakedTexture: {fileID: 0}
--- !u!23 &1483356819
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1483356817}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: c93c9e065d18f0b419ba14e6c5cbb204, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!135 &1483356820
SphereCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1483356817}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &1483356821
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1483356817}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1483356822
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1483356817}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -26.378, y: 4.59, z: 16.61}
m_LocalScale: {x: 2, y: 2, z: 2}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1490745503
GameObject:
m_ObjectHideFlags: 0

3
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/012_PBS_EnvironmentBRDF_Spheres.unity


m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1008298672}
m_Enabled: 1
m_ExtensionPropertyValues: []
--- !u!124 &1008298674
Behaviour:
m_ObjectHideFlags: 0

m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!4 &1008298677
Transform:
m_ObjectHideFlags: 0

renderPipeline: {fileID: 11400000, guid: e6987eea1dd29074597d54ed91a54a26, type: 2}
cameraToUse: {fileID: 1008298676}
hdr: 0
msaaSamples: 1
width: 1280
height: 720
--- !u!1 &1013363655

6
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/015_CameraMulti_FPSCam.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44951814, g: 0.4965123, b: 0.5591539, a: 1}
m_IndirectSpecularColor: {r: 0.18230191, g: 0.22486998, b: 0.28911608, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0

m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!1 &402303141
GameObject:
m_ObjectHideFlags: 0

m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0.1
x: 0
y: 0
width: 1
height: 1

m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!1 &1189044691
GameObject:
m_ObjectHideFlags: 0

5
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/017_Lighting_Scene_DirectionalBaked.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.18357287, g: 0.22910622, b: 0.3055507, a: 1}
m_IndirectSpecularColor: {r: 0.18355957, g: 0.22909229, b: 0.30554274, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0

m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 64132547}
m_Enabled: 1
m_ExtensionPropertyValues: []
--- !u!124 &64132549
Behaviour:
m_ObjectHideFlags: 0

renderPipeline: {fileID: 11400000, guid: e6987eea1dd29074597d54ed91a54a26, type: 2}
cameraToUse: {fileID: 64132551}
hdr: 0
msaaSamples: 1
width: 1280
height: 720
--- !u!20 &64132551

m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!4 &64132552
Transform:
m_ObjectHideFlags: 0

9
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/017_Lighting_Scene_DirectionalBaked/LightingData.asset
文件差异内容过多而无法显示
查看文件

2
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/017_Lighting_Scene_DirectionalBaked/LightingData.asset.meta


fileFormatVersion: 2
guid: b3ff4bc4727d64c4886e4d397960b8d6
timeCreated: 1504694071
timeCreated: 1506088689
licenseType: Pro
NativeFormatImporter:
externalObjects: {}

1001
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/017_Lighting_Scene_DirectionalBaked/Lightmap-0_comp_light.exr
文件差异内容过多而无法显示
查看文件

2
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/017_Lighting_Scene_DirectionalBaked/Lightmap-0_comp_light.exr.meta


fileFormatVersion: 2
guid: d06699a5a9b7b49d592f13da7c86c442
timeCreated: 1504694070
timeCreated: 1506088687
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}

1001
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/017_Lighting_Scene_DirectionalBaked/ReflectionProbe-0.exr
文件差异内容过多而无法显示
查看文件

2
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/017_Lighting_Scene_DirectionalBaked/ReflectionProbe-0.exr.meta


fileFormatVersion: 2
guid: 3dddae812ad834309997107bf0cc1206
timeCreated: 1504694070
timeCreated: 1506088689
licenseType: Pro
TextureImporter:
fileIDToRecycleName:

63
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/021_Lighting_BasicPoint.unity


m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 889296552}
m_Enabled: 1
m_ExtensionPropertyValues: []
--- !u!124 &889296554
Behaviour:
m_ObjectHideFlags: 0

renderPipeline: {fileID: 11400000, guid: e6987eea1dd29074597d54ed91a54a26, type: 2}
cameraToUse: {fileID: 889296556}
hdr: 0
msaaSamples: 1
width: 1280
height: 720
--- !u!20 &889296556

m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!4 &889296557
Transform:
m_ObjectHideFlags: 0

m_Component:
- component: {fileID: 1062213232}
- component: {fileID: 1062213231}
- component: {fileID: 1062213234}
- component: {fileID: 1062213233}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged

m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Type: 1
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1

m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 20, y: -45, z: 0}
--- !u!114 &1062213233
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1062213230}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c6c2871f720b2af4e9210febdac74517, type: 3}
m_Name:
m_EditorClassIdentifier:
shadowResolution: 512
shadowDimmer: 1
shadowFadeDistance: 10000
shadowCascadeCount: 4
shadowCascadeRatios:
- 0.05
- 0.2
- 0.3
shadowCascadeBorders:
- 0.2
- 0.2
- 0.2
- 0.2
shadowAlgorithm: 0
shadowVariant: 0
shadowPrecision: 0
shadowData:
format: 0
data:
shadowDatas: []
--- !u!114 &1062213234
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1062213230}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3}
m_Name:
m_EditorClassIdentifier:
m_InnerSpotPercent: 0
lightDimmer: 1
fadeDistance: 10000
affectDiffuse: 1
affectSpecular: 1
lightTypeExtent: 0
spotLightShape: 0
shapeLength: 0.5
shapeWidth: 0.5
shapeRadius: 0
maxSmoothness: 1
applyRangeAttenuation: 1
useOldInspector: 0
showAdditionalSettings: 1
--- !u!1 &1266012094
GameObject:
m_ObjectHideFlags: 0

2
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/024_Shader_PBRvalidation_Specular/Adam/Crowd_LOD0.FBX.meta


importMaterials: 1
materialName: 0
materialSearch: 1
materialLocation: 0
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0

3
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/024_Shader_PBRvalidation_Specular/Adam/Materials/Crowd_LOD0_Mat_Limbs_spec.mat


m_PrefabInternal: {fileID: 0}
m_Name: Crowd_LOD0_Mat_Limbs_spec
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _NORMALMAP _SPECULARHIGHLIGHTS_ON
_SPECULAR_SETUP
m_ShaderKeywords: _METALLICSPECGLOSSMAP _NORMALMAP _OCCLUSIONMAP _SPECGLOSSMAP _SPECULAR_SETUP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/024_Shader_PBRvalidation_Specular/Adam/Materials/Crowd_LOD0_Mat_Torso_spec.mat


m_PrefabInternal: {fileID: 0}
m_Name: Crowd_LOD0_Mat_Torso_spec
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _EMISSION _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _NORMALMAP
_SPECULARHIGHLIGHTS_ON _SPECULAR_SETUP
m_ShaderKeywords: _EMISSION _METALLICSPECGLOSSMAP _NORMALMAP _OCCLUSIONMAP _SPECGLOSSMAP
_SPECULAR_SETUP
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

3
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/024_Shader_PBRvalidation_Specular/PBRtest_Spec.mat


m_PrefabInternal: {fileID: 0}
m_Name: PBRtest_Spec
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _SPECULARHIGHLIGHTS_ON
_SPECULAR_SETUP
m_ShaderKeywords: _METALLICSPECGLOSSMAP _SPECGLOSSMAP _SPECULAR_SETUP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/025_Shader_PBRvalidation_Metallic/Adam/Materials/Crowd_LOD0_Mat_Limbs_metallic.mat


m_PrefabInternal: {fileID: 0}
m_Name: Crowd_LOD0_Mat_Limbs_metallic
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

6
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/025_Shader_PBRvalidation_Metallic/Adam/Materials/Crowd_LOD0_Mat_Torso_metallic.mat


m_PrefabInternal: {fileID: 0}
m_Name: Crowd_LOD0_Mat_Torso_metallic
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _EMISSION _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _METALLIC_SETUP
_NORMALMAP _SPECULARHIGHLIGHTS_ON
m_LightmapFlags: 1
m_ShaderKeywords: _EMISSION _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP
_NORMALMAP _OCCLUSIONMAP
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1

2
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/025_Shader_PBRvalidation_Metallic/PBRtest_met.mat


m_PrefabInternal: {fileID: 0}
m_Name: PBRtest_met
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _METALLIC_SETUP _SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

63
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene.unity


m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 9

m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1751559073}
m_Enabled: 1
m_ExtensionPropertyValues: []
--- !u!124 &1751559075
Behaviour:
m_ObjectHideFlags: 0

renderPipeline: {fileID: 11400000, guid: e6987eea1dd29074597d54ed91a54a26, type: 2}
cameraToUse: {fileID: 1751559077}
hdr: 0
msaaSamples: 4
width: 1280
height: 720
--- !u!20 &1751559077

m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!4 &1751559078
Transform:
m_ObjectHideFlags: 0

m_Component:
- component: {fileID: 1971611382}
- component: {fileID: 1971611381}
- component: {fileID: 1971611384}
- component: {fileID: 1971611383}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged

m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: -214.549, y: -238.25, z: -0.02999878}
--- !u!114 &1971611383
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1971611380}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c6c2871f720b2af4e9210febdac74517, type: 3}
m_Name:
m_EditorClassIdentifier:
shadowResolution: 512
shadowDimmer: 1
shadowFadeDistance: 10000
shadowCascadeCount: 4
shadowCascadeRatios:
- 0.05
- 0.2
- 0.3
shadowCascadeBorders:
- 0.2
- 0.2
- 0.2
- 0.2
shadowAlgorithm: 0
shadowVariant: 0
shadowPrecision: 0
shadowData:
format: 0
data:
shadowDatas: []
--- !u!114 &1971611384
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1971611380}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3}
m_Name:
m_EditorClassIdentifier:
m_InnerSpotPercent: 0
lightDimmer: 1
fadeDistance: 10000
affectDiffuse: 1
affectSpecular: 1
lightTypeExtent: 0
spotLightShape: 0
shapeLength: 0.5
shapeWidth: 0.5
shapeRadius: 0
maxSmoothness: 1
applyRangeAttenuation: 1
useOldInspector: 0
showAdditionalSettings: 1
--- !u!1 &2024053722
GameObject:
m_ObjectHideFlags: 0

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/kabel.mat


m_PrefabInternal: {fileID: 0}
m_Name: kabel
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/korpus.mat


m_PrefabInternal: {fileID: 0}
m_Name: korpus
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _EMISSION _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _METALLIC_SETUP
_NORMALMAP _SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _EMISSION _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP
_NORMALMAP _OCCLUSIONMAP
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/kozhuh.mat


m_PrefabInternal: {fileID: 0}
m_Name: kozhuh
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICGLOSSMAP _METALLICSPECGLOSSMAP
_METALLIC_SETUP _NORMALMAP _SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/motor.mat


m_PrefabInternal: {fileID: 0}
m_Name: motor
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICGLOSSMAP _METALLICSPECGLOSSMAP
_METALLIC_SETUP _NORMALMAP _SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/spindle.mat


m_PrefabInternal: {fileID: 0}
m_Name: spindle
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/stanina.mat


m_PrefabInternal: {fileID: 0}
m_Name: stanina
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/stanina_vk.mat


m_PrefabInternal: {fileID: 0}
m_Name: stanina_vk
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/top.mat


m_PrefabInternal: {fileID: 0}
m_Name: top
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/BenchDrill/materials/val.mat


m_PrefabInternal: {fileID: 0}
m_Name: val
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

3
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/CeramicTiles.mat


m_PrefabInternal: {fileID: 0}
m_Name: CeramicTiles
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICGLOSSMAP _METALLICSPECGLOSSMAP
_METALLIC_SETUP _NORMALMAP _SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/Challenge-Brick.mat


m_PrefabInternal: {fileID: 0}
m_Name: Challenge-Brick
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

90
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/Challenge-Brick.sbsar.meta


fileFormatVersion: 2
guid: 5ad5a792e9cb84f9db09b6b10e5c716f
timeCreated: 1505146675
timeCreated: 1506083832
licenseType: Pro
SubstanceImporter:
externalObjects: {}

shaderKeywords:
renderQueue: -1
lightmapFlags: 4
inputs: []
inputs:
- name: $outputsize
value:
scalar[0]: 8
scalar[1]: 8
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: $randomseed
value:
scalar[0]: 0
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Bricks
value:
scalar[0]: 16
scalar[1]: 32
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
materialInformation:
serializedVersion: 5
offset: {x: 0, y: 0}

animationUpdateRate: 0
materialProperties:
serializedVersion: 3
texEnvs: []
floats: []
colors: []
texEnvs:
- _BumpMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailAlbedoMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailMask:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailNormalMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _EmissionMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _MainTex:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _MetallicGlossMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _OcclusionMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _ParallaxMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
textureParameters:
- name: Challenge-Brick_basecolor
alphaSource: 6

textureWidth: 512
textureHeight: 512
textureFormat: 0
loadingBehavior: 1
loadingBehavior: 2
deletedPrototypes: []
userData:
assetBundleName:

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/Hole_mesh.mat


m_PrefabInternal: {fileID: 0}
m_Name: Hole_mesh
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _ALPHATEST_ON _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _METALLIC_SETUP
_NORMALMAP _SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _ALPHATEST_ON _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP
_NORMALMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

114
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/Hole_mesh.sbsar.meta


fileFormatVersion: 2
guid: c53335b5520f8495bb2f81c23ad1181f
timeCreated: 1505146677
timeCreated: 1506084259
licenseType: Pro
SubstanceImporter:
externalObjects: {}

shaderKeywords:
renderQueue: -1
lightmapFlags: 4
inputs: []
inputs:
- name: $outputsize
value:
scalar[0]: 8
scalar[1]: 8
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Output_Color
value:
scalar[0]: 0.278431
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Color
value:
scalar[0]: 0.192157
scalar[1]: 0.223529
scalar[2]: 0.298039
scalar[3]: 1
texture: {instanceID: 0}
stringvalue:
- name: noise_Noise_distance
value:
scalar[0]: 51
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: noise_Noise_intensity
value:
scalar[0]: 1
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Hole_tiling
value:
scalar[0]: 3
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
materialInformation:
serializedVersion: 5
offset: {x: 0, y: 0}

animationUpdateRate: 0
materialProperties:
serializedVersion: 3
texEnvs: []
floats: []
colors: []
texEnvs:
- _BumpMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailAlbedoMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailMask:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailNormalMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _EmissionMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _MainTex:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _MetallicGlossMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _OcclusionMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _ParallaxMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
textureParameters:
- name: Hole_mesh_basecolor
alphaSource: 6

textureWidth: 512
textureHeight: 512
textureFormat: 0
loadingBehavior: 1
loadingBehavior: 2
deletedPrototypes: []
userData:
assetBundleName:

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/IndustrialGlass.mat


m_PrefabInternal: {fileID: 0}
m_Name: IndustrialGlass
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP
_METALLIC_SETUP _NORMALMAP _SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP
_NORMALMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/IndustrialGlass.sbsar.meta


fileFormatVersion: 2
guid: 8edde2b21336f47658e115d02cdd3dab
timeCreated: 1505148949
timeCreated: 1506084268
licenseType: Pro
SubstanceImporter:
externalObjects: {}

textureWidth: 512
textureHeight: 512
textureFormat: 0
loadingBehavior: 1
loadingBehavior: 2
deletedPrototypes: []
userData:
assetBundleName:

3
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/PW_WoodLog.mat


m_PrefabInternal: {fileID: 0}
m_Name: PW_WoodLog
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICGLOSSMAP _METALLICSPECGLOSSMAP
_METALLIC_SETUP _NORMALMAP _SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

154
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/PW_WoodLog.sbsar.meta


fileFormatVersion: 2
guid: 78812a35d939745618c9f35ce5599253
timeCreated: 1505144532
timeCreated: 1506084283
licenseType: Pro
SubstanceImporter:
externalObjects: {}

shaderKeywords:
renderQueue: -1
lightmapFlags: 4
inputs: []
inputs:
- name: $outputsize
value:
scalar[0]: 8
scalar[1]: 8
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: $randomseed
value:
scalar[0]: 0
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Tile_X
value:
scalar[0]: 4
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Tile_Y
value:
scalar[0]: 2
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Scale
value:
scalar[0]: 1.6
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Height_Range
value:
scalar[0]: 0.5
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Height_Position
value:
scalar[0]: 0.5
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Colour_value
value:
scalar[0]: 0.5
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Colour_Highpass
value:
scalar[0]: 64
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Rougness
value:
scalar[0]: 0.55
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Roughness_Contrast
value:
scalar[0]: 0.4
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
materialInformation:
serializedVersion: 5
offset: {x: 0, y: 0}

animationUpdateRate: 0
materialProperties:
serializedVersion: 3
texEnvs: []
floats: []
colors: []
texEnvs:
- _BumpMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailAlbedoMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailMask:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailNormalMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _EmissionMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _MainTex:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _MetallicGlossMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _OcclusionMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _ParallaxMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
textureParameters:
- name: PW_WoodLog_basecolor
alphaSource: 6

textureWidth: 512
textureHeight: 512
textureFormat: 0
loadingBehavior: 1
loadingBehavior: 2
deletedPrototypes: []
userData:
assetBundleName:

6
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/Pyramids Wall - v01.mat


m_PrefabInternal: {fileID: 0}
m_Name: Pyramids Wall - v01
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _EMISSION _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _METALLIC_SETUP
_NORMALMAP _SPECULARHIGHLIGHTS_ON
m_LightmapFlags: 0
m_ShaderKeywords: _EMISSION _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP
_NORMALMAP
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/Pyramids Wall - v01.sbsar.meta


fileFormatVersion: 2
guid: acc1a3195b72345419a4a9a672a02dde
timeCreated: 1505149189
timeCreated: 1506084347
licenseType: Pro
SubstanceImporter:
externalObjects: {}

textureWidth: 1024
textureHeight: 1024
textureFormat: 0
loadingBehavior: 1
loadingBehavior: 2
deletedPrototypes: []
userData:
assetBundleName:

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/Roofing.mat


m_PrefabInternal: {fileID: 0}
m_Name: Roofing
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/Roofing.sbsar.meta


fileFormatVersion: 2
guid: 5b403cb7fc9244fafadacb9c5d460533
timeCreated: 1505148307
timeCreated: 1506084419
licenseType: Pro
SubstanceImporter:
externalObjects: {}

textureWidth: 512
textureHeight: 512
textureFormat: 0
loadingBehavior: 1
loadingBehavior: 2
deletedPrototypes: []
userData:
assetBundleName:

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/ShoreRockSand.mat


m_PrefabInternal: {fileID: 0}
m_Name: ShoreRockSand
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICGLOSSMAP _METALLICSPECGLOSSMAP
_METALLIC_SETUP _NORMALMAP _SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/ShoreRockSand.sbsar.meta


fileFormatVersion: 2
guid: ca3d57f8671b14009bdd2faa22197660
timeCreated: 1505147983
timeCreated: 1506084543
licenseType: Pro
SubstanceImporter:
externalObjects: {}

textureWidth: 1024
textureHeight: 1024
textureFormat: 0
loadingBehavior: 1
loadingBehavior: 2
deletedPrototypes: []
userData:
assetBundleName:

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/bark.mat


m_PrefabInternal: {fileID: 0}
m_Name: bark
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

82
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/bark.sbsar.meta


fileFormatVersion: 2
guid: 2476cfaf54ec844eea76dae35d0b7921
timeCreated: 1505146675
timeCreated: 1506083804
licenseType: Pro
SubstanceImporter:
externalObjects: {}

shaderKeywords:
renderQueue: -1
lightmapFlags: 4
inputs: []
inputs:
- name: $outputsize
value:
scalar[0]: 8
scalar[1]: 8
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: $randomseed
value:
scalar[0]: 0
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
materialInformation:
serializedVersion: 5
offset: {x: 0, y: 0}

animationUpdateRate: 0
materialProperties:
serializedVersion: 3
texEnvs: []
floats: []
colors: []
texEnvs:
- _BumpMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailAlbedoMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailMask:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailNormalMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _EmissionMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _MainTex:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _MetallicGlossMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _OcclusionMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _ParallaxMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
textureParameters:
- name: bark_basecolor
alphaSource: 6

textureWidth: 512
textureHeight: 512
textureFormat: 0
loadingBehavior: 1
loadingBehavior: 2
deletedPrototypes: []
userData:
assetBundleName:

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/herringbone_brick_floor.mat


m_PrefabInternal: {fileID: 0}
m_Name: herringbone_brick_floor
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

130
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/herringbone_brick_floor.sbsar.meta


fileFormatVersion: 2
guid: aba17ece59d114ae4bb8a1ac54829c1e
timeCreated: 1505146677
timeCreated: 1506083839
licenseType: Pro
SubstanceImporter:
externalObjects: {}

shaderKeywords:
renderQueue: -1
lightmapFlags: 4
inputs: []
inputs:
- name: $outputsize
value:
scalar[0]: 8
scalar[1]: 8
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: $randomseed
value:
scalar[0]: 0
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Dirt_Thickness
value:
scalar[0]: 0.3
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: dirt_level
value:
scalar[0]: 0.6
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Grass_Amount
value:
scalar[0]: 0.2
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Grass_In_Gaps
value:
scalar[0]: 0.5
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Brick_Gloss
value:
scalar[0]: 0.7
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: Grass_Colour
value:
scalar[0]: 0.443519
scalar[1]: 0.513726
scalar[2]: 0.265934
scalar[3]: 1
texture: {instanceID: 0}
stringvalue:
materialInformation:
serializedVersion: 5
offset: {x: 0, y: 0}

animationUpdateRate: 0
materialProperties:
serializedVersion: 3
texEnvs: []
floats: []
colors: []
texEnvs:
- _BumpMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailAlbedoMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailMask:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailNormalMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _EmissionMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _MainTex:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _MetallicGlossMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _OcclusionMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _ParallaxMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
textureParameters:
- name: herringbone_brick_floor_basecolor
alphaSource: 6

textureWidth: 512
textureHeight: 512
textureFormat: 0
loadingBehavior: 1
loadingBehavior: 2
deletedPrototypes: []
userData:
assetBundleName:

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/metal_aluminium_directional.mat


m_PrefabInternal: {fileID: 0}
m_Name: metal_aluminium_directional
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICGLOSSMAP _METALLICSPECGLOSSMAP
_METALLIC_SETUP _NORMALMAP _SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

122
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/metal_aluminium_directional.sbsar.meta


fileFormatVersion: 2
guid: a79123b7045094a3db15bfc27d8262ec
timeCreated: 1505144232
timeCreated: 1506084273
licenseType: Pro
SubstanceImporter:
externalObjects: {}

shaderKeywords:
renderQueue: -1
lightmapFlags: 4
inputs: []
inputs:
- name: $outputsize
value:
scalar[0]: 8
scalar[1]: 8
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: $randomseed
value:
scalar[0]: 0
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: normal_format
value:
scalar[0]: 0
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: normal_intensity
value:
scalar[0]: 0.5
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: height_range
value:
scalar[0]: 0.05
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: height_level
value:
scalar[0]: 0.5
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: metal_roughness
value:
scalar[0]: 0.372549
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
materialInformation:
serializedVersion: 5
offset: {x: 0, y: 0}

animationUpdateRate: 0
materialProperties:
serializedVersion: 3
texEnvs: []
floats: []
colors: []
texEnvs:
- _BumpMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailAlbedoMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailMask:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailNormalMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _EmissionMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _MainTex:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _MetallicGlossMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _OcclusionMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _ParallaxMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
textureParameters:
- name: metal_aluminium_directional_basecolor
alphaSource: 6

textureWidth: 512
textureHeight: 512
textureFormat: 0
loadingBehavior: 1
loadingBehavior: 2
deletedPrototypes: []
userData:
assetBundleName:

4
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/metal_brushed_copper.mat


m_PrefabInternal: {fileID: 0}
m_Name: metal_brushed_copper
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICGLOSSMAP _METALLICSPECGLOSSMAP
_METALLIC_SETUP _NORMALMAP _SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
_OCCLUSIONMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

122
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/metal_brushed_copper.sbsar.meta


fileFormatVersion: 2
guid: 451ea53fae5454119bc84b7c87e99d18
timeCreated: 1505144061
timeCreated: 1506084277
licenseType: Pro
SubstanceImporter:
externalObjects: {}

shaderKeywords:
renderQueue: -1
lightmapFlags: 4
inputs: []
inputs:
- name: $outputsize
value:
scalar[0]: 8
scalar[1]: 8
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: $randomseed
value:
scalar[0]: 0
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: normal_format
value:
scalar[0]: 0
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: normal_intensity
value:
scalar[0]: 0.5
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: height_range
value:
scalar[0]: 0.2
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: height_level
value:
scalar[0]: 0.5
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
- name: metal_roughness
value:
scalar[0]: 0.25098
scalar[1]: 0
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
materialInformation:
serializedVersion: 5
offset: {x: 0, y: 0}

animationUpdateRate: 0
materialProperties:
serializedVersion: 3
texEnvs: []
floats: []
colors: []
texEnvs:
- _BumpMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailAlbedoMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailMask:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailNormalMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _EmissionMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _MainTex:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _MetallicGlossMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _OcclusionMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _ParallaxMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
textureParameters:
- name: metal_brushed_copper_basecolor
alphaSource: 6

textureWidth: 512
textureHeight: 512
textureFormat: 0
loadingBehavior: 1
loadingBehavior: 2
deletedPrototypes: []
userData:
assetBundleName:

3
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/red_paint.mat


m_PrefabInternal: {fileID: 0}
m_Name: red_paint
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ShaderKeywords: _GLOSSYREFLECTIONS_ON _METALLICGLOSSMAP _METALLICSPECGLOSSMAP
_METALLIC_SETUP _NORMALMAP _SPECULARHIGHLIGHTS_ON
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _METALLIC_SETUP _NORMALMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0

74
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/026_Shader_PBRscene/Substances/red_paint.sbsar.meta


fileFormatVersion: 2
guid: 1da84915c077c4c3b94a42929d26caac
timeCreated: 1505144254
timeCreated: 1506084405
licenseType: Pro
SubstanceImporter:
externalObjects: {}

shaderKeywords:
renderQueue: -1
lightmapFlags: 4
inputs: []
inputs:
- name: $outputsize
value:
scalar[0]: 8
scalar[1]: 8
scalar[2]: 0
scalar[3]: 0
texture: {instanceID: 0}
stringvalue:
materialInformation:
serializedVersion: 5
offset: {x: 0, y: 0}

animationUpdateRate: 0
materialProperties:
serializedVersion: 3
texEnvs: []
floats: []
colors: []
texEnvs:
- _BumpMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailAlbedoMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailMask:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _DetailNormalMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _EmissionMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _MainTex:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _MetallicGlossMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _OcclusionMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
- _ParallaxMap:
texture: {instanceID: 0}
scale: {x: 1, y: 1}
offset: {x: 0, y: 0}
floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
textureParameters:
- name: red_paint_basecolor
alphaSource: 6

textureWidth: 512
textureHeight: 512
textureFormat: 0
loadingBehavior: 1
loadingBehavior: 2
deletedPrototypes: []
userData:
assetBundleName:

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存