浏览代码

Merge pull request #1215 from Unity-Technologies/revert-1212-expose-numlights-per-cluster

Revert "Expose the number of light indices per clustered tile"
/main
GitHub 7 年前
当前提交
7a36e4e2
共有 5 个文件被更改,包括 8 次插入27 次删除
  1. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/GlobalLightLoopSettingsUI.cs
  2. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedGlobalLightLoopSettings.cs
  3. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipelineAsset.asset
  4. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/GlobalLightLoopSettings.cs
  5. 19
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/GlobalLightLoopSettingsUI.cs


CED.space,
SectionReflection,
CED.space,
SectionLighting,
CED.space,
SectionSky
);
}

public static readonly CED.IDrawer SectionCookies = CED.Action(Drawer_SectionCookies);
public static readonly CED.IDrawer SectionReflection = CED.Action(Drawer_SectionReflection);
public static readonly CED.IDrawer SectionLighting = CED.Action(Drawer_SectionLighting);
public static readonly CED.IDrawer SectionSky = CED.Action(Drawer_SectionSky);
public GlobalLightLoopSettingsUI()

EditorGUILayout.PropertyField(d.planarReflectionProbeCacheSize, _.GetContent("Planar Probe Cache Size"));
EditorGUILayout.PropertyField(d.maxPlanarReflectionProbes, _.GetContent("Max Planar Probe Per Frame"));
d.maxPlanarReflectionProbes.intValue = Mathf.Max(1, d.maxPlanarReflectionProbes.intValue);
--EditorGUI.indentLevel;
}
static void Drawer_SectionLighting(GlobalLightLoopSettingsUI s, SerializedGlobalLightLoopSettings d, Editor o)
{
EditorGUILayout.LabelField(_.GetContent("Lighting"), EditorStyles.boldLabel);
++EditorGUI.indentLevel;
EditorGUILayout.PropertyField(d.numLightIndicesPerClusteredTile, _.GetContent("Maximum Number of Light Indices Per Cluster"));
--EditorGUI.indentLevel;
}

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedGlobalLightLoopSettings.cs


public SerializedProperty maxPlanarReflectionProbes;
public SerializedProperty skyReflectionSize;
public SerializedProperty skyLightingOverrideLayerMask;
public SerializedProperty numLightIndicesPerClusteredTile;
public SerializedGlobalLightLoopSettings(SerializedProperty root)
{

skyReflectionSize = root.Find((GlobalLightLoopSettings s) => s.skyReflectionSize);
skyLightingOverrideLayerMask = root.Find((GlobalLightLoopSettings s) => s.skyLightingOverrideLayerMask);
numLightIndicesPerClusteredTile = root.Find((GlobalLightLoopSettings s) => s.numLightIndicesPerClusteredTile);
}
}
}

1
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipelineAsset.asset


skyLightingOverrideLayerMask:
serializedVersion: 2
m_Bits: 256
numLightIndicesPerClusteredTile: 8
shadowInitParams:
shadowAtlasWidth: 4096
shadowAtlasHeight: 4096

1
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/GlobalLightLoopSettings.cs


public int maxPlanarReflectionProbes = 128;
public SkyResolution skyReflectionSize = SkyResolution.SkyResolution256;
public LayerMask skyLightingOverrideLayerMask = 0;
public int numLightIndicesPerClusteredTile = 8;
}
}

19
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs


private ComputeShader deferredDirectionalShadowComputeShader { get { return m_Resources.deferredDirectionalShadowComputeShader; } }
private GlobalLightLoopSettings m_LightLoopSettings = null;
static int s_GenAABBKernel;
static int s_GenListPerTileKernel;
static int s_GenListPerVoxelKernel;

{
m_Resources = hdAsset.renderPipelineResources;
m_LightLoopSettings = hdAsset.GetRenderPipelineSettings().lightLoopSettings;
m_DebugViewTilesMaterial = CoreUtils.CreateEngineMaterial(m_Resources.debugViewTilesShader);
m_DebugShadowMapMaterial = CoreUtils.CreateEngineMaterial(m_Resources.debugShadowMapShader);
m_CubeToPanoMaterial = CoreUtils.CreateEngineMaterial(m_Resources.cubeToPanoShader);

m_shadowDatas = new ComputeBuffer(k_MaxCascadeCount + k_MaxShadowOnScreen, System.Runtime.InteropServices.Marshal.SizeOf(typeof(ShadowData)));
m_DecalDatas = new ComputeBuffer(k_MaxDecalsOnScreen, System.Runtime.InteropServices.Marshal.SizeOf(typeof(DecalData)));
GlobalLightLoopSettings gLightLoopSettings = hdAsset.GetRenderPipelineSettings().lightLoopSettings;
m_CookieTexArray.AllocTextureArray(m_LightLoopSettings.cookieTexArraySize, m_LightLoopSettings.cookieSize, m_LightLoopSettings.cookieSize, TextureFormat.RGBA32, true);
m_CookieTexArray.AllocTextureArray(gLightLoopSettings.cookieTexArraySize, gLightLoopSettings.cookieSize, gLightLoopSettings.cookieSize, TextureFormat.RGBA32, true);
m_CubeCookieTexArray.AllocTextureArray(m_LightLoopSettings.cubeCookieTexArraySize, m_LightLoopSettings.pointCookieSize, TextureFormat.RGBA32, true, m_CubeToPanoMaterial);
m_CubeCookieTexArray.AllocTextureArray(gLightLoopSettings.cubeCookieTexArraySize, gLightLoopSettings.pointCookieSize, TextureFormat.RGBA32, true, m_CubeToPanoMaterial);
TextureFormat probeCacheFormat = m_LightLoopSettings.reflectionCacheCompressed ? TextureFormat.BC6H : TextureFormat.RGBAHalf;
m_ReflectionProbeCache = new ReflectionProbeCache(hdAsset, iblFilterGGX, m_LightLoopSettings.reflectionProbeCacheSize, m_LightLoopSettings.reflectionCubemapSize, probeCacheFormat, true);
TextureFormat probeCacheFormat = gLightLoopSettings.reflectionCacheCompressed ? TextureFormat.BC6H : TextureFormat.RGBAHalf;
m_ReflectionProbeCache = new ReflectionProbeCache(hdAsset, iblFilterGGX, gLightLoopSettings.reflectionProbeCacheSize, gLightLoopSettings.reflectionCubemapSize, probeCacheFormat, true);
TextureFormat planarProbeCacheFormat = m_LightLoopSettings.planarReflectionCacheCompressed ? TextureFormat.BC6H : TextureFormat.RGBAHalf;
m_ReflectionPlanarProbeCache = new PlanarReflectionProbeCache(hdAsset, iblFilterGGX, m_LightLoopSettings.planarReflectionProbeCacheSize, m_LightLoopSettings.planarReflectionTextureSize, planarProbeCacheFormat, true);
TextureFormat planarProbeCacheFormat = gLightLoopSettings.planarReflectionCacheCompressed ? TextureFormat.BC6H : TextureFormat.RGBAHalf;
m_ReflectionPlanarProbeCache = new PlanarReflectionProbeCache(hdAsset, iblFilterGGX, gLightLoopSettings.planarReflectionProbeCacheSize, gLightLoopSettings.planarReflectionTextureSize, planarProbeCacheFormat, true);
s_GenAABBKernel = buildScreenAABBShader.FindKernel("ScreenBoundsAABB");

int NumLightIndicesPerClusteredTile()
{
return m_LightLoopSettings.numLightIndicesPerClusteredTile * (1 << k_Log2NumClusters); // total footprint for all layers of the tile (measured in light index entries)
return 8 * (1 << k_Log2NumClusters); // total footprint for all layers of the tile (measured in light index entries)
}
public void AllocResolutionDependentBuffers(int width, int height, bool stereoEnabled)

正在加载...
取消
保存