浏览代码
HDRenderPipeline: Make TilePass.LightLoop a regular class, not an asset
HDRenderPipeline: Make TilePass.LightLoop a regular class, not an asset
- Remove LightTileProducer class - remove BaseLightLoop class - TilePass.LightLoop is now a regular class/RenderPassXR_Sandbox
sebastienlagarde
8 年前
当前提交
d6537189
共有 10 个文件被更改,包括 121 次插入 和 241 次删除
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs
-
8Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
-
16Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.cs
-
174Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
-
12Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop.cs.meta
-
12Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoopProducer.cs.meta
-
12Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TileLightLoopProducer.cs.meta
-
45Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop.cs
-
7Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoopProducer.cs
-
74Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TileLightLoopProducer.cs
|
|||
fileFormatVersion: 2 |
|||
guid: 1669ef5a164969c4c90cd3509b01123d |
|||
timeCreated: 1481066258 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: dd4610bf13505b241bca4b8f5debfec4 |
|||
timeCreated: 1485446979 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 31c50a63970c0c843ab7cbf7d67d5b33 |
|||
timeCreated: 1485446978 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine; |
|||
using UnityEngine.Rendering; |
|||
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public class BaseLightLoop |
|||
{ |
|||
protected Light m_CurrentSunLight = null; |
|||
|
|||
// TODO: We should rather put the texture settings in LightLoop, but how do we serialize it ?
|
|||
public virtual void Build(TextureSettings textureSettings) {} |
|||
|
|||
public virtual void Cleanup() {} |
|||
|
|||
public virtual bool NeedResize() { return false; } |
|||
|
|||
public virtual void AllocResolutionDependentBuffers(int width, int height) {} |
|||
|
|||
public virtual void ReleaseResolutionDependentBuffers() {} |
|||
|
|||
public virtual void NewFrame() {} |
|||
|
|||
public virtual int GetCurrentShadowCount() { return 0; } |
|||
|
|||
public virtual void UpdateCullingParameters( ref CullingParameters cullingParams ) {} |
|||
public virtual void PrepareLightsForGPU(ShadowSettings shadowSettings, CullResults cullResults, Camera camera) {} |
|||
public virtual void RenderShadows(ScriptableRenderContext renderContext, CullResults cullResults) {} |
|||
|
|||
// TODO: this should not be part of the interface but for now make something working
|
|||
public virtual void BuildGPULightLists(Camera camera, ScriptableRenderContext renderContext, RenderTargetIdentifier cameraDepthBufferRT) {} |
|||
|
|||
public virtual void RenderDeferredLighting( HDCamera hdCamera, ScriptableRenderContext renderContext, |
|||
DebugDisplaySettings debugDisplaySettings, |
|||
RenderTargetIdentifier[] colorBuffers, RenderTargetIdentifier depthStencilBuffer, RenderTargetIdentifier depthStencilTexture, |
|||
bool outputSplitLightingForSSS) { } |
|||
|
|||
public virtual void RenderForward(Camera camera, ScriptableRenderContext renderContext, bool renderOpaque) {} |
|||
|
|||
public virtual void RenderLightingDebug(HDCamera hdCamera, ScriptableRenderContext renderContext, RenderTargetIdentifier colorBuffer) {} |
|||
|
|||
public Light GetCurrentSunLight() { return m_CurrentSunLight; } |
|||
|
|||
public virtual void RenderDebugOverlay(Camera camera, ScriptableRenderContext renderContext, DebugDisplaySettings debugDisplaySettings, ref float x, ref float y, float overlaySize, float width) { } |
|||
} |
|||
} |
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public abstract class LightLoopProducer : ScriptableObject |
|||
{ |
|||
public abstract BaseLightLoop CreateLightLoop(RenderPipelineResources renderPipelineResources); |
|||
} |
|||
} |
|
|||
using System; |
|||
#if UNITY_EDITOR
|
|||
using UnityEditor; |
|||
#endif
|
|||
using UnityEngine.Experimental.Rendering.HDPipeline.TilePass; |
|||
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public class TileLightLoopProducer : LightLoopProducer |
|||
{ |
|||
#if UNITY_EDITOR
|
|||
public const string TilePassProducer = "Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassProducer.asset"; |
|||
|
|||
[UnityEditor.MenuItem("HDRenderPipeline/TilePass/Create TileLightLoopProducer")] |
|||
static void CreateTileLightLoopProducer() |
|||
{ |
|||
var instance = CreateInstance<TileLightLoopProducer>(); |
|||
UnityEditor.AssetDatabase.CreateAsset(instance, TilePassProducer); |
|||
} |
|||
|
|||
#endif
|
|||
[Serializable] |
|||
public class TileSettings |
|||
{ |
|||
public bool enableTileAndCluster; // For debug / test
|
|||
public bool enableSplitLightEvaluation; |
|||
public bool enableComputeLightEvaluation; |
|||
public bool enableComputeFeatureVariants; |
|||
|
|||
// clustered light list specific buffers and data begin
|
|||
public bool enableClustered; |
|||
public bool enableFptlForOpaqueWhenClustered; // still useful on opaques. Should be true by default to force tile on opaque.
|
|||
public bool enableBigTilePrepass; |
|||
|
|||
[Range(0.0f, 1.0f)] |
|||
public float diffuseGlobalDimmer = 1.0f; |
|||
[Range(0.0f, 1.0f)] |
|||
public float specularGlobalDimmer = 1.0f; |
|||
|
|||
public enum TileDebug : int { None = 0, Punctual = 1, Area = 2, AreaAndPunctual = 3, Projector = 4, ProjectorAndPunctual = 5, ProjectorAndArea = 6, ProjectorAndAreaAndPunctual = 7, |
|||
Environment = 8, EnvironmentAndPunctual = 9, EnvironmentAndArea = 10, EnvironemntAndAreaAndPunctual = 11, |
|||
EnvironmentAndProjector = 12, EnvironmentAndProjectorAndPunctual = 13, EnvironmentAndProjectorAndArea = 14, EnvironmentAndProjectorAndAreaAndPunctual = 15, |
|||
FeatureVariants = 16 }; //TODO: we should probably make this checkboxes
|
|||
public TileDebug tileDebugByCategory; |
|||
|
|||
public static TileSettings defaultSettings = new TileSettings |
|||
{ |
|||
enableTileAndCluster = true, |
|||
enableSplitLightEvaluation = true, |
|||
enableComputeLightEvaluation = false, |
|||
enableComputeFeatureVariants = false, |
|||
|
|||
tileDebugByCategory = TileDebug.None, |
|||
enableClustered = true, |
|||
enableFptlForOpaqueWhenClustered = true, |
|||
enableBigTilePrepass = true, |
|||
}; |
|||
} |
|||
|
|||
[SerializeField] |
|||
private TileSettings m_TileSettings = TileSettings.defaultSettings; |
|||
|
|||
public TileSettings tileSettings |
|||
{ |
|||
get { return m_TileSettings; } |
|||
set { m_TileSettings = value; } |
|||
} |
|||
|
|||
public override BaseLightLoop CreateLightLoop(RenderPipelineResources renderPipelineResources) |
|||
{ |
|||
return new LightLoop(this, renderPipelineResources); |
|||
} |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue