sebastienlagarde
7 年前
当前提交
a8480a83
共有 21 个文件被更改,包括 451 次插入 和 95 次删除
-
4ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs
-
4ScriptableRenderPipeline/HDRenderPipeline/Debug/LightingDebug.cs
-
5ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
-
43ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs
-
2ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineSettings.cs.meta
-
39ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/GlobalLightLoopSettings.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/GlobalLightLoopSettings.cs.meta
-
65ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoopSettings.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoopSettings.cs.meta
-
8ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline.meta
-
35ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineSettings.cs
-
185ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/FrameSettings.cs
-
40ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/GlobalFrameSettings.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/GlobalFrameSettings.cs.meta
-
20ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/RenderPipelineSettings.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/RenderPipelineSettings.cs.meta
-
14ScriptableRenderPipeline/HDRenderPipeline/FrameSettings.cs
-
38ScriptableRenderPipeline/HDRenderPipeline/GlobalSettings.cs
-
0/ScriptableRenderPipeline/HDRenderPipeline/RenderPipeline/FrameSettings.cs.meta
-
0/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineSettings.cs.meta
|
|||
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; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: 2cb8dc033b6e8d944bd7a4fc62dbb8ca |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: c8ff9f58676b0dd40b7d189461b54bf1 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 73709c10d2eabb84d97c8af27f1bfc19 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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; |
|||
} |
|||
} |
|
|||
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; |
|||
} |
|||
} |
|||
} |
|
|||
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; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 19f344eae864d8a49a57cc3d20dc61fc |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 1f7e249841334a44f809b475ea9ae2cf |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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; |
|||
} |
|||
} |
|
|||
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; |
|||
} |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue