protected override void OnEnable()
        {
            base.OnEnable();

            // Get & automatically add additional HD data if not present
            var lightData = CoreEditorUtils.GetAdditionalData<HDAdditionalLightData>(targets, HDAdditionalLightData.InitDefaultHDAdditionalLightData);
            var shadowData = CoreEditorUtils.GetAdditionalData<AdditionalShadowData>(targets, HDAdditionalShadowData.InitDefaultHDAdditionalShadowData);
            m_SerializedAdditionalLightData = new SerializedObject(lightData);
            m_SerializedAdditionalShadowData = new SerializedObject(shadowData);

            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),
                    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),

                    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)
                };
        }
Пример #2
0
        protected override void OnEnable()
        {
            base.OnEnable();

            // Get & automatically add additional HD data if not present
            var lightData  = CoreEditorUtils.GetAdditionalData <HDAdditionalLightData>(targets);
            var shadowData = CoreEditorUtils.GetAdditionalData <AdditionalShadowData>(targets);

            m_SerializedAdditionalLightData  = new SerializedObject(lightData);
            m_SerializedAdditionalShadowData = new SerializedObject(shadowData);

            using (var o = new PropertyFetcher <HDAdditionalLightData>(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),
                    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),
                    cascadeCount                     = o.Find("shadowCascadeCount"),
                    cascadeRatios                    = o.Find("shadowCascadeRatios"),
                    cascadeBorders                   = o.Find("shadowCascadeBorders"),
                    resolution                       = o.Find(x => x.shadowResolution),
                    enableContactShadows             = o.Find(x => x.enableContactShadows),
                    contactShadowLength              = o.Find(x => x.contactShadowLength),
                    contactShadowDistanceScaleFactor = o.Find(x => x.contactShadowDistanceScaleFactor),
                    contactShadowMaxDistance         = o.Find(x => x.contactShadowMaxDistance),
                    contactShadowFadeDistance        = o.Find(x => x.contactShadowFadeDistance),
                    contactShadowSampleCount         = o.Find(x => x.contactShadowSampleCount),
                };
        }
Пример #3
0
        void OnEnable()
        {
            // Get & automatically add additional HD data if not present
            var lightData  = GetAdditionalData <HDAdditionalLightData>();
            var shadowData = GetAdditionalData <AdditionalShadowData>();

            m_SerializedAdditionalLightData  = new SerializedObject(lightData);
            m_SerializedAdditionalShadowData = new SerializedObject(shadowData);

            // Grab all the serialized data we need
            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 <HDAdditionalLightData>(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_AdditionalShadowData = 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)
                };
        }
Пример #4
0
        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),
                    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),
                    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)
                };
        }
        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),
                    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)
                };

            // 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();
                    }
                }
            };
        }
Пример #6
0
        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),
                    areaLightCookie              = o.Find(x => x.areaLightCookie),
                    areaLightShadowCone          = o.Find(x => x.areaLightShadowCone),
                    useScreenSpaceShadows        = o.Find(x => x.useScreenSpaceShadows),
#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),
                    sunLightConeAngle    = o.Find(x => x.sunLightConeAngle),
#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),
                    shadowTint             = o.Find(x => x.shadowTint),

                    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)
                };
        }