浏览代码
Merge branch 'master' into feature/SSR
Merge branch 'master' into feature/SSR
# Conflicts: # ScriptableRenderPipeline/Core/CoreRP/Textures/RTHandleSystem.cs # ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDCamera.cs # ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplay.cs # ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs # ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDUtils.cs # ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/BufferPyramid.cs # ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyManager.cs # ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyRenderingContext.cs/main
Frédéric Vauchelles
7 年前
当前提交
d9f5b4f5
共有 67 个文件被更改,包括 7367 次插入 和 4965 次删除
-
10CHANGELOG.md
-
995ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1101_Unlit.unity.png
-
999ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1301_SubSurfaceScattering.unity.png
-
999ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1302_SSS_MaxRadius.unity.png
-
3ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1302_SSS_MaxRadius.unity.png.meta
-
999ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1303_SSS_Pre-Post.unity.png
-
3ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1303_SSS_Pre-Post.unity.png.meta
-
999ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2101_GI_Metapass.unity.png
-
998ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2102_GI_Emission.unity.png
-
999ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2103_BakeMixed.unity.png
-
998ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation.unity.png
-
999ImageTemplates/HDRenderPipeline/Scenes/9xxx_Other/9002_Deferred-and-Forward.unity.png
-
125ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/BSDF.hlsl
-
7ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/GeometricTools.hlsl
-
7ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/ImageBasedLighting.hlsl
-
22ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Sampling/Sampling.hlsl
-
6ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/SpaceFillingCurves.hlsl
-
11ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/VolumeRendering.hlsl
-
15ScriptableRenderPipeline/Core/CoreRP/Textures/RTHandleSystem.cs
-
30ScriptableRenderPipeline/Core/CoreRP/Utilities/CoreUtils.cs
-
21ScriptableRenderPipeline/Core/CoreRP/Volume/VolumeComponent.cs
-
16ScriptableRenderPipeline/Core/CoreRP/Volume/VolumeManager.cs
-
40ScriptableRenderPipeline/HDRenderPipeline/CHANGELOG.md
-
68ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDCamera.cs
-
29ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplay.cs
-
7ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/LightingDebug.cs
-
26ScriptableRenderPipeline/HDRenderPipeline/HDRP/Decal/DecalSystem.cs
-
278ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/StackLit/StackLitUI.cs
-
4ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Sky/AtmosphericScattering/ExponentialFogEditor.cs
-
1ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDCustomSamplerId.cs
-
35ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
-
3ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDStringConstants.cs
-
1ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightDefinition.cs
-
5ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightDefinition.cs.hlsl
-
8ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs
-
37ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/HomogeneousDensityVolume.cs
-
187ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VBuffer.hlsl
-
6ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumeVoxelization.compute
-
160ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumetricLighting.compute
-
167ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumetricLighting.cs
-
38ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl
-
22ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.hlsl
-
82ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.cs
-
92ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.cs.hlsl
-
289ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.hlsl
-
32ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.shader
-
242ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLitData.hlsl
-
23ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLitProperties.hlsl
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.compute
-
5ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipeline/FrameSettings.cs
-
30ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/BufferPyramid.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/BufferPyramidProcessor.cs
-
27ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/AtmosphericScattering/AtmosphericScattering.cs
-
1ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/AtmosphericScattering/AtmosphericScattering.cs.hlsl
-
59ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/AtmosphericScattering/AtmosphericScattering.hlsl
-
1ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/OpaqueAtmosphericScattering.shader
-
36ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyManager.cs
-
16ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyRenderingContext.cs
-
14ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/VisualEnvironment.cs
-
838Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1301_SubSurfaceScattering.unity
-
4Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1301_SubSurfaceScattering/GroundLeaf_Transmission-None.mat
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DecalsDebug.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DecalsDebug.cs.meta
-
34ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Sky/AtmosphericScattering/VolumetricFogEditor.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Sky/AtmosphericScattering/VolumetricFogEditor.cs.meta
-
67ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/AtmosphericScattering/VolumetricFog.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/AtmosphericScattering/VolumetricFog.cs.meta
995
ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1101_Unlit.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
999
ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1301_SubSurfaceScattering.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
999
ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1302_SSS_MaxRadius.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
999
ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1303_SSS_Pre-Post.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
999
ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2101_GI_Metapass.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
998
ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2102_GI_Emission.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
999
ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2103_BakeMixed.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
998
ImageTemplates/HDRenderPipeline/Scenes/2xxx_Lighting/2401_Light_on_Tesselation.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
999
ImageTemplates/HDRenderPipeline/Scenes/9xxx_Other/9002_Deferred-and-Forward.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
TEXTURE2D(_PreIntegratedFGD); |
|||
|
|||
// For image based lighting, a part of the BSDF is pre-integrated. |
|||
// This is done both for specular GGX height-correlated and DisneyDiffuse |
|||
// reflectivity is Integral{(BSDF_GGX / F) - use for multiscattering |
|||
void GetPreIntegratedFGDGGXAndDisneyDiffuse(float NdotV, float perceptualRoughness, float3 fresnel0, out float3 GGXSpecularFGD, out float disneyDiffuseFGD, out float reflectivity) |
|||
{ |
|||
float3 preFGD = SAMPLE_TEXTURE2D_LOD(_PreIntegratedFGD, s_linear_clamp_sampler, float2(NdotV, perceptualRoughness), 0).xyz; |
|||
|
|||
// Pre-integrate GGX FGD |
|||
// Integral{BSDF * <N,L> dw} = |
|||
// Integral{(F0 + (1 - F0) * (1 - <V,H>)^5) * (BSDF / F) * <N,L> dw} = |
|||
// (1 - F0) * Integral{(1 - <V,H>)^5 * (BSDF / F) * <N,L> dw} + F0 * Integral{(BSDF / F) * <N,L> dw}= |
|||
// (1 - F0) * x + F0 * y = lerp(x, y, F0) |
|||
GGXSpecularFGD = lerp(preFGD.xxx, preFGD.yyy, fresnel0); |
|||
|
|||
// Pre integrate DisneyDiffuse FGD: |
|||
// z = DisneyDiffuse |
|||
// Remap from the [0, 1] to the [0.5, 1.5] range. |
|||
disneyDiffuseFGD = preFGD.z + 0.5; |
|||
|
|||
reflectivity = preFGD.y; |
|||
} |
838
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1301_SubSurfaceScattering.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
using System; |
|||
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
[Serializable] |
|||
public class DecalsDebugSettings |
|||
{ |
|||
public bool m_DisplayAtlas = false; |
|||
public UInt32 m_MipLevel = 0; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 300a1c22817829f48a156cef57b55a57 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using UnityEditor; |
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
using UnityEditor.Experimental.Rendering; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering.HDPipeline |
|||
{ |
|||
[VolumeComponentEditor(typeof(VolumetricFog))] |
|||
public class VolumetricFogEditor : AtmosphericScatteringEditor |
|||
{ |
|||
private SerializedDataParameter m_Albedo; |
|||
private SerializedDataParameter m_MeanFreePath; |
|||
private SerializedDataParameter m_Asymmetry; |
|||
|
|||
public override void OnEnable() |
|||
{ |
|||
base.OnEnable(); |
|||
var o = new PropertyFetcher<VolumetricFog>(serializedObject); |
|||
|
|||
m_Albedo = Unpack(o.Find(x => x.albedo)); |
|||
m_MeanFreePath = Unpack(o.Find(x => x.meanFreePath)); |
|||
m_Asymmetry = Unpack(o.Find(x => x.asymmetry)); |
|||
} |
|||
|
|||
public override void OnInspectorGUI() |
|||
{ |
|||
PropertyField(m_Albedo); |
|||
PropertyField(m_MeanFreePath); |
|||
PropertyField(m_Asymmetry); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: a530ef8d0c07494409d34294d8e04a89 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using UnityEngine.Rendering; |
|||
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public class VolumetricFog : AtmosphericScattering |
|||
{ |
|||
public ColorParameter albedo = new ColorParameter(new Color(0.5f, 0.5f, 0.5f)); |
|||
public MinFloatParameter meanFreePath = new MinFloatParameter(float.MaxValue, 1.0f); |
|||
public ClampedFloatParameter asymmetry = new ClampedFloatParameter(0.0f, -1.0f, 1.0f); |
|||
|
|||
// Override the volume blending function.
|
|||
public override void Override(VolumeComponent state, float interpFactor) |
|||
{ |
|||
VolumetricFog other = state as VolumetricFog; |
|||
|
|||
float thisExtinction = VolumeRenderingUtils.ExtinctionFromMeanFreePath(meanFreePath); |
|||
Vector3 thisScattering = VolumeRenderingUtils.ScatteringFromExtinctionAndAlbedo(thisExtinction, (Vector3)(Vector4)albedo.value); |
|||
|
|||
float otherExtinction = VolumeRenderingUtils.ExtinctionFromMeanFreePath(other.meanFreePath); |
|||
Vector3 otherScattering = VolumeRenderingUtils.ScatteringFromExtinctionAndAlbedo(otherExtinction, (Vector3)(Vector4)other.albedo.value); |
|||
|
|||
float blendExtinction = Mathf.Lerp(otherExtinction, thisExtinction, interpFactor); |
|||
Vector3 blendScattering = Vector3.Lerp(otherScattering, thisScattering, interpFactor); |
|||
float blendAsymmetry = Mathf.Lerp(other.asymmetry, asymmetry, interpFactor); |
|||
|
|||
float blendMeanFreePath = VolumeRenderingUtils.MeanFreePathFromExtinction(blendExtinction); |
|||
Color blendAlbedo = (Color)(Vector4)VolumeRenderingUtils.AlbedoFromMeanFreePathAndScattering(blendMeanFreePath, blendScattering); |
|||
blendAlbedo.a = 1.0f; |
|||
|
|||
if (meanFreePath.overrideState) |
|||
{ |
|||
other.meanFreePath.value = blendMeanFreePath; |
|||
} |
|||
|
|||
if (albedo.overrideState) |
|||
{ |
|||
other.albedo.value = blendAlbedo; |
|||
} |
|||
|
|||
if (asymmetry.overrideState) |
|||
{ |
|||
other.asymmetry.value = blendAsymmetry; |
|||
} |
|||
} |
|||
|
|||
public override void PushShaderParameters(CommandBuffer cmd, FrameSettings frameSettings) |
|||
{ |
|||
DensityVolumeParameters param; |
|||
|
|||
param.albedo = albedo; |
|||
param.meanFreePath = meanFreePath; |
|||
param.asymmetry = asymmetry; |
|||
|
|||
DensityVolumeData data = param.GetData(); |
|||
|
|||
cmd.SetGlobalInt(HDShaderIDs._AtmosphericScatteringType, (int)FogType.Volumetric); |
|||
|
|||
cmd.SetGlobalVector(HDShaderIDs._GlobalScattering, data.scattering); |
|||
cmd.SetGlobalFloat( HDShaderIDs._GlobalExtinction, data.extinction); |
|||
cmd.SetGlobalFloat( HDShaderIDs._GlobalAsymmetry, asymmetry); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 29b00527f85bb3346a4d2cb710971587 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue