浏览代码

Renamed TilePass to LightLoop

/main
Julien Ignace 7 年前
当前提交
5a107310
共有 30 个文件被更改,包括 574 次插入528 次删除
  1. 8
      ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs
  2. 18
      ScriptableRenderPipeline/HDRenderPipeline/Editor/HDAssetFactory.cs
  3. 2
      ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs
  4. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  5. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.cs
  6. 6
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/Lighting.hlsl
  7. 992
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs
  8. 20
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs.hlsl
  9. 4
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoopDef.hlsl
  10. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightingConvexHullUtils.hlsl
  11. 6
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/Shadow.hlsl
  12. 6
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/ShadowContext.hlsl
  13. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/builddispatchindirect.compute
  14. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/lightlistbuild-bigtile.compute
  15. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/lightlistbuild-clustered.compute
  16. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/lightlistbuild.compute
  17. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/materialflags.compute
  18. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/scrbound.compute
  19. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
  20. 8
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop.meta
  21. 9
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass.meta
  22. 0
      /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop
  23. 0
      /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs.hlsl.meta
  24. 0
      /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs.meta
  25. 0
      /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoopDef.hlsl.meta
  26. 0
      /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.hlsl
  27. 0
      /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.hlsl.meta
  28. 0
      /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs
  29. 0
      /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs.hlsl
  30. 0
      /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoopDef.hlsl

8
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, TilePass.TileSettings.TileClusterDebug>(kTileClusterDebug,() => lightingDebugSettings.tileClusterDebug, (value) => lightingDebugSettings.tileClusterDebug = (TilePass.TileSettings.TileClusterDebug)value);
DebugMenuManager.instance.AddDebugItem<LightingDebugPanel, TilePass.TileSettings.TileClusterCategoryDebug>(kTileClusterCategoryDebug,() => lightingDebugSettings.tileClusterDebugByCategory, (value) => lightingDebugSettings.tileClusterDebugByCategory = (TilePass.TileSettings.TileClusterCategoryDebug)value);
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<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);

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

18
ScriptableRenderPipeline/HDRenderPipeline/Editor/HDAssetFactory.cs


newAsset.copyChannelCS = Load<ComputeShader>(CorePath + "Resources/GPUCopy.compute");
newAsset.applyDistortionCS = Load<ComputeShader>(HDRenderPipelinePath + "RenderPipelineResources/ApplyDistorsion.compute");
newAsset.clearDispatchIndirectShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/TilePass/cleardispatchindirect.compute");
newAsset.buildDispatchIndirectShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/TilePass/builddispatchindirect.compute");
newAsset.buildScreenAABBShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/TilePass/scrbound.compute");
newAsset.buildPerTileLightListShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/TilePass/lightlistbuild.compute");
newAsset.buildPerBigTileLightListShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/TilePass/lightlistbuild-bigtile.compute");
newAsset.buildPerVoxelLightListShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/TilePass/lightlistbuild-clustered.compute");
newAsset.buildMaterialFlagsShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/TilePass/materialflags.compute");
newAsset.deferredComputeShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/TilePass/Deferred.compute");
newAsset.clearDispatchIndirectShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/LightLoop/cleardispatchindirect.compute");
newAsset.buildDispatchIndirectShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/LightLoop/builddispatchindirect.compute");
newAsset.buildScreenAABBShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/LightLoop/scrbound.compute");
newAsset.buildPerTileLightListShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/LightLoop/lightlistbuild.compute");
newAsset.buildPerBigTileLightListShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/LightLoop/lightlistbuild-bigtile.compute");
newAsset.buildPerVoxelLightListShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/LightLoop/lightlistbuild-clustered.compute");
newAsset.buildMaterialFlagsShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/LightLoop/materialflags.compute");
newAsset.deferredComputeShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/LightLoop/Deferred.compute");
newAsset.deferredDirectionalShadowComputeShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/TilePass/DeferredDirectionalShadow.compute");
newAsset.deferredDirectionalShadowComputeShader = Load<ComputeShader>(HDRenderPipelinePath + "Lighting/LightLoop/DeferredDirectionalShadow.compute");
// SceneSettings
// These shaders don't need to be reference by RenderPipelineResource as they are not use at runtime (only to draw in editor)

2
ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs


SerializedProperty m_DefaultDiffuseMaterial;
SerializedProperty m_DefaultShader;
// TilePass settings
// LightLoop settings
SerializedProperty m_enableTileAndCluster;
SerializedProperty m_enableSplitLightEvaluation;
SerializedProperty m_enableComputeLightEvaluation;

3
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


using System.Diagnostics;
using System.Linq;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.Experimental.Rendering.HDPipeline.TilePass;
using UnityEngine.Profiling;
#if UNITY_EDITOR

AccumulateDistortion(m_CullResults, camera, renderContext, cmd);
RenderDistortion(cmd, m_Asset.renderPipelineResources);
RenderPostProcesses(hdCamera, cmd, postProcessLayer);
RenderPostProcesses(hdCamera, cmd, postProcessLayer);
}
}

4
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.cs


using UnityEngine.Experimental.Rendering.HDPipeline.TilePass;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
// The HDRenderPipeline assumes linear lighting. Doesn't work with gamma.

public GlobalRenderingSettings globalRenderingSettings = new GlobalRenderingSettings();
public GlobalTextureSettings globalTextureSettings = new GlobalTextureSettings();
public SubsurfaceScatteringSettings sssSettings;
public TileSettings tileSettings = new TileSettings();
public LightLoopSettings tileSettings = new LightLoopSettings();
// Shadow Settings
public ShadowInitParameters shadowInitParams = new ShadowInitParameters();

6
ScriptableRenderPipeline/HDRenderPipeline/Lighting/Lighting.hlsl


#include "../Lighting/LightDefinition.cs.hlsl"
#include "../Lighting/LightUtilities.hlsl"
#include "TilePass/Shadow.hlsl"
#include "LightLoop/Shadow.hlsl"
#include "../Lighting/TilePass/TilePass.hlsl"
#include "../Lighting/LightLoop/LightLoopDef.hlsl"
#endif
// Shadow use samling function define in header above and must be include before Material.hlsl

#if defined(LIGHTLOOP_SINGLE_PASS) || defined(LIGHTLOOP_TILE_PASS)
#include "../Lighting/TilePass/TilePassLoop.hlsl"
#include "../Lighting/LightLoop/LightLoop.hlsl"
#endif

992
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs
文件差异内容过多而无法显示
查看文件

20
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs.hlsl


// This file was automatically generated. Please don't edit by hand.
//
#ifndef TILEPASS_CS_HLSL
#define TILEPASS_CS_HLSL
#ifndef LIGHTLOOP_CS_HLSL
#define LIGHTLOOP_CS_HLSL
// UnityEngine.Experimental.Rendering.HDPipeline.TilePass.LightVolumeType: static fields
// UnityEngine.Experimental.Rendering.HDPipeline.LightVolumeType: static fields
//
#define LIGHTVOLUMETYPE_CONE (0)
#define LIGHTVOLUMETYPE_SPHERE (1)

//
// UnityEngine.Experimental.Rendering.HDPipeline.TilePass.LightCategory: static fields
// UnityEngine.Experimental.Rendering.HDPipeline.LightCategory: static fields
//
#define LIGHTCATEGORY_PUNCTUAL (0)
#define LIGHTCATEGORY_AREA (1)

//
// UnityEngine.Experimental.Rendering.HDPipeline.TilePass.LightFeatureFlags: static fields
// UnityEngine.Experimental.Rendering.HDPipeline.LightFeatureFlags: static fields
//
#define LIGHTFEATUREFLAGS_PUNCTUAL (4096)
#define LIGHTFEATUREFLAGS_AREA (8192)

#define LIGHTFEATUREFLAGS_SSREFLECTION (262144)
//
// UnityEngine.Experimental.Rendering.HDPipeline.TilePass.LightDefinitions: static fields
// UnityEngine.Experimental.Rendering.HDPipeline.LightDefinitions: static fields
//
#define MAX_NR_LIGHTS_PER_CAMERA (1024)
#define MAX_NR_BIG_TILE_LIGHTS_PLUS_ONE (512)

#define LIGHT_FEATURE_MASK_FLAGS_TRANSPARENT (16510976)
#define MATERIAL_FEATURE_MASK_FLAGS (4095)
// Generated from UnityEngine.Experimental.Rendering.HDPipeline.TilePass.SFiniteLightBound
// Generated from UnityEngine.Experimental.Rendering.HDPipeline.SFiniteLightBound
// PackingRules = Exact
struct SFiniteLightBound
{

float radius;
};
// Generated from UnityEngine.Experimental.Rendering.HDPipeline.TilePass.LightVolumeData
// Generated from UnityEngine.Experimental.Rendering.HDPipeline.LightVolumeData
// PackingRules = Exact
struct LightVolumeData
{

};
//
// Accessors for UnityEngine.Experimental.Rendering.HDPipeline.TilePass.SFiniteLightBound
// Accessors for UnityEngine.Experimental.Rendering.HDPipeline.SFiniteLightBound
//
float3 GetBoxAxisX(SFiniteLightBound value)
{

}
//
// Accessors for UnityEngine.Experimental.Rendering.HDPipeline.TilePass.LightVolumeData
// Accessors for UnityEngine.Experimental.Rendering.HDPipeline.LightVolumeData
//
float3 GetLightPos(LightVolumeData value)
{

4
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoopDef.hlsl


#include "TilePass.cs.hlsl"
#include "LightLoop.cs.hlsl"
#define DWORD_PER_TILE 16 // See dwordsPerTile in TilePass.cs, we have roomm for 31 lights and a number of light value all store on 16 bit (ushort)
#define DWORD_PER_TILE 16 // See dwordsPerTile in LightLoop.cs, we have roomm for 31 lights and a number of light value all store on 16 bit (ushort)
CBUFFER_START(UnityTilePass)
uint _NumTileFtplX;

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightingConvexHullUtils.hlsl


#ifndef __LIGHTINGCONVEXHULLUTILS_H__
#define __LIGHTINGCONVEXHULLUTILS_H__
#include "TilePass.cs.hlsl"
#include "LightLoop.cs.hlsl"
float3 GetHullVertex(const float3 boxX, const float3 boxY, const float3 boxZ, const float3 center, const float2 scaleXY, const int p)
{

6
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/Shadow.hlsl


#ifndef TILEPASS_SHADOW_HLSL
#define TILEPASS_SHADOW_HLSL
#ifndef LIGHTLOOP_SHADOW_HLSL
#define LIGHTLOOP_SHADOW_HLSL
#define SHADOW_DISPATCH_USE_CUSTOM_DIRECTIONAL
#define SHADOW_DISPATCH_USE_CUSTOM_PUNCTUAL

#endif // TILEPASS_SHADOW_HLSL
#endif // LIGHTLOOP_SHADOW_HLSL

6
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/ShadowContext.hlsl


#ifndef TILEPASS_SHADOW_CONTEXT_HLSL
#define TILEPASS_SHADOW_CONTEXT_HLSL
#ifndef LIGHTLOOP_SHADOW_CONTEXT_HLSL
#define LIGHTLOOP_SHADOW_CONTEXT_HLSL
#define SHADOWCONTEXT_MAX_TEX2DARRAY 4
#define SHADOWCONTEXT_MAX_TEXCUBEARRAY 0

return sc;
}
#endif // TILEPASS_SHADOW_CONTEXT_HLSL
#endif // LIGHTLOOP_SHADOW_CONTEXT_HLSL

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/builddispatchindirect.compute


#pragma kernel BuildDispatchIndirect
#include "TilePass.cs.hlsl"
#include "LightLoop.cs.hlsl"
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
#include "../../Material/Material.hlsl" // This includes Material.hlsl

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/lightlistbuild-bigtile.compute


#pragma kernel BigTileLightListGen
#include "ShaderLibrary/common.hlsl"
#include "TilePass.cs.hlsl"
#include "LightLoop.cs.hlsl"
#include "LightingConvexHullUtils.hlsl"
#include "SortingComputeUtils.hlsl"

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/lightlistbuild-clustered.compute


#include "ShaderLibrary/common.hlsl"
#include "ShaderBase.hlsl"
#include "TilePass.cs.hlsl"
#include "LightLoop.cs.hlsl"
#include "LightingConvexHullUtils.hlsl"
#if !defined(SHADER_API_XBOXONE) && !defined(SHADER_API_PSSL)

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/lightlistbuild.compute


#include "ShaderLibrary/common.hlsl"
#include "ShaderBase.hlsl"
#include "TilePass.cs.hlsl"
#include "LightLoop.cs.hlsl"
#include "LightingConvexHullUtils.hlsl"
#if !defined(SHADER_API_XBOXONE) && !defined(SHADER_API_PSSL)

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/materialflags.compute


#include "ShaderLibrary/common.hlsl"
#include "ShaderBase.hlsl"
#include "TilePass.cs.hlsl"
#include "LightLoop.cs.hlsl"
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
#include "../../Material/Material.hlsl" // This includes Material.hlsl

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/scrbound.compute


#pragma kernel ScreenBoundsAABB
#include "ShaderLibrary/common.hlsl"
#include "TilePass.cs.hlsl"
#include "LightLoop.cs.hlsl"
uniform int g_isOrthographic;
uniform int g_iNrVisibLights;

2
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl


// However as we use material classification it is hard to be fully separated
// the dependecy is define in this include where there is shared define for material and lighting in case of deferred material.
// If a user do a lighting architecture without material classification, this can be remove
#include "../../Lighting/TilePass/TilePass.cs.hlsl"
#include "../../Lighting/LightLoop/LightLoop.cs.hlsl"
static uint g_FeatureFlags = UINT_MAX;

8
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop.meta


fileFormatVersion: 2
guid: 8d0d2ae5d51ae6e42a81b92e8693272f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

9
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass.meta


fileFormatVersion: 2
guid: 8d0d2ae5d51ae6e42a81b92e8693272f
folderAsset: yes
timeCreated: 1479218330
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass → /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop

/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/TilePass.cs.hlsl.meta → /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs.hlsl.meta

/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/TilePass.cs.meta → /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs.meta

/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/TilePass.hlsl.meta → /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoopDef.hlsl.meta

/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/TilePassLoop.hlsl → /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.hlsl

/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/TilePassLoop.hlsl.meta → /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.hlsl.meta

/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/TilePass.cs → /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs

/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/TilePass.cs.hlsl → /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs.hlsl

/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/TilePass.hlsl → /ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoopDef.hlsl

正在加载...
取消
保存