浏览代码

Add the SSS profiling scene

/RenderPassXR_Sandbox
Evgenii Golubev 7 年前
当前提交
f3d8504d
共有 14 个文件被更改,包括 2233 次插入82 次删除
  1. 3
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  2. 3
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.asset
  3. 1
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.compute
  4. 154
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/SSSProfile/SkinSSSProfile.asset
  5. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset
  6. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineResources.cs
  7. 2
      Assets/ScriptableRenderPipeline/ShaderLibrary/API/PSSL.hlsl
  8. 2
      Assets/TestScenes/HDTest/GraphicTest/SSS/Materials/SSSHead.mat
  9. 116
      Assets/TestScenes/HDTest/GraphicTest/SSS/ProfilingSkinSSSProfile.asset
  10. 9
      Assets/TestScenes/HDTest/GraphicTest/SSS/ProfilingSkinSSSProfile.asset.meta
  11. 1001
      Assets/TestScenes/HDTest/GraphicTest/SSS/Test - SSS model .prefab
  12. 10
      Assets/TestScenes/HDTest/GraphicTest/SSS/Test - SSS model .prefab.meta
  13. 1001
      Assets/TestScenes/HDTest/SSSProfiling.unity
  14. 9
      Assets/TestScenes/HDTest/SSSProfiling.unity.meta

3
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


Material m_CopyStencilBuffer;
// Various set of material use in render loop
ComputeShader m_SubsurfaceScatteringCS;
ComputeShader m_SubsurfaceScatteringCS { get { return m_Asset.renderPipelineResources.subsurfaceScatteringCS; } }
int m_SubsurfaceScatteringKernel;
// Old SSS Model >>>
Material m_SssVerticalFilterPass;

public void CreateSssMaterials(bool useDisneySSS)
{
m_SubsurfaceScatteringCS = AssetDatabase.LoadAssetAtPath<ComputeShader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.compute");
m_SubsurfaceScatteringKernel = m_SubsurfaceScatteringCS.FindKernel("SubsurfaceScattering");
// Old SSS Model >>>

3
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.asset


useForwardRenderingOnly: 0
useDepthPrepass: 0
sssSettings:
numProfiles: 4
numProfiles: 5
- {fileID: 11400000, guid: aa5f2cc1c22cad043a617e9e9548b1b9, type: 2}
useDisneySSS: 1
tileSettings:
enableTileAndCluster: 1

1
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.compute


// Implementation
//--------------------------------------------------------------------------------------------------
// 6656 bytes used. It appears that the reserved LDS space must be a multiple of 512 bytes.
groupshared float4 textureCache[TEXTURE_CACHE_SIZE_1D][TEXTURE_CACHE_SIZE_1D]; // {irradiance, linearDepth}
groupshared bool processGroup;

154
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/SSSProfile/SkinSSSProfile.asset


worldScale: 1
settingsIndex: 0
m_ShapeParam: {x: 1.3192612, y: 3.1152647, z: 4.9751244}
m_MaxRadius: 8.458925
m_MaxRadius: 10.03481
- {x: 0, y: 1.516}
- {x: 0.027902514, y: 1.5535468}
- {x: 0.056502663, y: 1.5927485}
- {x: 0.0858313, y: 1.6337082}
- {x: 0.1159215, y: 1.6765369}
- {x: 0.14680836, y: 1.7213551}
- {x: 0.17852913, y: 1.7682924}
- {x: 0.21112362, y: 1.81749}
- {x: 0.24463426, y: 1.8691009}
- {x: 0.27910653, y: 1.9232914}
- {x: 0.31458887, y: 1.9802433}
- {x: 0.35113326, y: 2.0401537}
- {x: 0.3887955, y: 2.1032388}
- {x: 0.42763543, y: 2.1697347}
- {x: 0.46771717, y: 2.2399004}
- {x: 0.5091102, y: 2.3140202}
- {x: 0.55188924, y: 2.3924074}
- {x: 0.59613484, y: 2.4754071}
- {x: 0.6419343, y: 2.563401}
- {x: 0.68938226, y: 2.6568115}
- {x: 0.7385812, y: 2.756108}
- {x: 0.78964317, y: 2.8618138}
- {x: 0.8426895, y: 2.9745123}
- {x: 0.89785355, y: 3.0948577}
- {x: 0.95528066, y: 3.2235847}
- {x: 1.0151305, y: 3.3615222}
- {x: 1.0775794, y: 3.5096087}
- {x: 1.1428206, y: 3.66891}
- {x: 1.2110695, y: 3.8406446}
- {x: 1.282564, y: 4.026209}
- {x: 1.3575704, y: 4.227214}
- {x: 1.4363859, y: 4.4455285}
- {x: 1.5193442, y: 4.6833334}
- {x: 1.6068225, y: 4.943191}
- {x: 1.6992486, y: 5.228136}
- {x: 1.7971107, y: 5.541792}
- {x: 1.9009686, y: 5.88852}
- {x: 2.0114706, y: 6.273631}
- {x: 2.1293726, y: 6.7036633}
- {x: 2.2555614, y: 7.18675}
- {x: 2.3910918, y: 7.7331758}
- {x: 2.537231, y: 8.35613}
- {x: 2.6955185, y: 9.072821}
- {x: 2.8678567, y: 9.906171}
- {x: 3.056636, y: 10.887414}
- {x: 3.2649205, y: 12.060253}
- {x: 3.496729, y: 13.487793}
- {x: 3.7574923, y: 15.264698}
- {x: 4.054809, y: 17.539753}
- {x: 4.3997865, y: 20.560957}
- {x: 4.8096266, y: 24.774817}
- {x: 5.3131247, y: 31.074501}
- {x: 5.9642344, y: 41.544285}
- {x: 6.884045, y: 62.43729}
- {x: 8.458925, y: 125.02069}
- {x: 0.013865918, y: 1.5345725}
- {x: 0.04211352, y: 1.5729346}
- {x: 0.07107388, y: 1.6130018}
- {x: 0.100779116, y: 1.6548817}
- {x: 0.13126306, y: 1.6986896}
- {x: 0.16256203, y: 1.7445502}
- {x: 0.1947145, y: 1.7925992}
- {x: 0.22776169, y: 1.8429838}
- {x: 0.26174724, y: 1.8958628}
- {x: 0.29671827, y: 1.9514104}
- {x: 0.33272493, y: 2.0098157}
- {x: 0.369821, y: 2.0712852}
- {x: 0.40806437, y: 2.1360447}
- {x: 0.44751683, y: 2.2043417}
- {x: 0.48824534, y: 2.276447}
- {x: 0.5303216, y: 2.3526597}
- {x: 0.5738235, y: 2.433308}
- {x: 0.61883456, y: 2.5187542}
- {x: 0.665446, y: 2.609401}
- {x: 0.713756, y: 2.7056925}
- {x: 0.763872, y: 2.808125}
- {x: 0.8159103, y: 2.91725}
- {x: 0.8699981, y: 3.0336854}
- {x: 0.9262747, y: 3.1581244}
- {x: 0.98489225, y: 3.2913465}
- {x: 1.0460185, y: 3.434234}
- {x: 1.1098381, y: 3.5877857}
- {x: 1.1765549, y: 3.7531407}
- {x: 1.2463952, y: 3.9316032}
- {x: 1.319611, y: 4.124672}
- {x: 1.3964823, y: 4.3340797}
- {x: 1.4773248, y: 4.561845}
- {x: 1.5624928, y: 4.810328}
- {x: 1.6523882, y: 5.082317}
- {x: 1.747467, y: 5.381122}
- {x: 1.8482518, y: 5.710715}
- {x: 1.9553448, y: 6.0759025}
- {x: 2.069445, y: 6.482568}
- {x: 2.1913698, y: 6.9379897}
- {x: 2.3220856, y: 7.4513016}
- {x: 2.4627466, y: 8.0341215}
- {x: 2.614747, y: 8.701484}
- {x: 2.7797952, y: 9.473195}
- {x: 2.9600194, y: 10.375936}
- {x: 3.1581159, y: 11.446505}
- {x: 3.3775842, y: 12.737201}
- {x: 3.6230793, y: 14.324919}
- {x: 3.9009922, y: 16.327562}
- {x: 4.220452, y: 18.935623}
- {x: 4.5951686, y: 22.478209}
- {x: 5.047148, y: 27.57712}
- {x: 5.615129, y: 35.564823}
- {x: 6.3776174, y: 49.90625}
- {x: 7.5374603, y: 83.30668}
- {x: 10.03481, y: 250.11497}
- {x: 0, y: 1.516}
- {x: 0.07457052, y: 1.6178904}
- {x: 0.15428384, y: 1.7323332}
- {x: 0.23978925, y: 1.861574}
- {x: 0.33185518, y: 2.0083904}
- {x: 0.43139812, y: 2.1762547}
- {x: 0.53952074, y: 2.3695562}
- {x: 0.6575622, y: 2.5939138}
- {x: 0.7871677, y: 2.8566267}
- {x: 0.93038195, y: 3.1673388}
- {x: 1.0897847, y: 3.5390525}
- {x: 1.2686841, y: 3.9897263}
- {x: 1.4714115, y: 4.544919}
- {x: 1.7037815, y: 5.2423906}
- {x: 1.9738544, y: 6.140622}
- {x: 2.2932806, y: 7.335897}
- {x: 2.679871, y: 8.999949}
- {x: 3.1630776, y: 11.474433}
- {x: 3.797516, y: 15.554795}
- {x: 4.7049003, y: 23.627026}
- {x: 6.2721014, y: 47.62654}
- {x: 0.03667902, y: 1.5654991}
- {x: 0.11374626, y: 1.6734134}
- {x: 0.19626758, y: 1.7949444}
- {x: 0.28494877, y: 1.9325867}
- {x: 0.38062802, y: 2.0894418}
- {x: 0.48430943, y: 2.2694077}
- {x: 0.59720695, y: 2.4774427}
- {x: 0.72080237, y: 2.7199378}
- {x: 0.8569269, y: 3.005264}
- {x: 1.007873, y: 3.3445888}
- {x: 1.1765549, y: 3.7531407}
- {x: 1.3667475, y: 4.252257}
- {x: 1.5834517, y: 4.872841}
- {x: 1.8334827, y: 5.6615734}
- {x: 2.126473, y: 6.692844}
- {x: 2.4767098, y: 8.093767}
- {x: 2.9068332, y: 10.102725}
- {x: 3.4562516, y: 13.228675}
- {x: 4.2041187, y: 18.793621}
- {x: 5.3538504, y: 31.646347}
- {x: 7.84603, y: 95.44374}
scatterDistance1: {r: 0.3, g: 0.2, b: 0.2, a: 0}
scatterDistance2: {r: 0.6, g: 0.2, b: 0.2, a: 0}
lerpWeight: 0.5

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset


deferredShader: {fileID: 4800000, guid: 00dd221e34a6ab349a1196b0f2fab693, type: 3}
screenSpaceAmbientOcclusionShader: {fileID: 4800000, guid: cf0db7f5267ad944dbf4326b7102c9ca,
type: 3}
subsurfaceScatteringCS: {fileID: 7200000, guid: b06a7993621def248addd55d0fe931b1,
type: 3}
clearDispatchIndirectShader: {fileID: 7200000, guid: fc1f553acb80a6446a32d33e403d0656,
type: 3}
buildDispatchIndirectShader: {fileID: 7200000, guid: 4eb1b418be7044c40bb5200496c50f14,

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineResources.cs


instance.deferredShader = UnityEditor.AssetDatabase.LoadAssetAtPath<Shader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Deferred.Shader");
instance.screenSpaceAmbientOcclusionShader = UnityEditor.AssetDatabase.LoadAssetAtPath<Shader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/AmbientOcclusion/ScreenSpaceAmbientOcclusion.Shader");
instance.subsurfaceScatteringCS = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.compute");
instance.clearDispatchIndirectShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/cleardispatchindirect.compute");
instance.buildDispatchIndirectShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/builddispatchindirect.compute");

// Lighting resources
public Shader deferredShader;
public Shader screenSpaceAmbientOcclusionShader;
public ComputeShader subsurfaceScatteringCS;
// Lighting tile pass resources
public ComputeShader clearDispatchIndirectShader;

2
Assets/ScriptableRenderPipeline/ShaderLibrary/API/PSSL.hlsl


#define TEXTURECUBE(textureName) TextureCube textureName
#define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName
#define TEXTURE3D(textureName) Texture3D textureName
#define RW_TEXTURE2D(type, textureName) RWTexture2D<type> textureName
#define RW_TEXTURE2D(type, textureName) RW_Texture2D<type> textureName
#define SAMPLER2D(samplerName) SamplerState samplerName
#define SAMPLERCUBE(samplerName) SamplerState samplerName

2
Assets/TestScenes/HDTest/GraphicTest/SSS/Materials/SSSHead.mat


- _SrcBlend: 1
- _StencilRef: 1
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceProfile: 4
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1

116
Assets/TestScenes/HDTest/GraphicTest/SSS/ProfilingSkinSSSProfile.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a6e7465350bf0d248b4799d98e18cd24, type: 3}
m_Name: ProfilingSkinSSSProfile
m_EditorClassIdentifier:
scatteringDistance: {r: 0.758, g: 0.321, b: 0.201, a: 1}
transmissionTint: {r: 0.7568628, g: 0.32156864, b: 0.20000002, a: 1}
texturingMode: 0
transmissionMode: 0
thicknessRemap: {x: 0, y: 12.031147}
worldScale: 1
settingsIndex: 4
m_ShapeParam: {x: 1.3192612, y: 3.1152647, z: 4.9751244}
m_MaxRadius: 10.03481
m_FilterKernelNearField:
- {x: 0.013865918, y: 1.5345725}
- {x: 0.04211352, y: 1.5729346}
- {x: 0.07107388, y: 1.6130018}
- {x: 0.100779116, y: 1.6548817}
- {x: 0.13126306, y: 1.6986896}
- {x: 0.16256203, y: 1.7445502}
- {x: 0.1947145, y: 1.7925992}
- {x: 0.22776169, y: 1.8429838}
- {x: 0.26174724, y: 1.8958628}
- {x: 0.29671827, y: 1.9514104}
- {x: 0.33272493, y: 2.0098157}
- {x: 0.369821, y: 2.0712852}
- {x: 0.40806437, y: 2.1360447}
- {x: 0.44751683, y: 2.2043417}
- {x: 0.48824534, y: 2.276447}
- {x: 0.5303216, y: 2.3526597}
- {x: 0.5738235, y: 2.433308}
- {x: 0.61883456, y: 2.5187542}
- {x: 0.665446, y: 2.609401}
- {x: 0.713756, y: 2.7056925}
- {x: 0.763872, y: 2.808125}
- {x: 0.8159103, y: 2.91725}
- {x: 0.8699981, y: 3.0336854}
- {x: 0.9262747, y: 3.1581244}
- {x: 0.98489225, y: 3.2913465}
- {x: 1.0460185, y: 3.434234}
- {x: 1.1098381, y: 3.5877857}
- {x: 1.1765549, y: 3.7531407}
- {x: 1.2463952, y: 3.9316032}
- {x: 1.319611, y: 4.124672}
- {x: 1.3964823, y: 4.3340797}
- {x: 1.4773248, y: 4.561845}
- {x: 1.5624928, y: 4.810328}
- {x: 1.6523882, y: 5.082317}
- {x: 1.747467, y: 5.381122}
- {x: 1.8482518, y: 5.710715}
- {x: 1.9553448, y: 6.0759025}
- {x: 2.069445, y: 6.482568}
- {x: 2.1913698, y: 6.9379897}
- {x: 2.3220856, y: 7.4513016}
- {x: 2.4627466, y: 8.0341215}
- {x: 2.614747, y: 8.701484}
- {x: 2.7797952, y: 9.473195}
- {x: 2.9600194, y: 10.375936}
- {x: 3.1581159, y: 11.446505}
- {x: 3.3775842, y: 12.737201}
- {x: 3.6230793, y: 14.324919}
- {x: 3.9009922, y: 16.327562}
- {x: 4.220452, y: 18.935623}
- {x: 4.5951686, y: 22.478209}
- {x: 5.047148, y: 27.57712}
- {x: 5.615129, y: 35.564823}
- {x: 6.3776174, y: 49.90625}
- {x: 7.5374603, y: 83.30668}
- {x: 10.03481, y: 250.11497}
m_FilterKernelFarField:
- {x: 0.03667902, y: 1.5654991}
- {x: 0.11374626, y: 1.6734134}
- {x: 0.19626758, y: 1.7949444}
- {x: 0.28494877, y: 1.9325867}
- {x: 0.38062802, y: 2.0894418}
- {x: 0.48430943, y: 2.2694077}
- {x: 0.59720695, y: 2.4774427}
- {x: 0.72080237, y: 2.7199378}
- {x: 0.8569269, y: 3.005264}
- {x: 1.007873, y: 3.3445888}
- {x: 1.1765549, y: 3.7531407}
- {x: 1.3667475, y: 4.252257}
- {x: 1.5834517, y: 4.872841}
- {x: 1.8334827, y: 5.6615734}
- {x: 2.126473, y: 6.692844}
- {x: 2.4767098, y: 8.093767}
- {x: 2.9068332, y: 10.102725}
- {x: 3.4562516, y: 13.228675}
- {x: 4.2041187, y: 18.793621}
- {x: 5.3538504, y: 31.646347}
- {x: 7.84603, y: 95.44374}
scatterDistance1: {r: 0.3, g: 0.2, b: 0.2, a: 0}
scatterDistance2: {r: 0.6, g: 0.2, b: 0.2, a: 0}
lerpWeight: 0.5
m_HalfRcpWeightedVariances: {x: 2.4691355, y: 12.5, z: 12.5, w: 2.4691355}
m_FilterKernelBasic:
- {x: 0.09090909, y: 0.21162307, z: 0.21162307, w: -0.000000048879357}
- {x: 0.09090909, y: 0.18990478, z: 0.18990478, w: -0.11381993}
- {x: 0.09090909, y: 0.13233659, z: 0.13233659, w: -0.23580086}
- {x: 0.09090909, y: 0.061445467, z: 0.061445467, w: -0.37865555}
- {x: 0.09090909, y: 0.010501689, z: 0.010501689, w: -0.57677805}
- {x: 0.09090909, y: 2.9458339e-10, z: 2.9458339e-10, w: -1.3907351}
- {x: 0.09090909, y: 0.18990476, z: 0.18990476, w: 0.11382001}
- {x: 0.09090909, y: 0.13233659, z: 0.13233659, w: 0.23580086}
- {x: 0.09090909, y: 0.061445467, z: 0.061445467, w: 0.37865555}
- {x: 0.09090909, y: 0.010501689, z: 0.010501689, w: 0.57677805}
- {x: 0.09090909, y: 2.9456845e-10, z: 2.9456845e-10, w: 1.3907368}

9
Assets/TestScenes/HDTest/GraphicTest/SSS/ProfilingSkinSSSProfile.asset.meta


fileFormatVersion: 2
guid: aa5f2cc1c22cad043a617e9e9548b1b9
timeCreated: 1493291209
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

1001
Assets/TestScenes/HDTest/GraphicTest/SSS/Test - SSS model .prefab
文件差异内容过多而无法显示
查看文件

10
Assets/TestScenes/HDTest/GraphicTest/SSS/Test - SSS model .prefab.meta


fileFormatVersion: 2
guid: ef1a9eb2ee53a8f44bf5543cfe520dc7
timeCreated: 1500646713
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

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

9
Assets/TestScenes/HDTest/SSSProfiling.unity.meta


fileFormatVersion: 2
guid: 3ae49a004ada4ea4486096f6ed8c5d46
timeCreated: 1500647185
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存