static void Drawer_SectionReflection(SerializedHDRenderPipelineAsset serialized, Editor owner) { EditorGUILayout.PropertyField(serialized.renderPipelineSettings.supportSSR, k_SupportSSRContent); EditorGUILayout.Space(); EditorGUILayout.PropertyField(serialized.renderPipelineSettings.lightLoopSettings.reflectionCacheCompressed, k_CompressProbeCacheContent); EditorGUILayout.PropertyField(serialized.renderPipelineSettings.lightLoopSettings.reflectionCubemapSize, k_CubemapSizeContent); EditorGUI.BeginChangeCheck(); EditorGUILayout.DelayedIntField(serialized.renderPipelineSettings.lightLoopSettings.reflectionProbeCacheSize, k_ProbeCacheSizeContent); if (EditorGUI.EndChangeCheck()) { serialized.renderPipelineSettings.lightLoopSettings.reflectionProbeCacheSize.intValue = Mathf.Clamp(serialized.renderPipelineSettings.lightLoopSettings.reflectionProbeCacheSize.intValue, 1, TextureCache.k_MaxSupported); } long currentCache = ReflectionProbeCache.GetApproxCacheSizeInByte(serialized.renderPipelineSettings.lightLoopSettings.reflectionProbeCacheSize.intValue, serialized.renderPipelineSettings.lightLoopSettings.reflectionCubemapSize.intValue, serialized.renderPipelineSettings.lightLoopSettings.supportFabricConvolution.boolValue ? 2 : 1); if (currentCache > LightLoop.k_MaxCacheSize) { int reserved = ReflectionProbeCache.GetMaxCacheSizeForWeightInByte(LightLoop.k_MaxCacheSize, serialized.renderPipelineSettings.lightLoopSettings.reflectionCubemapSize.intValue, serialized.renderPipelineSettings.lightLoopSettings.supportFabricConvolution.boolValue ? 2 : 1); string message = string.Format(k_CacheErrorFormat, HDEditorUtils.HumanizeWeight(currentCache), reserved); EditorGUILayout.HelpBox(message, MessageType.Error); } else { string message = string.Format(k_CacheInfoFormat, HDEditorUtils.HumanizeWeight(currentCache)); EditorGUILayout.HelpBox(message, MessageType.Info); } EditorGUILayout.Space(); EditorGUILayout.PropertyField(serialized.renderPipelineSettings.lightLoopSettings.planarReflectionCacheCompressed, k_CompressPlanarProbeCacheContent); EditorGUILayout.PropertyField(serialized.renderPipelineSettings.lightLoopSettings.planarReflectionCubemapSize, k_PlanarTextureSizeContent); EditorGUI.BeginChangeCheck(); EditorGUILayout.DelayedIntField(serialized.renderPipelineSettings.lightLoopSettings.planarReflectionProbeCacheSize, k_PlanarProbeCacheSizeContent); if (EditorGUI.EndChangeCheck()) { serialized.renderPipelineSettings.lightLoopSettings.planarReflectionProbeCacheSize.intValue = Mathf.Clamp(serialized.renderPipelineSettings.lightLoopSettings.planarReflectionProbeCacheSize.intValue, 1, TextureCache.k_MaxSupported); } currentCache = PlanarReflectionProbeCache.GetApproxCacheSizeInByte(serialized.renderPipelineSettings.lightLoopSettings.planarReflectionProbeCacheSize.intValue, serialized.renderPipelineSettings.lightLoopSettings.planarReflectionCubemapSize.intValue, 1); if (currentCache > LightLoop.k_MaxCacheSize) { int reserved = PlanarReflectionProbeCache.GetMaxCacheSizeForWeightInByte(LightLoop.k_MaxCacheSize, serialized.renderPipelineSettings.lightLoopSettings.planarReflectionCubemapSize.intValue, 1); string message = string.Format(k_CacheErrorFormat, HDEditorUtils.HumanizeWeight(currentCache), reserved); EditorGUILayout.HelpBox(message, MessageType.Error); } else { string message = string.Format(k_CacheInfoFormat, HDEditorUtils.HumanizeWeight(currentCache)); EditorGUILayout.HelpBox(message, MessageType.Info); } EditorGUILayout.Space(); EditorGUI.BeginChangeCheck(); EditorGUILayout.DelayedIntField(serialized.renderPipelineSettings.lightLoopSettings.maxEnvLightsOnScreen, k_MaxEnvContent); if (EditorGUI.EndChangeCheck()) { serialized.renderPipelineSettings.lightLoopSettings.maxEnvLightsOnScreen.intValue = Mathf.Clamp(serialized.renderPipelineSettings.lightLoopSettings.maxEnvLightsOnScreen.intValue, 1, LightLoop.k_MaxEnvLightsOnScreen); } }
static void Drawer_SectionReflection(GlobalLightLoopSettingsUI s, SerializedGlobalLightLoopSettings d, Editor o) { EditorGUILayout.PropertyField(d.reflectionCacheCompressed, _.GetContent("Compress Reflection Probe Cache")); EditorGUILayout.PropertyField(d.reflectionCubemapSize, _.GetContent("Cubemap Size")); EditorGUI.BeginChangeCheck(); EditorGUILayout.DelayedIntField(d.reflectionProbeCacheSize, _.GetContent("Probe Cache Size")); if (EditorGUI.EndChangeCheck()) { d.reflectionProbeCacheSize.intValue = Mathf.Clamp(d.reflectionProbeCacheSize.intValue, 1, TextureCache.k_MaxSupported); } long currentCache = ReflectionProbeCache.GetApproxCacheSizeInByte(d.reflectionProbeCacheSize.intValue, d.reflectionCubemapSize.intValue, d.supportFabricConvolution.boolValue ? 2 : 1); if (currentCache > LightLoop.k_MaxCacheSize) { int reserved = ReflectionProbeCache.GetMaxCacheSizeForWeightInByte(LightLoop.k_MaxCacheSize, d.reflectionCubemapSize.intValue, d.supportFabricConvolution.boolValue ? 2 : 1); string message = string.Format(cacheErrorFormat, HumanizeWeight(currentCache), reserved); EditorGUILayout.HelpBox(message, MessageType.Error); } else { string message = string.Format(cacheInfoFormat, HumanizeWeight(currentCache)); EditorGUILayout.HelpBox(message, MessageType.Info); } EditorGUILayout.Space(); EditorGUILayout.PropertyField(d.planarReflectionCacheCompressed, _.GetContent("Compress Planar Reflection Probe Cache")); EditorGUILayout.PropertyField(d.planarReflectionCubemapSize, _.GetContent("Planar Reflection Texture Size")); EditorGUI.BeginChangeCheck(); EditorGUILayout.DelayedIntField(d.planarReflectionProbeCacheSize, _.GetContent("Planar Probe Cache Size")); if (EditorGUI.EndChangeCheck()) { d.planarReflectionProbeCacheSize.intValue = Mathf.Clamp(d.planarReflectionProbeCacheSize.intValue, 1, TextureCache.k_MaxSupported); } currentCache = PlanarReflectionProbeCache.GetApproxCacheSizeInByte(d.planarReflectionProbeCacheSize.intValue, d.planarReflectionCubemapSize.intValue, 1); if (currentCache > LightLoop.k_MaxCacheSize) { int reserved = PlanarReflectionProbeCache.GetMaxCacheSizeForWeightInByte(LightLoop.k_MaxCacheSize, d.planarReflectionCubemapSize.intValue, 1); string message = string.Format(cacheErrorFormat, HumanizeWeight(currentCache), reserved); EditorGUILayout.HelpBox(message, MessageType.Error); } else { string message = string.Format(cacheInfoFormat, HumanizeWeight(currentCache)); EditorGUILayout.HelpBox(message, MessageType.Info); } EditorGUILayout.PropertyField(d.supportFabricConvolution, _.GetContent("Support Fabric BSDF Convolution.")); EditorGUILayout.Space(); }