public override void OnEnable() { var o = new PropertyFetcher <DiffusionProfileOverride>(serializedObject); m_DiffusionProfiles = Unpack(o.Find(x => x.diffusionProfiles)); }
protected override void OnEnable() { base.OnEnable(); // Get & automatically add additional HD data if not present m_AdditionalLightDatas = CoreEditorUtils.GetAdditionalData <HDAdditionalLightData>(targets, HDAdditionalLightData.InitDefaultHDAdditionalLightData); m_AdditionalShadowDatas = CoreEditorUtils.GetAdditionalData <AdditionalShadowData>(targets, HDAdditionalShadowData.InitDefaultHDAdditionalShadowData); m_SerializedAdditionalLightData = new SerializedObject(m_AdditionalLightDatas); m_SerializedAdditionalShadowData = new SerializedObject(m_AdditionalShadowDatas); using (var o = new PropertyFetcher <HDAdditionalLightData>(m_SerializedAdditionalLightData)) m_AdditionalLightData = new SerializedLightData { intensity = o.Find(x => x.displayLightIntensity), enableSpotReflector = o.Find(x => x.enableSpotReflector), spotInnerPercent = o.Find(x => x.m_InnerSpotPercent), lightDimmer = o.Find(x => x.lightDimmer), volumetricDimmer = o.Find(x => x.volumetricDimmer), lightUnit = o.Find(x => x.lightUnit), displayAreaLightEmissiveMesh = o.Find(x => x.displayAreaLightEmissiveMesh), lightLayers = o.Find(x => x.lightLayers), fadeDistance = o.Find(x => x.fadeDistance), affectDiffuse = o.Find(x => x.affectDiffuse), affectSpecular = o.Find(x => x.affectSpecular), nonLightmappedOnly = o.Find(x => x.nonLightmappedOnly), lightTypeExtent = o.Find(x => x.lightTypeExtent), spotLightShape = o.Find(x => x.spotLightShape), shapeWidth = o.Find(x => x.shapeWidth), shapeHeight = o.Find(x => x.shapeHeight), aspectRatio = o.Find(x => x.aspectRatio), shapeRadius = o.Find(x => x.shapeRadius), maxSmoothness = o.Find(x => x.maxSmoothness), applyRangeAttenuation = o.Find(x => x.applyRangeAttenuation), shadowSoftness = o.Find(x => x.shadowSoftness), blockerSampleCount = o.Find(x => x.blockerSampleCount), filterSampleCount = o.Find(x => x.filterSampleCount), sunDiskSize = o.Find(x => x.sunDiskSize), sunHaloSize = o.Find(x => x.sunHaloSize), // Editor stuff useOldInspector = o.Find(x => x.useOldInspector), showFeatures = o.Find(x => x.featuresFoldout), showAdditionalSettings = o.Find(x => x.showAdditionalSettings) }; // TODO: Review this once AdditionalShadowData is refactored using (var o = new PropertyFetcher <AdditionalShadowData>(m_SerializedAdditionalShadowData)) m_AdditionalShadowData = new SerializedShadowData { dimmer = o.Find(x => x.shadowDimmer), fadeDistance = o.Find(x => x.shadowFadeDistance), resolution = o.Find(x => x.shadowResolution), contactShadows = o.Find(x => x.contactShadows), viewBiasMin = o.Find(x => x.viewBiasMin), viewBiasMax = o.Find(x => x.viewBiasMax), viewBiasScale = o.Find(x => x.viewBiasScale), normalBiasMin = o.Find(x => x.normalBiasMin), normalBiasMax = o.Find(x => x.normalBiasMax), normalBiasScale = o.Find(x => x.normalBiasScale), sampleBiasScale = o.Find(x => x.sampleBiasScale), edgeLeakFixup = o.Find(x => x.edgeLeakFixup), edgeToleranceNormal = o.Find(x => x.edgeToleranceNormal), edgeTolerance = o.Find(x => x.edgeTolerance) }; // Update emissive mesh and light intensity when undo/redo Undo.undoRedoPerformed += () => { m_SerializedAdditionalLightData.ApplyModifiedProperties(); foreach (var hdLightData in m_AdditionalLightDatas) { if (hdLightData != null) { hdLightData.UpdateAreaLightEmissiveMesh(); } } }; // If the light is disabled in the editor we force the light upgrade from his inspector foreach (var additionalLightData in m_AdditionalLightDatas) { additionalLightData.UpgradeLight(); } m_HDShadowInitParameters = (GraphicsSettings.renderPipelineAsset as HDRenderPipelineAsset).renderPipelineSettings.hdShadowInitParams; m_ShadowAlgorithmUIs = new Dictionary <HDShadowQuality, Action> { { HDShadowQuality.Low, DrawLowShadowSettings }, { HDShadowQuality.Medium, DrawMediumShadowSettings }, { HDShadowQuality.High, DrawHighShadowSettings } }; }
public SerializedHDLight(HDAdditionalLightData[] lightDatas, AdditionalShadowData[] shadowDatas, LightEditor.Settings settings) { serializedLightDatas = new SerializedObject(lightDatas); serializedShadowDatas = new SerializedObject(shadowDatas); this.settings = settings; using (var o = new PropertyFetcher <HDAdditionalLightData>(serializedLightDatas)) serializedLightData = new SerializedLightData { intensity = o.Find(x => x.displayLightIntensity), enableSpotReflector = o.Find(x => x.enableSpotReflector), luxAtDistance = o.Find(x => x.luxAtDistance), spotInnerPercent = o.Find(x => x.m_InnerSpotPercent), lightDimmer = o.Find(x => x.lightDimmer), volumetricDimmer = o.Find(x => x.volumetricDimmer), lightUnit = o.Find(x => x.lightUnit), displayAreaLightEmissiveMesh = o.Find(x => x.displayAreaLightEmissiveMesh), fadeDistance = o.Find(x => x.fadeDistance), affectDiffuse = o.Find(x => x.affectDiffuse), affectSpecular = o.Find(x => x.affectSpecular), nonLightmappedOnly = o.Find(x => x.nonLightmappedOnly), lightTypeExtent = o.Find(x => x.lightTypeExtent), spotLightShape = o.Find("m_SpotLightShape"), shapeWidth = o.Find(x => x.shapeWidth), shapeHeight = o.Find(x => x.shapeHeight), aspectRatio = o.Find(x => x.aspectRatio), shapeRadius = o.Find(x => x.shapeRadius), maxSmoothness = o.Find(x => x.maxSmoothness), applyRangeAttenuation = o.Find(x => x.applyRangeAttenuation), shadowNearPlane = o.Find(x => x.shadowNearPlane), shadowSoftness = o.Find(x => x.shadowSoftness), blockerSampleCount = o.Find(x => x.blockerSampleCount), filterSampleCount = o.Find(x => x.filterSampleCount), minFilterSize = o.Find(x => x.minFilterSize), sunDiskSize = o.Find(x => x.sunDiskSize), sunHaloSize = o.Find(x => x.sunHaloSize), areaLightCookie = o.Find(x => x.areaLightCookie), areaLightShadowCone = o.Find(x => x.areaLightShadowCone), #if ENABLE_RAYTRACING useRayTracedShadows = o.Find(x => x.useRayTracedShadows), numRayTracingSamples = o.Find(x => x.numRayTracingSamples), filterTracedShadow = o.Find(x => x.filterTracedShadow), filterSizeTraced = o.Find(x => x.filterSizeTraced), #endif evsmExponent = o.Find(x => x.evsmExponent), evsmVarianceBias = o.Find(x => x.evsmVarianceBias), evsmLightLeakBias = o.Find(x => x.evsmLightLeakBias), evsmBlurPasses = o.Find(x => x.evsmBlurPasses), // Moment light lightAngle = o.Find(x => x.lightAngle), kernelSize = o.Find(x => x.kernelSize), maxDepthBias = o.Find(x => x.maxDepthBias), // Editor stuff useOldInspector = o.Find(x => x.useOldInspector), showFeatures = o.Find(x => x.featuresFoldout), showAdditionalSettings = o.Find(x => x.showAdditionalSettings), useVolumetric = o.Find(x => x.useVolumetric), renderingLayerMask = settings.renderingLayerMask, // Layers linkLightLayers = o.Find(x => x.linkShadowLayers), lightlayersMask = o.Find(x => x.lightlayersMask) }; // TODO: Review this once AdditionalShadowData is refactored using (var o = new PropertyFetcher <AdditionalShadowData>(serializedShadowDatas)) serializedShadowData = new SerializedShadowData { shadowDimmer = o.Find(x => x.shadowDimmer), volumetricShadowDimmer = o.Find(x => x.volumetricShadowDimmer), fadeDistance = o.Find(x => x.shadowFadeDistance), resolution = o.Find(x => x.shadowResolution), contactShadows = o.Find(x => x.contactShadows), viewBiasMin = o.Find(x => x.viewBiasMin), viewBiasMax = o.Find(x => x.viewBiasMax), viewBiasScale = o.Find(x => x.viewBiasScale), normalBiasMin = o.Find(x => x.normalBiasMin), normalBiasMax = o.Find(x => x.normalBiasMax), normalBiasScale = o.Find(x => x.normalBiasScale), sampleBiasScale = o.Find(x => x.sampleBiasScale), edgeLeakFixup = o.Find(x => x.edgeLeakFixup), edgeToleranceNormal = o.Find(x => x.edgeToleranceNormal), edgeTolerance = o.Find(x => x.edgeTolerance) }; }
protected virtual void OnEnable() { properties = new PropertyFetcher <T>(serializedObject); }
private void BeforeExecuteHelper(KeyValuePair <string, object> evnt, PropertyFetcher operationIdFetcher, PropertyFetcher commandFetcher, PropertyFetcher commandTextFetcher, PropertyFetcher connectionFetcher, PropertyFetcher dataSourceFetcher, PropertyFetcher databaseFetcher, PropertyFetcher commandTypeFetcher, PropertyFetcher timeStampFetcher) { var fet = CommandBefore.OperationId; var operationId = (Guid)operationIdFetcher.Fetch(evnt.Value); DependencyCollectorEventSource.Log.SqlClientDiagnosticSubscriberCallbackCalled(operationId, evnt.Key); var command = commandFetcher.Fetch(evnt.Value); if (this.operationHolder.Get(command) == null) { var dependencyName = string.Empty; var target = string.Empty; var commandType = (int)commandTypeFetcher.Fetch(command); var commandText = string.Empty; // https://docs.microsoft.com/dotnet/api/system.data.commandtype // 4 indicate StoredProcedure if (this.collectCommandText) { commandText = (string)commandTextFetcher.Fetch(command); } var con = connectionFetcher.Fetch(command); if (con != null) { var dataSource = dataSourceFetcher.Fetch(con); var database = databaseFetcher.Fetch(con); target = string.Join(" | ", dataSource, database); // https://docs.microsoft.com/dotnet/api/system.data.commandtype // 4 indicate StoredProcedure var commandName = commandType == 4 ? commandText : string.Empty; dependencyName = string.IsNullOrEmpty(commandName) ? string.Join(" | ", dataSource, database) : string.Join(" | ", dataSource, database, commandName); } var timestamp = timeStampFetcher.Fetch(evnt.Value) as long? ?? Stopwatch.GetTimestamp(); // TODO corefx#20748 - timestamp missing from event data var telemetry = new DependencyTelemetry() { Id = operationId.ToStringInvariant("N"), Name = dependencyName, Type = RemoteDependencyConstants.SQL, Target = target, Data = commandText, Success = true, }; // Populate the operation details for initializers telemetry.SetOperationDetail(RemoteDependencyConstants.SqlCommandOperationDetailName, command); InitializeTelemetry(telemetry, operationId, timestamp); this.operationHolder.Store(command, Tuple.Create(telemetry, /* isCustomCreated: */ false)); } else { DependencyCollectorEventSource.Log.TrackingAnExistingTelemetryItemVerbose(); } }
protected override void OnEnable() { base.OnEnable(); // Get & automatically add additional HD data if not present m_AdditionalLightDatas = CoreEditorUtils.GetAdditionalData <HDAdditionalLightData>(targets, HDAdditionalLightData.InitDefaultHDAdditionalLightData); m_AdditionalShadowDatas = CoreEditorUtils.GetAdditionalData <AdditionalShadowData>(targets, HDAdditionalShadowData.InitDefaultHDAdditionalShadowData); m_SerializedAdditionalLightData = new SerializedObject(m_AdditionalLightDatas); m_SerializedAdditionalShadowData = new SerializedObject(m_AdditionalShadowDatas); using (var o = new PropertyFetcher <HDAdditionalLightData>(m_SerializedAdditionalLightData)) m_AdditionalLightData = new SerializedLightData { directionalIntensity = o.Find(x => x.directionalIntensity), punctualIntensity = o.Find(x => x.punctualIntensity), areaIntensity = o.Find(x => x.areaIntensity), enableSpotReflector = o.Find(x => x.enableSpotReflector), spotInnerPercent = o.Find(x => x.m_InnerSpotPercent), lightDimmer = o.Find(x => x.lightDimmer), volumetricDimmer = o.Find(x => x.volumetricDimmer), displayAreaLightEmissiveMesh = o.Find(x => x.displayAreaLightEmissiveMesh), fadeDistance = o.Find(x => x.fadeDistance), affectDiffuse = o.Find(x => x.affectDiffuse), affectSpecular = o.Find(x => x.affectSpecular), nonLightmappedOnly = o.Find(x => x.nonLightmappedOnly), lightTypeExtent = o.Find(x => x.lightTypeExtent), spotLightShape = o.Find(x => x.spotLightShape), shapeWidth = o.Find(x => x.shapeWidth), shapeHeight = o.Find(x => x.shapeHeight), aspectRatio = o.Find(x => x.aspectRatio), shapeRadius = o.Find(x => x.shapeRadius), maxSmoothness = o.Find(x => x.maxSmoothness), applyRangeAttenuation = o.Find(x => x.applyRangeAttenuation), // Editor stuff useOldInspector = o.Find(x => x.useOldInspector), showFeatures = o.Find(x => x.featuresFoldout), showAdditionalSettings = o.Find(x => x.showAdditionalSettings) }; // TODO: Review this once AdditionalShadowData is refactored using (var o = new PropertyFetcher <AdditionalShadowData>(m_SerializedAdditionalShadowData)) m_AdditionalShadowData = new SerializedShadowData { dimmer = o.Find(x => x.shadowDimmer), fadeDistance = o.Find(x => x.shadowFadeDistance), resolution = o.Find(x => x.shadowResolution), contactShadows = o.Find(x => x.contactShadows), viewBiasMin = o.Find(x => x.viewBiasMin), viewBiasMax = o.Find(x => x.viewBiasMax), viewBiasScale = o.Find(x => x.viewBiasScale), normalBiasMin = o.Find(x => x.normalBiasMin), normalBiasMax = o.Find(x => x.normalBiasMax), normalBiasScale = o.Find(x => x.normalBiasScale), sampleBiasScale = o.Find(x => x.sampleBiasScale), edgeLeakFixup = o.Find(x => x.edgeLeakFixup), edgeToleranceNormal = o.Find(x => x.edgeToleranceNormal), edgeTolerance = o.Find(x => x.edgeTolerance) }; }
public SerializedHDLight(HDAdditionalLightData[] lightDatas, AdditionalShadowData[] shadowDatas, LightEditor.Settings settings) { serializedLightDatas = new SerializedObject(lightDatas); serializedShadowDatas = new SerializedObject(shadowDatas); this.settings = settings; using (var o = new PropertyFetcher <HDAdditionalLightData>(serializedLightDatas)) serializedLightData = new SerializedLightData { intensity = o.Find(x => x.displayLightIntensity), enableSpotReflector = o.Find(x => x.enableSpotReflector), luxAtDistance = o.Find(x => x.luxAtDistance), spotInnerPercent = o.Find(x => x.m_InnerSpotPercent), lightDimmer = o.Find(x => x.lightDimmer), volumetricDimmer = o.Find(x => x.volumetricDimmer), lightUnit = o.Find(x => x.lightUnit), displayAreaLightEmissiveMesh = o.Find(x => x.displayAreaLightEmissiveMesh), lightLayers = o.Find(x => x.lightLayers), fadeDistance = o.Find(x => x.fadeDistance), affectDiffuse = o.Find(x => x.affectDiffuse), affectSpecular = o.Find(x => x.affectSpecular), nonLightmappedOnly = o.Find(x => x.nonLightmappedOnly), lightTypeExtent = o.Find(x => x.lightTypeExtent), spotLightShape = o.Find(x => x.spotLightShape), shapeWidth = o.Find(x => x.shapeWidth), shapeHeight = o.Find(x => x.shapeHeight), aspectRatio = o.Find(x => x.aspectRatio), shapeRadius = o.Find(x => x.shapeRadius), maxSmoothness = o.Find(x => x.maxSmoothness), applyRangeAttenuation = o.Find(x => x.applyRangeAttenuation), shadowNearPlane = o.Find(x => x.shadowNearPlane), shadowSoftness = o.Find(x => x.shadowSoftness), blockerSampleCount = o.Find(x => x.blockerSampleCount), filterSampleCount = o.Find(x => x.filterSampleCount), minFilterSize = o.Find(x => x.minFilterSize), sunDiskSize = o.Find(x => x.sunDiskSize), sunHaloSize = o.Find(x => x.sunHaloSize), // Editor stuff useOldInspector = o.Find(x => x.useOldInspector), showFeatures = o.Find(x => x.featuresFoldout), showAdditionalSettings = o.Find(x => x.showAdditionalSettings), useVolumetric = o.Find(x => x.useVolumetric) }; // TODO: Review this once AdditionalShadowData is refactored using (var o = new PropertyFetcher <AdditionalShadowData>(serializedShadowDatas)) serializedShadowData = new SerializedShadowData { shadowDimmer = o.Find(x => x.shadowDimmer), volumetricShadowDimmer = o.Find(x => x.volumetricShadowDimmer), fadeDistance = o.Find(x => x.shadowFadeDistance), resolution = o.Find(x => x.shadowResolution), contactShadows = o.Find(x => x.contactShadows), viewBiasMin = o.Find(x => x.viewBiasMin), viewBiasMax = o.Find(x => x.viewBiasMax), viewBiasScale = o.Find(x => x.viewBiasScale), normalBiasMin = o.Find(x => x.normalBiasMin), normalBiasMax = o.Find(x => x.normalBiasMax), normalBiasScale = o.Find(x => x.normalBiasScale), sampleBiasScale = o.Find(x => x.sampleBiasScale), edgeLeakFixup = o.Find(x => x.edgeLeakFixup), edgeToleranceNormal = o.Find(x => x.edgeToleranceNormal), edgeTolerance = o.Find(x => x.edgeTolerance) }; }
/// <summary> /// Refreshes the serialized properties from the serialized objects /// </summary> public void Refresh() { var o = new PropertyFetcher <UniversalAdditionalCameraData>(serializedAdditionalDataObject); cameras = o.Find("m_Cameras"); }
public override void OnEnable() { var o = new PropertyFetcher <QualityOverrideVolume>(serializedObject); m_IsPSXQualityEnabled = Unpack(o.Find(x => x.isPSXQualityEnabled)); }
public override void OnEnable() { var o = new PropertyFetcher <VolumeComponentWithQuality>(serializedObject); m_QualitySetting = Unpack(o.Find(x => x.quality)); }
public override void OnEnable() { var o = new PropertyFetcher <VolumetricClouds>(serializedObject); // General m_Enable = Unpack(o.Find(x => x.enable)); m_LocalClouds = Unpack(o.Find(x => x.localClouds)); // Shape m_CloudControl = Unpack(o.Find(x => x.cloudControl)); m_CloudPreset = Unpack(o.Find(x => x.cloudPreset)); m_CumulusMap = Unpack(o.Find(x => x.cumulusMap)); m_CumulusMapMultiplier = Unpack(o.Find(x => x.cumulusMapMultiplier)); m_AltoStratusMap = Unpack(o.Find(x => x.altoStratusMap)); m_AltoStratusMapMultiplier = Unpack(o.Find(x => x.altoStratusMapMultiplier)); m_CumulonimbusMap = Unpack(o.Find(x => x.cumulonimbusMap)); m_CumulonimbusMapMultiplier = Unpack(o.Find(x => x.cumulonimbusMapMultiplier)); m_RainMap = Unpack(o.Find(x => x.rainMap)); m_CloudMapResolution = Unpack(o.Find(x => x.cloudMapResolution)); m_CloudMap = Unpack(o.Find(x => x.cloudMap)); m_CloudLut = Unpack(o.Find(x => x.cloudLut)); m_EarthCurvature = Unpack(o.Find(x => x.earthCurvature)); m_CloudTiling = Unpack(o.Find(x => x.cloudTiling)); m_CloudOffset = Unpack(o.Find(x => x.cloudOffset)); m_LowestCloudAltitude = Unpack(o.Find(x => x.lowestCloudAltitude)); m_CloudThickness = Unpack(o.Find(x => x.cloudThickness)); m_DensityMultiplier = Unpack(o.Find(x => x.densityMultiplier)); m_ShapeFactor = Unpack(o.Find(x => x.shapeFactor)); m_ShapeScale = Unpack(o.Find(x => x.shapeScale)); m_ErosionFactor = Unpack(o.Find(x => x.erosionFactor)); m_ErosionScale = Unpack(o.Find(x => x.erosionScale)); // Lighting m_ScatteringTint = Unpack(o.Find(x => x.scatteringTint)); m_PowderEffectIntensity = Unpack(o.Find(x => x.powderEffectIntensity)); m_MultiScattering = Unpack(o.Find(x => x.multiScattering)); m_AmbientLightProbeDimmer = Unpack(o.Find(x => x.ambientLightProbeDimmer)); // Wind m_GlobalWindSpeed = Unpack(o.Find(x => x.globalWindSpeed)); m_Orientation = Unpack(o.Find(x => x.orientation)); m_CloudMapSpeedMultiplier = Unpack(o.Find(x => x.cloudMapSpeedMultiplier)); m_ShapeSpeedMultiplier = Unpack(o.Find(x => x.shapeSpeedMultiplier)); m_ErosionSpeedMultiplier = Unpack(o.Find(x => x.erosionSpeedMultiplier)); // Quality m_TemporalAccumulationFactor = Unpack(o.Find(x => x.temporalAccumulationFactor)); m_NumPrimarySteps = Unpack(o.Find(x => x.numPrimarySteps)); m_NumLightSteps = Unpack(o.Find(x => x.numLightSteps)); // Shadows m_Shadows = Unpack(o.Find(x => x.shadows)); m_ShadowResolution = Unpack(o.Find(x => x.shadowResolution)); m_ShadowDistance = Unpack(o.Find(x => x.shadowDistance)); m_ShadowPlaneHeightOffset = Unpack(o.Find(x => x.shadowPlaneHeightOffset)); m_ShadowOpacity = Unpack(o.Find(x => x.shadowOpacity)); m_ShadowOpacityFallback = Unpack(o.Find(x => x.shadowOpacityFallback)); }
public override void OnEnable() { var o = new PropertyFetcher <Tonemapping>(serializedObject); m_Mode = Unpack(o.Find(x => x.mode)); }
void OnEnable() { // Get & automatically add additional HD data if not present var lightData = GetAdditionalData <ClusterAdditionalLightData>(); var shadowData = GetAdditionalData <AdditionalShadowData>(); var cachedShadowData = GetAdditionalData <CachedShadowData>(); m_SerializedAdditionalLightData = new SerializedObject(lightData); m_SerializedAdditionalShadowData = new SerializedObject(shadowData); m_SerializedCachedShadowData = new SerializedObject(cachedShadowData); m_BaseData = new SerializedBaseData { type = serializedObject.FindProperty("m_Type"), range = serializedObject.FindProperty("m_Range"), spotAngle = serializedObject.FindProperty("m_SpotAngle"), cookie = serializedObject.FindProperty("m_Cookie"), cookieSize = serializedObject.FindProperty("m_CookieSize"), color = serializedObject.FindProperty("m_Color"), intensity = serializedObject.FindProperty("m_Intensity"), bounceIntensity = serializedObject.FindProperty("m_BounceIntensity"), colorTemperature = serializedObject.FindProperty("m_ColorTemperature"), useColorTemperature = serializedObject.FindProperty("m_UseColorTemperature"), shadowsType = serializedObject.FindProperty("m_Shadows.m_Type"), shadowsBias = serializedObject.FindProperty("m_Shadows.m_Bias"), shadowsNormalBias = serializedObject.FindProperty("m_Shadows.m_NormalBias"), shadowsNearPlane = serializedObject.FindProperty("m_Shadows.m_NearPlane"), lightmapping = serializedObject.FindProperty("m_Lightmapping"), areaSizeX = serializedObject.FindProperty("m_AreaSize.x"), areaSizeY = serializedObject.FindProperty("m_AreaSize.y"), bakedShadowRadius = serializedObject.FindProperty("m_ShadowRadius"), bakedShadowAngle = serializedObject.FindProperty("m_ShadowAngle") }; using (var o = new PropertyFetcher <ClusterAdditionalLightData>(m_SerializedAdditionalLightData)) m_AdditionalLightData = new SerializedLightData { spotInnerPercent = o.Find(x => x.m_InnerSpotPercent), lightDimmer = o.Find(x => x.lightDimmer), fadeDistance = o.Find(x => x.fadeDistance), affectDiffuse = o.Find(x => x.affectDiffuse), affectSpecular = o.Find(x => x.affectSpecular), lightTypeExtent = o.Find(x => x.lightTypeExtent), spotLightShape = o.Find(x => x.spotLightShape), shapeLength = o.Find(x => x.shapeLength), shapeWidth = o.Find(x => x.shapeWidth), aspectRatio = o.Find(x => x.aspectRatio), shapeRadius = o.Find(x => x.shapeRadius), maxSmoothness = o.Find(x => x.maxSmoothness), applyRangeAttenuation = o.Find(x => x.applyRangeAttenuation), // Editor stuff useOldInspector = o.Find(x => x.useOldInspector), showFeatures = o.Find(x => x.featuresFoldout), showAdditionalSettings = o.Find(x => x.showAdditionalSettings) }; // TODO: Review this once AdditionalShadowData is refactored using (var o = new PropertyFetcher <AdditionalShadowData>(m_SerializedAdditionalShadowData)) m_ShadowData = new SerializedShadowData { dimmer = o.Find(x => x.shadowDimmer), fadeDistance = o.Find(x => x.shadowFadeDistance), cascadeCount = o.Find("shadowCascadeCount"), cascadeRatios = o.Find("shadowCascadeRatios"), cascadeBorders = o.Find("shadowCascadeBorders"), resolution = o.Find(x => x.shadowResolution) }; using (var o = new PropertyFetcher <CachedShadowData>(m_SerializedCachedShadowData)) m_CachedShadowData = new SerializedCachedShadowData { shadowUpdateType = o.Find(x => x.shadowUpdateType), useStaticShadowmapForLastCascade = o.Find(x => x.UseStaticShadowmapForLastCascade), needUpdateStaticShadowmapForLastCascade = o.Find(x => x.NeedUpdateStaticShadowmapForLastCascade), staticShadowmapResolution = o.Find(x => x.StaticShadowResolution), depthFallOffPercent = o.Find(x => x.DepthFallOffPercent), shadowNearMultiplier = o.Find(x => x.ShadowNearMultiplier), shadowFarMulitplier = o.Find(x => x.ShadowFarMultiplier), staticShadowmapInfo = o.Find(x => x.cachedShadowInfo), affectVolumetric = o.Find(x => x.AffectVolumectricFog) }; }
public override void OnEnable() { base.OnEnable(); m_CommonUIElementsMask = (uint)SkySettingsUIElement.UpdateMode; var o = new PropertyFetcher <ExpanseSky>(serializedObject); atmosphereThickness = Unpack(o.Find(x => x.atmosphereThickness)); planetRadius = Unpack(o.Find(x => x.planetRadius)); groundAlbedoTexture = Unpack(o.Find(x => x.groundAlbedoTexture)); groundTint = Unpack(o.Find(x => x.groundTint)); groundEmissionTexture = Unpack(o.Find(x => x.groundEmissionTexture)); groundEmissionMultiplier = Unpack(o.Find(x => x.groundEmissionMultiplier)); planetRotation = Unpack(o.Find(x => x.planetRotation)); /* Night sky. */ nightSkyTexture = Unpack(o.Find(x => x.nightSkyTexture)); nightSkyRotation = Unpack(o.Find(x => x.nightSkyRotation)); nightTint = Unpack(o.Find(x => x.nightTint)); nightIntensity = Unpack(o.Find(x => x.nightIntensity)); lightPollutionTint = Unpack(o.Find(x => x.lightPollutionTint)); lightPollutionIntensity = Unpack(o.Find(x => x.lightPollutionIntensity)); /* Aerosols. */ aerosolCoefficient = Unpack(o.Find(x => x.aerosolCoefficient)); scaleHeightAerosols = Unpack(o.Find(x => x.scaleHeightAerosols)); aerosolAnisotropy = Unpack(o.Find(x => x.aerosolAnisotropy)); aerosolDensity = Unpack(o.Find(x => x.aerosolDensity)); /* Air. */ airCoefficients = Unpack(o.Find(x => x.airCoefficients)); scaleHeightAir = Unpack(o.Find(x => x.scaleHeightAir)); airDensity = Unpack(o.Find(x => x.airDensity)); /* Ozone. */ ozoneCoefficients = Unpack(o.Find(x => x.ozoneCoefficients)); ozoneThickness = Unpack(o.Find(x => x.ozoneThickness)); ozoneHeight = Unpack(o.Find(x => x.ozoneHeight)); ozoneDensity = Unpack(o.Find(x => x.ozoneDensity)); /* Height fog. */ heightFogCoefficients = Unpack(o.Find(x => x.heightFogCoefficients)); scaleHeightHeightFog = Unpack(o.Find(x => x.scaleHeightHeightFog)); heightFogAnisotropy = Unpack(o.Find(x => x.heightFogAnisotropy)); heightFogDensity = Unpack(o.Find(x => x.heightFogDensity)); heightFogAttenuationDistance = Unpack(o.Find(x => x.heightFogAttenuationDistance)); heightFogAttenuationBias = Unpack(o.Find(x => x.heightFogAttenuationBias)); heightFogTint = Unpack(o.Find(x => x.heightFogTint)); /* Artistic Overrides. */ skyTint = Unpack(o.Find(x => x.skyTint)); multipleScatteringMultiplier = Unpack(o.Find(x => x.multipleScatteringMultiplier)); /* Body 1. */ body1LimbDarkening = Unpack(o.Find(x => x.body1LimbDarkening)); body1ReceivesLight = Unpack(o.Find(x => x.body1ReceivesLight)); body1AlbedoTexture = Unpack(o.Find(x => x.body1AlbedoTexture)); body1Emissive = Unpack(o.Find(x => x.body1Emissive)); body1EmissionTexture = Unpack(o.Find(x => x.body1EmissionTexture)); body1Rotation = Unpack(o.Find(x => x.body1Rotation)); /* Body 2. */ body2LimbDarkening = Unpack(o.Find(x => x.body2LimbDarkening)); body2ReceivesLight = Unpack(o.Find(x => x.body2ReceivesLight)); body2AlbedoTexture = Unpack(o.Find(x => x.body2AlbedoTexture)); body2Emissive = Unpack(o.Find(x => x.body2Emissive)); body2EmissionTexture = Unpack(o.Find(x => x.body2EmissionTexture)); body2Rotation = Unpack(o.Find(x => x.body2Rotation)); /* Body 3. */ body3LimbDarkening = Unpack(o.Find(x => x.body3LimbDarkening)); body3ReceivesLight = Unpack(o.Find(x => x.body3ReceivesLight)); body3AlbedoTexture = Unpack(o.Find(x => x.body3AlbedoTexture)); body3Emissive = Unpack(o.Find(x => x.body3Emissive)); body3EmissionTexture = Unpack(o.Find(x => x.body3EmissionTexture)); body3Rotation = Unpack(o.Find(x => x.body3Rotation)); /* Body 4. */ body4LimbDarkening = Unpack(o.Find(x => x.body4LimbDarkening)); body4ReceivesLight = Unpack(o.Find(x => x.body4ReceivesLight)); body4AlbedoTexture = Unpack(o.Find(x => x.body4AlbedoTexture)); body4Emissive = Unpack(o.Find(x => x.body4Emissive)); body4EmissionTexture = Unpack(o.Find(x => x.body4EmissionTexture)); body4Rotation = Unpack(o.Find(x => x.body4Rotation)); /* Sampling and Rendering. */ numberOfTransmittanceSamples = Unpack(o.Find(x => x.numberOfTransmittanceSamples)); numberOfLightPollutionSamples = Unpack(o.Find(x => x.numberOfLightPollutionSamples)); numberOfScatteringSamples = Unpack(o.Find(x => x.numberOfScatteringSamples)); numberOfGroundIrradianceSamples = Unpack(o.Find(x => x.numberOfGroundIrradianceSamples)); numberOfMultipleScatteringSamples = Unpack(o.Find(x => x.numberOfMultipleScatteringSamples)); numberOfMultipleScatteringAccumulationSamples = Unpack(o.Find(x => x.numberOfMultipleScatteringAccumulationSamples)); useImportanceSampling = Unpack(o.Find(x => x.useImportanceSampling)); useAntiAliasing = Unpack(o.Find(x => x.useAntiAliasing)); ditherAmount = Unpack(o.Find(x => x.ditherAmount)); /* Clouds. */ cloudDensity = Unpack(o.Find(x => x.cloudDensity)); cloudForwardScattering = Unpack(o.Find(x => x.cloudForwardScattering)); cloudSilverSpread = Unpack(o.Find(x => x.cloudSilverSpread)); numCloudTransmittanceSamples = Unpack(o.Find(x => x.numCloudTransmittanceSamples)); numCloudSSSamples = Unpack(o.Find(x => x.numCloudSSSamples)); cloudCoarseMarchStepSize = Unpack(o.Find(x => x.cloudCoarseMarchStepSize)); cloudDetailMarchStepSize = Unpack(o.Find(x => x.cloudDetailMarchStepSize)); cloudVolumeLowerRadialBoundary = Unpack(o.Find(x => x.cloudVolumeLowerRadialBoundary)); cloudVolumeUpperRadialBoundary = Unpack(o.Find(x => x.cloudVolumeUpperRadialBoundary)); cloudTextureAngularRange = Unpack(o.Find(x => x.cloudTextureAngularRange)); cloudFalloffRadius = Unpack(o.Find(x => x.cloudFalloffRadius)); cloudUOffset = Unpack(o.Find(x => x.cloudUOffset)); cloudVOffset = Unpack(o.Find(x => x.cloudVOffset)); cloudWOffset = Unpack(o.Find(x => x.cloudWOffset)); structureNoiseBlendFactor = Unpack(o.Find(x => x.structureNoiseBlendFactor)); detailNoiseBlendFactor = Unpack(o.Find(x => x.detailNoiseBlendFactor)); basePerlinOctaves = Unpack(o.Find(x => x.basePerlinOctaves)); basePerlinOffset = Unpack(o.Find(x => x.basePerlinOffset)); basePerlinScaleFactor = Unpack(o.Find(x => x.basePerlinScaleFactor)); baseWorleyOctaves = Unpack(o.Find(x => x.baseWorleyOctaves)); baseWorleyScaleFactor = Unpack(o.Find(x => x.baseWorleyScaleFactor)); structureOctaves = Unpack(o.Find(x => x.structureOctaves)); structureScaleFactor = Unpack(o.Find(x => x.structureScaleFactor)); detailOctaves = Unpack(o.Find(x => x.detailOctaves)); detailScaleFactor = Unpack(o.Find(x => x.detailScaleFactor)); /* Clouds geometry. */ cloudVolumeLowerRadialBoundary = Unpack(o.Find(x => x.cloudVolumeLowerRadialBoundary)); cloudVolumeUpperRadialBoundary = Unpack(o.Find(x => x.cloudVolumeUpperRadialBoundary)); cloudTextureAngularRange = Unpack(o.Find(x => x.cloudTextureAngularRange)); cloudUOffset = Unpack(o.Find(x => x.cloudUOffset)); cloudVOffset = Unpack(o.Find(x => x.cloudVOffset)); cloudWOffset = Unpack(o.Find(x => x.cloudWOffset)); /* Clouds lighting. */ cloudDensity = Unpack(o.Find(x => x.cloudDensity)); cloudFalloffRadius = Unpack(o.Find(x => x.cloudFalloffRadius)); densityAttenuationThreshold = Unpack(o.Find(x => x.densityAttenuationThreshold)); densityAttenuationMultiplier = Unpack(o.Find(x => x.densityAttenuationMultiplier)); cloudForwardScattering = Unpack(o.Find(x => x.cloudForwardScattering)); cloudSilverSpread = Unpack(o.Find(x => x.cloudSilverSpread)); silverIntensity = Unpack(o.Find(x => x.silverIntensity)); depthProbabilityOffset = Unpack(o.Find(x => x.depthProbabilityOffset)); depthProbabilityMin = Unpack(o.Find(x => x.depthProbabilityMin)); depthProbabilityMax = Unpack(o.Find(x => x.depthProbabilityMax)); atmosphericBlendDistance = Unpack(o.Find(x => x.atmosphericBlendDistance)); atmosphericBlendBias = Unpack(o.Find(x => x.atmosphericBlendBias)); /* Clouds sampling. */ numCloudTransmittanceSamples = Unpack(o.Find(x => x.numCloudTransmittanceSamples)); numCloudSSSamples = Unpack(o.Find(x => x.numCloudSSSamples)); cloudCoarseMarchStepSize = Unpack(o.Find(x => x.cloudCoarseMarchStepSize)); cloudDetailMarchStepSize = Unpack(o.Find(x => x.cloudDetailMarchStepSize)); numZeroStepsBeforeCoarseMarch = Unpack(o.Find(x => x.numZeroStepsBeforeCoarseMarch)); /* Clouds noise. */ basePerlinOctaves = Unpack(o.Find(x => x.basePerlinOctaves)); basePerlinOffset = Unpack(o.Find(x => x.basePerlinOffset)); basePerlinScaleFactor = Unpack(o.Find(x => x.basePerlinScaleFactor)); baseWorleyOctaves = Unpack(o.Find(x => x.baseWorleyOctaves)); baseWorleyScaleFactor = Unpack(o.Find(x => x.baseWorleyScaleFactor)); baseWorleyBlendFactor = Unpack(o.Find(x => x.baseWorleyBlendFactor)); structureOctaves = Unpack(o.Find(x => x.structureOctaves)); structureScaleFactor = Unpack(o.Find(x => x.structureScaleFactor)); structureNoiseBlendFactor = Unpack(o.Find(x => x.structureNoiseBlendFactor)); detailOctaves = Unpack(o.Find(x => x.detailOctaves)); detailScaleFactor = Unpack(o.Find(x => x.detailScaleFactor)); detailNoiseBlendFactor = Unpack(o.Find(x => x.detailNoiseBlendFactor)); detailNoiseTile = Unpack(o.Find(x => x.detailNoiseTile)); heightGradientLowStart = Unpack(o.Find(x => x.heightGradientLowStart)); heightGradientLowEnd = Unpack(o.Find(x => x.heightGradientLowEnd)); heightGradientHighStart = Unpack(o.Find(x => x.heightGradientHighStart)); heightGradientHighEnd = Unpack(o.Find(x => x.heightGradientHighEnd)); coverageOctaves = Unpack(o.Find(x => x.coverageOctaves)); coverageOffset = Unpack(o.Find(x => x.coverageOffset)); coverageScaleFactor = Unpack(o.Find(x => x.coverageScaleFactor)); coverageBlendFactor = Unpack(o.Find(x => x.coverageBlendFactor)); /* Clouds debug. */ cloudsDebug = Unpack(o.Find(x => x.cloudsDebug)); }
private static void ConfigureExceptionTelemetry(DependencyTelemetry telemetry, Exception exception, PropertyFetcher numberFetcher) { telemetry.Success = false; telemetry.Properties["Exception"] = exception.ToInvariantString(); try { var exceptionNumber = (int)numberFetcher.Fetch(exception); telemetry.ResultCode = exceptionNumber.ToString(CultureInfo.InvariantCulture); } catch (Exception) { // Ignore as it simply indicate exception was not a SqlException } }
public SerializedHDLight(HDAdditionalLightData[] lightDatas, LightEditor.Settings settings) { serializedLightDatas = new SerializedObject(lightDatas); this.settings = settings; using (var o = new PropertyFetcher <HDAdditionalLightData>(serializedLightDatas)) serializedLightData = new SerializedLightData { intensity = o.Find("m_Intensity"), enableSpotReflector = o.Find("m_EnableSpotReflector"), luxAtDistance = o.Find("m_LuxAtDistance"), spotInnerPercent = o.Find("m_InnerSpotPercent"), lightDimmer = o.Find("m_LightDimmer"), volumetricDimmer = o.Find("m_VolumetricDimmer"), lightUnit = o.Find("m_LightUnit"), displayAreaLightEmissiveMesh = o.Find("m_DisplayAreaLightEmissiveMesh"), fadeDistance = o.Find("m_FadeDistance"), affectDiffuse = o.Find("m_AffectDiffuse"), affectSpecular = o.Find("m_AffectSpecular"), nonLightmappedOnly = o.Find("m_NonLightmappedOnly"), lightTypeExtent = o.Find("m_LightTypeExtent"), spotLightShape = o.Find("m_SpotLightShape"), // WTF? shapeWidth = o.Find("m_ShapeWidth"), shapeHeight = o.Find("m_ShapeHeight"), aspectRatio = o.Find("m_AspectRatio"), shapeRadius = o.Find("m_ShapeRadius"), maxSmoothness = o.Find("m_MaxSmoothness"), applyRangeAttenuation = o.Find("m_ApplyRangeAttenuation"), shadowNearPlane = o.Find("m_ShadowNearPlane"), shadowSoftness = o.Find("m_ShadowSoftness"), blockerSampleCount = o.Find("m_BlockerSampleCount"), filterSampleCount = o.Find("m_FilterSampleCount"), minFilterSize = o.Find("m_MinFilterSize"), areaLightCookie = o.Find("m_AreaLightCookie"), areaLightShadowCone = o.Find("m_AreaLightShadowCone"), useCustomSpotLightShadowCone = o.Find("m_UseCustomSpotLightShadowCone"), customSpotLightShadowCone = o.Find("m_CustomSpotLightShadowCone"), useScreenSpaceShadows = o.Find("m_UseScreenSpaceShadows"), interactsWithSky = o.Find("m_InteractsWithSky"), angularDiameter = o.Find("m_AngularDiameter"), distance = o.Find("m_Distance"), #if ENABLE_RAYTRACING useRayTracedShadows = o.Find("m_UseRayTracedShadows"), numRayTracingSamples = o.Find("m_NumRayTracingSamples"), filterTracedShadow = o.Find("m_FilterTracedShadow"), filterSizeTraced = o.Find("m_FilterSizeTraced"), sunLightConeAngle = o.Find("m_SunLightConeAngle"), lightShadowRadius = o.Find("m_LightShadowRadius"), #endif evsmExponent = o.Find("m_EvsmExponent"), evsmVarianceBias = o.Find("m_EvsmVarianceBias"), evsmLightLeakBias = o.Find("m_EvsmLightLeakBias"), evsmBlurPasses = o.Find("m_EvsmBlurPasses"), // Moment light lightAngle = o.Find("m_LightAngle"), kernelSize = o.Find("m_KernelSize"), maxDepthBias = o.Find("m_MaxDepthBias"), // Editor stuff useOldInspector = o.Find("useOldInspector"), showFeatures = o.Find("featuresFoldout"), showAdditionalSettings = o.Find("showAdditionalSettings"), useVolumetric = o.Find("useVolumetric"), renderingLayerMask = settings.renderingLayerMask, // Layers linkLightLayers = o.Find("m_LinkShadowLayers"), lightlayersMask = o.Find("m_LightlayersMask"), // Shadow datas: shadowDimmer = o.Find("m_ShadowDimmer"), volumetricShadowDimmer = o.Find("m_VolumetricShadowDimmer"), shadowFadeDistance = o.Find("m_ShadowFadeDistance"), useShadowQualitySettings = o.Find("m_UseShadowQualitySettings"), customResolution = o.Find("m_CustomShadowResolution"), shadowResolutionTier = o.Find("m_ShadowResolutionTier"), contactShadows = o.Find("m_ContactShadows"), shadowTint = o.Find("m_ShadowTint"), shadowUpdateMode = o.Find("m_ShadowUpdateMode"), constantBias = o.Find("m_ConstantBias"), normalBias = o.Find("m_NormalBias"), }; }
public override void OnEnable() { var o = new PropertyFetcher <ScreenSpaceRefraction>(serializedObject); m_ScreenFadeDistance = Unpack(o.Find(x => x.screenFadeDistance)); }