浏览代码

First draft

/feature-ReflectionProbeFit
sebastienlagarde 7 年前
当前提交
a8480a83
共有 21 个文件被更改,包括 451 次插入95 次删除
  1. 4
      ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs
  2. 4
      ScriptableRenderPipeline/HDRenderPipeline/Debug/LightingDebug.cs
  3. 5
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  4. 43
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs
  5. 2
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineSettings.cs.meta
  6. 39
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/GlobalLightLoopSettings.cs
  7. 11
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/GlobalLightLoopSettings.cs.meta
  8. 65
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoopSettings.cs
  9. 11
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoopSettings.cs.meta
  10. 8
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline.meta
  11. 35
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineSettings.cs
  12. 185
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/FrameSettings.cs
  13. 40
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/GlobalFrameSettings.cs
  14. 11
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/GlobalFrameSettings.cs.meta
  15. 20
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/RenderPipelineSettings.cs
  16. 11
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/RenderPipelineSettings.cs.meta
  17. 14
      ScriptableRenderPipeline/HDRenderPipeline/FrameSettings.cs
  18. 38
      ScriptableRenderPipeline/HDRenderPipeline/GlobalSettings.cs
  19. 0
      /ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/FrameSettings.cs.meta
  20. 0
      /ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineSettings.cs.meta

4
ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs


DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, Color>(kDebugLightingAlbedo, () => lightingDebugSettings.debugLightingAlbedo, (value) => lightingDebugSettings.debugLightingAlbedo = (Color)value);
DebugMenuManager.instance.AddDebugItem<bool>("Lighting", kDisplaySkyReflectionDebug, () => lightingDebugSettings.displaySkyReflection, (value) => lightingDebugSettings.displaySkyReflection = (bool)value);
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, float>(kSkyReflectionMipmapDebug, () => lightingDebugSettings.skyReflectionMipmap, (value) => lightingDebugSettings.skyReflectionMipmap = (float)value, DebugItemFlag.None, new DebugItemHandlerFloatMinMax(0.0f, 1.0f));
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, LightLoopSettings.TileClusterDebug>(kTileClusterDebug,() => lightingDebugSettings.tileClusterDebug, (value) => lightingDebugSettings.tileClusterDebug = (LightLoopSettings.TileClusterDebug)value);
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, LightLoopSettings.TileClusterCategoryDebug>(kTileClusterCategoryDebug,() => lightingDebugSettings.tileClusterDebugByCategory, (value) => lightingDebugSettings.tileClusterDebugByCategory = (LightLoopSettings.TileClusterCategoryDebug)value);
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, LightLoop.TileClusterDebug>(kTileClusterDebug,() => lightingDebugSettings.tileClusterDebug, (value) => lightingDebugSettings.tileClusterDebug = (LightLoop.TileClusterDebug)value);
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, LightLoop.TileClusterCategoryDebug>(kTileClusterCategoryDebug,() => lightingDebugSettings.tileClusterDebugByCategory, (value) => lightingDebugSettings.tileClusterDebugByCategory = (LightLoop.TileClusterCategoryDebug)value);
DebugMenuManager.instance.AddDebugItem<bool>("Rendering", "Display Opaque",() => renderingDebugSettings.displayOpaqueObjects, (value) => renderingDebugSettings.displayOpaqueObjects = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>("Rendering", "Display Transparency",() => renderingDebugSettings.displayTransparentObjects, (value) => renderingDebugSettings.displayTransparentObjects = (bool)value);

4
ScriptableRenderPipeline/HDRenderPipeline/Debug/LightingDebug.cs


public bool displaySkyReflection = false;
public float skyReflectionMipmap = 0.0f;
public LightLoopSettings.TileClusterDebug tileClusterDebug = LightLoopSettings.TileClusterDebug.None;
public LightLoopSettings.TileClusterCategoryDebug tileClusterDebugByCategory = LightLoopSettings.TileClusterCategoryDebug.Punctual;
public LightLoop.TileClusterDebug tileClusterDebug = LightLoop.TileClusterDebug.None;
public LightLoop.TileClusterCategoryDebug tileClusterDebugByCategory = LightLoop.TileClusterCategoryDebug.Punctual;
public void OnValidate()
{

5
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


static DebugDisplaySettings s_NeutralDebugDisplaySettings = new DebugDisplaySettings();
DebugDisplaySettings m_CurrentDebugDisplaySettings;
FrameSettings m_FrameSettings;
int m_DebugFullScreenTempRT;
bool m_FullScreenDebugPushed;

foreach (var camera in cameras)
{
var cameraFrameSettings = camera.GetComponent<FrameSettings>();
m_FrameSettings = FrameSettings.InitializeFrameSettings(RenderPipelineSettings.GetGlobalFrameSettings(), cameraFrameSettings, null);
// This is the main command buffer used for the frame.
var cmd = CommandBufferPool.Get("");

43
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs


public float unused2;
};
[Serializable]
public class LightLoopSettings
public class LightLoop
public bool enableTileAndCluster; // For debug / test
public bool enableComputeLightEvaluation;
public bool enableComputeLightVariants;
public bool enableComputeMaterialVariants;
// Deferred opaque always use FPTL, forward opaque can use FPTL or cluster, transparent always use cluster
// When MSAA is enabled, we only support cluster (Fptl is too slow with MSAA), and we don't support MSAA for deferred path (mean it is ok to keep fptl)
public bool enableFptlForForwardOpaque;
// clustered light list specific buffers and data begin
public bool enableBigTilePrepass;
public bool enableAsyncCompute;
public enum TileClusterDebug : int
{
None,

EnvironmentAndAreaAndPunctual = 7
};
public LightLoopSettings()
{
enableTileAndCluster = true;
enableComputeLightEvaluation = true;
enableComputeLightVariants = true;
enableComputeMaterialVariants = true;
enableFptlForForwardOpaque = true;
enableBigTilePrepass = true;
enableAsyncCompute = false;
}
}
public class LightLoop
{
public const int k_MaxDirectionalLightsOnScreen = 4;
public const int k_MaxPunctualLightsOnScreen = 512;
public const int k_MaxAreaLightsOnScreen = 64;

static Cubemap m_DefaultTextureCube;
ReflectionProbeCache m_ReflectionProbeCache;
int m_ReflectionProbeCacheSize = 128;
int m_CookieTexArraySize = 16;
int m_CubeCookieTexArraySize = 16;
LightingSettings m_LightingSettings = new LightingSettings();
FrameSettings m_FrameSettings = new FrameSettings();
public class LightList
{

using (new ProfilingSample(cmd, "Tiled/cluster Lighting Debug", HDRenderPipeline.GetSampler(CustomSamplerId.TPTiledLightingDebug)))
{
if (lightingDebug.tileClusterDebug != LightLoopSettings.TileClusterDebug.None)
if (lightingDebug.tileClusterDebug != LightLoop.TileClusterDebug.None)
{
int w = hdCamera.camera.pixelWidth;

#endif
// Debug tiles
if (lightingDebug.tileClusterDebug == LightLoopSettings.TileClusterDebug.FeatureVariants)
if (lightingDebug.tileClusterDebug == LightLoop.TileClusterDebug.FeatureVariants)
{
if (GetFeatureVariantsEnabled())
{

}
else // tile or cluster
{
bool bUseClustered = lightingDebug.tileClusterDebug == LightLoopSettings.TileClusterDebug.Cluster;
bool bUseClustered = lightingDebug.tileClusterDebug == LightLoop.TileClusterDebug.Cluster;
// lightCategories
m_DebugViewTilesMaterial.SetInt(HDShaderIDs._ViewTilesFlags, (int)lightingDebug.tileClusterDebugByCategory);

2
ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineSettings.cs.meta


fileFormatVersion: 2
guid: 0e59d5f3fb6a6744dbb195534816c029
guid: c10772362225f1341a0ca4b3e29f5a6c
MonoImporter:
externalObjects: {}
serializedVersion: 2

39
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/GlobalLightLoopSettings.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
// RenderRenderPipelineSettings represent settings that are immutable at runtime.
// There is a dedicated RenderRenderPipelineSettings for each platform
[Serializable]
public struct GlobalLightLoopSettings
{
public int spotCookieSize;
public int cookieTexArraySize;
public int pointCookieSize;
public int cubeCookieTexArraySize;
public int reflectionProbeCacheSize;
public int reflectionCubemapSize;
public bool reflectionCacheCompressed;
public GlobalLightLoopSettings()
{
spotCookieSize = 128;
cookieTexArraySize = 16;
pointCookieSize = 512;
cubeCookieTexArraySize = 16;
reflectionProbeCacheSize = 128;
reflectionCubemapSize = 128;
reflectionCacheCompressed = false;
}
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/GlobalLightLoopSettings.cs.meta


fileFormatVersion: 2
guid: 2cb8dc033b6e8d944bd7a4fc62dbb8ca
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

65
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoopSettings.cs


namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[Serializable]
public class LightLoopSettings
{
// Setup by the users
public bool enableTileAndCluster;
public bool enableComputeLightEvaluation;
public bool enableComputeLightVariants;
public bool enableComputeMaterialVariants;
// Deferred opaque always use FPTL, forward opaque can use FPTL or cluster, transparent always use cluster
// When MSAA is enabled, we only support cluster (Fptl is too slow with MSAA), and we don't support MSAA for deferred path (mean it is ok to keep fptl)
public bool enableFptlForForwardOpaque;
public bool enableBigTilePrepass;
// Setup by system
public bool isFTPLEnabled;
public LightLoopSettings()
{
enableTileAndCluster = true;
enableComputeLightEvaluation = true;
enableComputeLightVariants = true;
enableComputeMaterialVariants = true;
enableFptlForForwardOpaque = true;
enableBigTilePrepass = true;
isFTPLEnabled = true;
}
// aggregateFrameSettings already contain the aggregation of RenderPipelineSettings and FrameSettings (regular and/or debug)
static public LightLoopSettings InitializeLightLoopSettings(FrameSettings aggregateFrameSettings, RenderPipelineSettings renderPipelineSettings, FrameSettings frameSettings, FrameSettings debugSettings = null)
{
LightLoopSettings aggregate;
aggregate.enableTileAndCluster = frameSettings.enableTileAndCluster;
aggregate.enableComputeLightEvaluation = frameSettings.enableComputeLightEvaluation;
aggregate.enableComputeLightVariants = frameSettings.enableComputeLightVariants;
aggregate.enableComputeMaterialVariants = frameSettings.enableComputeMaterialVariants;
aggregate.enableFptlForForwardOpaque = frameSettings.enableFptlForForwardOpaque;
aggregate.enableBigTilePrepass = frameSettings.enableBigTilePrepass;
// Don't take into account debug settings for reflection probe or preview
if (debugSettings != null && !camera.cameraType == CameraType.Reflection && camera.cameraType != CameraType.Preview)
{
aggregate.enableTileAndCluster = aggregate.enableTileAndCluster && debugSettings.enableTileAndCluster;
aggregate.enableComputeLightEvaluation = aggregate.enableComputeLightEvaluation && debugSettings.enableComputeLightEvaluation;
aggregate.enableComputeLightVariants = aggregate.enableComputeLightVariants && debugSettings.enableComputeLightVariants;
aggregate.enableComputeMaterialVariants = aggregate.enableComputeMaterialVariants && debugSettings.enableComputeMaterialVariants;
aggregate.enableFptlForForwardOpaque = aggregate.enableFptlForForwardOpaque && debugSettings.enableFptlForForwardOpaque;
aggregate.enableBigTilePrepass = aggregate.enableBigTilePrepass && debugSettings.enableBigTilePrepass;
}
// Deferred opaque are always using Fptl. Forward opaque can use Fptl or Cluster, transparent use cluster.
// When MSAA is enabled we disable Fptl as it become expensive compare to cluster
// In HD, MSAA is only supported for forward only rendering, no MSAA in deferred mode (for code complexity reasons)
aggregate.enableFptlForForwardOpaque = aggregate.enableFptlForForwardOpaque && aggregateFrameSettings.enableMSAA;
// If Deferred, enable Fptl. If we are forward renderer only and not using Fptl for forward opaque, disable Fptl
aggregate.isFTPLEnabled = !aggregateFrameSettings.enableForwardRenderingOnly || aggregate.enableFptlForForwardOpaque;
return aggregate;
}
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoopSettings.cs.meta


fileFormatVersion: 2
guid: c8ff9f58676b0dd40b7d189461b54bf1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline.meta


fileFormatVersion: 2
guid: 73709c10d2eabb84d97c8af27f1bfc19
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

35
ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineSettings.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
// All the structures here represent global engine settings.
// It means that they are supposed to be setup once and not changed during the game.
// All of these will be serialized in the HDRenderPipelineInstance used for the project.
[Serializable]
public class GlobalTextureSettings
{
public const int kHDDefaultSpotCookieSize = 128;
public const int kHDDefaultPointCookieSize = 512;
public const int kHDDefaultReflectionCubemapSize = 128;
public int spotCookieSize = kHDDefaultSpotCookieSize;
public int pointCookieSize = kHDDefaultPointCookieSize;
public int reflectionCubemapSize = kHDDefaultReflectionCubemapSize;
public bool reflectionCacheCompressed = false;
}
[Serializable]
public class GlobalRenderingSettings
{
public bool supportShadowMask;
public bool supportSSSAndTransmission;
public bool supportDBuffer;
public bool supportSSR;
public bool supportSSAO;
}
}

185
ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/FrameSettings.cs


using System;
using UnityEngine;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
// The settings here are per frame settings.
// Each camera must have its own per frame settings
[Serializable]
public struct LightingSettings
{
// Setup by users
public bool enableShadow;
public bool enableSSR; // Depends on DepthPyramid
public bool enableSSAO;
public bool enableSSSAndTransmission;
// Setup by system
public float diffuseGlobalDimmer;
public float specularGlobalDimmer;
public LightingSettings()
{
enableShadow = true;
enableSSR = true;
enableSSAO = true;
enableSSSAndTransmission = true;
diffuseGlobalDimmer = 1.0f;
specularGlobalDimmer = 1.0f;
}
}
[Serializable]
public struct RenderSettings
{
// Setup by users
public bool enableForwardRenderingOnly; // TODO: Currently there is no way to strip the extra forward shaders generated by the shaders compiler, so we can switch dynamically.
public bool enableDepthPrepassWithDeferredRendering;
public bool enableAlphaTestOnlyInDeferredPrepass;
public bool enableTransparentPrePass;
public bool enableMotionVectors;
public bool enableDBuffer;
public bool enableAtmosphericScattering;
public bool enableRoughRefraction; // Depends on DepthPyramid - If not enable, just do a copy of the scene color (?) - how to disable rough refraction ?
public bool enableTransparentPostPass;
public bool enableDistortion;
public bool enablePostprocess;
public bool enableStereo;
public bool enableAsyncCompute;
public bool enableOpaqueObjects;
public bool enableTransparentObjects;
public bool enableMSAA;
// Setup by system
public bool enableMaterialDisplayDebug;
public bool enableShadowMask;
public RenderSettings()
{
enableForwardRenderingOnly = false;
enableDepthPrepassWithDeferredRendering = false;
enableAlphaTestOnlyInDeferredPrepass = false;
enableTransparentPrePass = true;
enableMotionVectors = true;
enableDBuffer = true;
enableAtmosphericScattering = true;
enableRoughRefraction = true;
enableTransparentPostPass = true;
enableDistortion = true;
enablePostprocess = true;
enableStereo = false;
enableAsyncCompute = false;
enableOpaqueObjects = true;
enableTransparentObjects = true;
enableMSAA = false;
enableMaterialDisplayDebug = false;
enableShadowMask = false;
}
}
// FrameSettings contain settings for a given camera / render. This settings can change from one frame to the other
[Serializable]
public class FrameSettings
{
public LightingSettings lightingSettings;
public RenderSettings renderSettings;
public LightLoopSettings lightLoopSettings;
// Init a FrameSettings from renderpipeline settings, frame settings and debug settings (if any)
// This will aggregate the various option
static public FrameSettings InitializeFrameSettings(RenderPipelineSettings renderPipelineSettings, FrameSettings frameSettings, FrameSettings debugSettings = null)
{
FrameSettings aggregate;
// When rendering reflection probe we disable specular as it is view dependent
if (camera.cameraType == CameraType.Reflection)
{
aggregate.lightingSettings.diffuseGlobalDimmer = 1.0f;
aggregate.lightingSettings.specularGlobalDimmer = 0.0f;
}
else
{
aggregate.lightingSettings.diffuseGlobalDimmer = 1.0f;
aggregate.lightingSettings.specularGlobalDimmer = 1.0f;
}
aggregate.lightingSettings.enableShadow = frameSettings.enableShadow;
aggregate.lightingSettings.enableSSR = frameSettings.enableSSR && renderPipelineSettings.supportSSR;
aggregate.lightingSettings.enableSSAO = frameSettings.enableSSAO && renderPipelineSettings.supportSSAO;
aggregate.lightingSettings.enableSSSAndTransmission = frameSettings.enableSSSAndTransmission && renderPipelineSettings.supportSSSAndTransmission;
// We have to fall back to forward-only rendering when scene view is using wireframe rendering mode
// as rendering everything in wireframe + deferred do not play well together
aggregate.renderSettings.enableForwardRenderingOnly = frameSettings.enableForwardRenderingOnly || GL.wireframe;
aggregate.renderSettings.enableDepthPrepassWithDeferredRendering = frameSettings.enableDepthPrepassWithDeferredRendering;
aggregate.renderSettings.enableAlphaTestOnlyInDeferredPrepass = frameSettings.enableAlphaTestOnlyInDeferredPrepass;
aggregate.renderSettings.enableTransparentPrePass = frameSettings.enableTransparentPrePass;
aggregate.renderSettings.enableMotionVectors = frameSettings.enableMotionVectors;
aggregate.renderSettings.enableDBuffer = frameSettings.enableDBuffer && renderPipelineSettings.supportDBuffer;
aggregate.renderSettings.enableAtmosphericScattering = frameSettings.enableAtmosphericScattering;
aggregate.renderSettings.enableRoughRefraction = frameSettings.enableRoughRefraction;
aggregate.renderSettings.enableTransparentPostPass = frameSettings.enableTransparentPostPass;
aggregate.renderSettings.enableDistortion = frameSettings.enableDistortion;
aggregate.renderSettings.enablePostprocess = frameSettings.enablePostprocess;
aggregate.renderSettings.enableStereo = frameSettings.enableStereo && UnityEngine.XR.XRSettings.isDeviceActive;
aggregate.renderSettings.enableAsyncCompute = frameSettings.enableAsyncCompute;
aggregate.renderSettings.enableOpaqueObjects = frameSettings.enableOpaqueObjects;
aggregate.renderSettings.enableTransparentObjects = frameSettings.enableTransparentObjects;
aggregate.renderSettings.enableMSAA = frameSettings.enableMSAA && renderPipelineSettings.supportMSAA;
aggregate.renderSettings.enableMaterialDisplayDebug = false;
aggregate.renderSettings.enableShadowMask = renderPipelineSettings.supportShadowMask;
// Don't display any debug information in reflection probe or preview
if (debugSettings != null && !camera.cameraType == CameraType.Reflection && camera.cameraType != CameraType.Preview)
{
// Ignore diffuseGlobalDimmer and specularGlobalDimmer
aggregate.lightingSettings.enableShadow = aggregate.lightingSettings.enableShadow && debugSettings.enableShadow;
aggregate.lightingSettings.enableSSR = aggregate.lightingSettings.enableSSR && debugSettings.enableSSR;
aggregate.lightingSettings.enableSSAO = aggregate.lightingSettings.enableSSAO && debugSettings.enableSSAO;
aggregate.lightingSettings.enableSSSAndTransmission = aggregate.lightingSettings.enableSSSAndTransmission && debugSettings.enableSSSAndTransmission;
aggregate.renderSettings.enableForwardRenderingOnly = aggregate.lightingSettings.enableForwardRenderingOnly && debugSettings.enableForwardRenderingOnly;
aggregate.renderSettings.enableDepthPrepassWithDeferredRendering = aggregate.lightingSettings.enableDepthPrepassWithDeferredRendering && debugSettings.enableDepthPrepassWithDeferredRendering;
aggregate.renderSettings.enableAlphaTestOnlyInDeferredPrepass = aggregate.lightingSettings.enableAlphaTestOnlyInDeferredPrepass && debugSettings.enableAlphaTestOnlyInDeferredPrepass;
aggregate.renderSettings.enableTransparentPrePass = aggregate.lightingSettings.enableTransparentPrePass && debugSettings.enableTransparentPrePass;
aggregate.renderSettings.enableMotionVectors = aggregate.lightingSettings.enableMotionVectors && debugSettings.enableMotionVectors;
aggregate.renderSettings.enableDBuffer = aggregate.lightingSettings.enableDBuffer && debugSettings.enableDBuffer;
aggregate.renderSettings.enableAtmosphericScattering = aggregate.lightingSettings.enableAtmosphericScattering && debugSettings.enableAtmosphericScattering;
aggregate.renderSettings.enableRoughRefraction = aggregate.lightingSettings.enableRoughRefraction && debugSettings.enableRoughRefraction;
aggregate.renderSettings.enableTransparentPostPass = aggregate.lightingSettings.enableTransparentPostPass && debugSettings.enableTransparentPostPass;
aggregate.renderSettings.enableDistortion = aggregate.lightingSettings.enableDistortion && debugSettings.enableDistortion;
aggregate.renderSettings.enablePostprocess = aggregate.lightingSettings.enablePostprocess && debugSettings.enablePostprocess;
aggregate.renderSettings.enableStereo = aggregate.lightingSettings.enableStereo && debugSettings.enableStereo && UnityEngine.XR.XRSettings.isDeviceActive;
aggregate.renderSettings.enableAsyncCompute = aggregate.lightingSettings.enableAsyncCompute && debugSettings.enableAsyncCompute;
aggregate.renderSettings.enableOpaqueObjects = aggregate.lightingSettings.enableOpaqueObjects && debugSettings.enableOpaqueObjects;
aggregate.renderSettings.enableTransparentObjects = aggregate.lightingSettings.enableTransparentObjects && debugSettings.enableTransparentObjects;
// ignore for enableMaterialDisplayDebug and enableShadowMask
}
aggregate.lightLoopSettings = LightLoopSettings.InitializeLightLoopSettings(aggregate, renderPipelineSettings, frameSettings, debugSettings);
return aggregate;
}
}
}

40
ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/GlobalFrameSettings.cs


using System;
using UnityEngine;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
// GlobalFrameSettings represent settings that are immutable at runtime.
// There is a dedicated RenderRenderPipelineSettings for each platform
[Serializable]
public struct GlobalRenderSettings
{
public bool supportShadowMask;
public bool supportSSSAndTransmission;
public bool supportDBuffer;
public bool supportSSR;
public bool supportSSAO;
public bool supportMSAA;
public GlobalRenderSettings()
{
supportShadowMask = true;
supportSSSAndTransmission = true;
supportDBuffer = false;
supportSSR = true;
supportSSAO = true;
supportMSAA = false;
}
}
[Serializable]
public class GlobalFrameSettings : ScriptableObject
{
public GlobalRenderSettings renderSettings;
public GlobalLightLoopSettings lightLoopSettings;
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/GlobalFrameSettings.cs.meta


fileFormatVersion: 2
guid: 19f344eae864d8a49a57cc3d20dc61fc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

20
ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/RenderPipelineSettings.cs


using System;
using UnityEngine;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
public class RenderPipelineSettings : ScriptableSingleton<RenderPipelineSettings>
{
[SerializeField]
GlobalFrameSettings m_globalFrameSettings;
static public GlobalFrameSettings GetGlobalFrameSettings()
{
if (m_globalFrameSettings == null)
{
m_globalFrameSettings = new GlobalFrameSettings();
}
return instance.m_globalFrameSettings;
}
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/RenderPipelineSettings.cs.meta


fileFormatVersion: 2
guid: 1f7e249841334a44f809b475ea9ae2cf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

14
ScriptableRenderPipeline/HDRenderPipeline/FrameSettings.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
// The settings here are per frame settings. They can be changed by the renderer based on its need each frame.
public class LightingSettings
{
public float diffuseGlobalDimmer = 1.0f;
public float specularGlobalDimmer = 1.0f;
}
}

38
ScriptableRenderPipeline/HDRenderPipeline/GlobalSettings.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
// All the structures here represent global engine settings.
// It means that they are supposed to be setup once and not changed during the game.
// All of these will be serialized in the HDRenderPipelineInstance used for the project.
[Serializable]
public class GlobalTextureSettings
{
public const int kHDDefaultSpotCookieSize = 128;
public const int kHDDefaultPointCookieSize = 512;
public const int kHDDefaultReflectionCubemapSize = 128;
public int spotCookieSize = kHDDefaultSpotCookieSize;
public int pointCookieSize = kHDDefaultPointCookieSize;
public int reflectionCubemapSize = kHDDefaultReflectionCubemapSize;
public bool reflectionCacheCompressed = false;
}
[Serializable]
public class GlobalRenderingSettings
{
public bool useForwardRenderingOnly; // TODO: Currently there is no way to strip the extra forward shaders generated by the shaders compiler, so we can switch dynamically.
public bool useDepthPrepassWithDeferredRendering;
public bool renderAlphaTestOnlyInDeferredPrepass;
// We have to fall back to forward-only rendering when scene view is using wireframe rendering mode --
// as rendering everything in wireframe + deferred do not play well together
public bool ShouldUseForwardRenderingOnly()
{
return useForwardRenderingOnly || GL.wireframe;
}
}
}

/ScriptableRenderPipeline/HDRenderPipeline/FrameSettings.cs.meta → /ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/FrameSettings.cs.meta

/ScriptableRenderPipeline/HDRenderPipeline/GlobalSettings.cs.meta → /ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineSettings.cs.meta

正在加载...
取消
保存