public override void OnEnable()
        {
            var o = new PropertyFetcher <IndirectLightingController>(serializedObject);

            m_IndirectSpecularIntensity = Unpack(o.Find(x => x.indirectSpecularIntensity));
            m_IndirectDiffuseIntensity  = Unpack(o.Find(x => x.indirectDiffuseIntensity));
        }
        /// <summary>
        /// This utility can be used to copy a value into a volume component setting visible in the inspector.
        /// </summary>
        protected void CopySetting <T>(ref SerializedDataParameter setting, T value) where T : struct
        {
            setting.value.SetInline(value);

            // Force enable the override state to match the state of the quality setting.
            setting.overrideState.boolValue = m_QualitySetting.overrideState.boolValue;
        }
        public override void OnEnable()
        {
            base.OnEnable();

            var o = new PropertyFetcher <ScreenSpaceReflection>(serializedObject);

            m_RayTracing = Unpack(o.Find(x => x.rayTracing));

            // Shared data
            m_MinSmoothness       = Unpack(o.Find(x => x.minSmoothness));
            m_SmoothnessFadeStart = Unpack(o.Find(x => x.smoothnessFadeStart));
            m_ReflectSky          = Unpack(o.Find(x => x.reflectSky));

            // SSR Data
            m_DepthBufferThickness = Unpack(o.Find(x => x.depthBufferThickness));
            m_RayMaxIterations     = Unpack(o.Find(x => x.rayMaxIterations));
            m_ScreenFadeDistance   = Unpack(o.Find(x => x.screenFadeDistance));

            // Generic ray tracing
            m_LayerMask      = Unpack(o.Find(x => x.layerMask));
            m_RayLength      = Unpack(o.Find(x => x.rayLength));
            m_ClampValue     = Unpack(o.Find(x => x.clampValue));
            m_Denoise        = Unpack(o.Find(x => x.denoise));
            m_DenoiserRadius = Unpack(o.Find(x => x.denoiserRadius));

            // Tier 1
            m_UpscaleRadius  = Unpack(o.Find(x => x.upscaleRadius));
            m_FullResolution = Unpack(o.Find(x => x.fullResolution));
            m_DeferredMode   = Unpack(o.Find(x => x.deferredMode));
            m_RayBinning     = Unpack(o.Find(x => x.rayBinning));

            // Tier 2
            m_SampleCount = Unpack(o.Find(x => x.sampleCount));
            m_BounceCount = Unpack(o.Find(x => x.bounceCount));
        }
示例#4
0
        public override void OnEnable()
        {
            var o = new PropertyFetcher <ColorLookup>(serializedObject);

            m_Texture      = Unpack(o.Find(x => x.texture));
            m_Contribution = Unpack(o.Find(x => x.contribution));
        }
        public override void OnEnable()
        {
            base.OnEnable();

            var o = new PropertyFetcher <AmbientOcclusion>(serializedObject);

            m_Intensity             = Unpack(o.Find(x => x.intensity));
            m_StepCount             = Unpack(o.Find("m_StepCount"));
            m_Radius                = Unpack(o.Find(x => x.radius));
            m_FullResolution        = Unpack(o.Find("m_FullResolution"));
            m_MaximumRadiusInPixels = Unpack(o.Find("m_MaximumRadiusInPixels"));

            m_TemporalAccumulation   = Unpack(o.Find(x => x.temporalAccumulation));
            m_DirectionCount         = Unpack(o.Find("m_DirectionCount"));
            m_BlurSharpness          = Unpack(o.Find(x => x.blurSharpness));
            m_DirectLightingStrength = Unpack(o.Find(x => x.directLightingStrength));
            m_GhostingAdjustement    = Unpack(o.Find(x => x.ghostingReduction));
            m_BilateralUpsample      = Unpack(o.Find("m_BilateralUpsample"));

            m_RayTracing     = Unpack(o.Find(x => x.rayTracing));
            m_LayerMask      = Unpack(o.Find(x => x.layerMask));
            m_RayLength      = Unpack(o.Find(x => x.rayLength));
            m_Denoise        = Unpack(o.Find(x => x.denoise));
            m_SampleCount    = Unpack(o.Find(x => x.sampleCount));
            m_DenoiserRadius = Unpack(o.Find(x => x.denoiserRadius));
        }
示例#6
0
        public override bool OnGUI(SerializedDataParameter parameter, GUIContent title)
        {
            var value = parameter.value;

            if (value.propertyType != SerializedPropertyType.Float)
            {
                return(false);
            }

            var   o               = parameter.GetObjectRef <CascadeEndBorderParameter>();
            float max             = o.normalized ? 100f : o.representationDistance;
            float modifiableValue = value.floatValue * max;

            EditorGUI.BeginChangeCheck();
            var lineRect = EditorGUILayout.GetControlRect();

            EditorGUI.BeginProperty(lineRect, title, value);
            modifiableValue = EditorGUI.Slider(lineRect, title, modifiableValue, 0f, max);
            EditorGUI.EndProperty();
            if (EditorGUI.EndChangeCheck())
            {
                value.floatValue = Mathf.Clamp01(modifiableValue / max);
            }
            return(true);
        }
        public override void OnEnable()
        {
            var o = new PropertyFetcher <GlobalIllumination>(serializedObject);

            m_Enable = Unpack(o.Find(x => x.enable));

            // SSGI Parameters
            m_FullResolutionSS     = Unpack(o.Find(x => x.fullResolutionSS));
            m_DepthBufferThickness = Unpack(o.Find(x => x.depthBufferThickness));
            m_RaySteps             = Unpack(o.Find(x => x.raySteps));
            m_FilterRadius         = Unpack(o.Find(x => x.filterRadius));

            // Ray Tracing shared parameters
            m_RayTracing = Unpack(o.Find(x => x.rayTracing));
            m_LayerMask  = Unpack(o.Find(x => x.layerMask));
            m_RayLength  = Unpack(o.Find(x => x.rayLength));
            m_ClampValue = Unpack(o.Find(x => x.clampValue));
            m_Mode       = Unpack(o.Find(x => x.mode));

            // Performance
            m_FullResolution = Unpack(o.Find(x => x.fullResolution));
            m_UpscaleRadius  = Unpack(o.Find(x => x.upscaleRadius));

            // Quality
            m_SampleCount = Unpack(o.Find(x => x.sampleCount));
            m_BounceCount = Unpack(o.Find(x => x.bounceCount));

            // Filtering
            m_Denoise = Unpack(o.Find(x => x.denoise));
            m_HalfResolutionDenoiser = Unpack(o.Find(x => x.halfResolutionDenoiser));
            m_DenoiserRadius         = Unpack(o.Find(x => x.denoiserRadius));
            m_SecondDenoiserPass     = Unpack(o.Find(x => x.secondDenoiserPass));

            base.OnEnable();
        }
        public override void OnEnable()
        {
            base.OnEnable();

            m_CommonUIElementsMask = (uint)SkySettingsUIElement.UpdateMode
                                     | (uint)SkySettingsUIElement.Exposure
                                     | (uint)SkySettingsUIElement.Multiplier
                                     | (uint)SkySettingsUIElement.IncludeSunInBaking;

            var o = new PropertyFetcher <PhysicallyBasedSky>(serializedObject);

            m_PlanetaryRadius        = Unpack(o.Find(x => x.planetaryRadius));
            m_PlanetCenterPosition   = Unpack(o.Find(x => x.planetCenterPosition));
            m_AirAttenuationDistance = Unpack(o.Find(x => x.airOpacity));
            m_AirAlbedo                  = Unpack(o.Find(x => x.airAlbedo));
            m_AirMaximumAltitude         = Unpack(o.Find(x => x.airMaximumAltitude));
            m_AerosolAttenuationDistance = Unpack(o.Find(x => x.aerosolOpacity));
            m_AerosolAlbedo              = Unpack(o.Find(x => x.aerosolAlbedo));
            m_AerosolMaximumAltitude     = Unpack(o.Find(x => x.aerosolMaximumAltitude));
            m_AerosolAnisotropy          = Unpack(o.Find(x => x.aerosolAnisotropy));
            m_NumberOfBounces            = Unpack(o.Find(x => x.numberOfBounces));
            m_GroundColor                = Unpack(o.Find(x => x.groundColor));
            m_GroundAlbedoTexture        = Unpack(o.Find(x => x.groundAlbedoTexture));
            m_GroundEmissionTexture      = Unpack(o.Find(x => x.groundEmissionTexture));
            m_PlanetRotation             = Unpack(o.Find(x => x.planetRotation));
            m_SpaceEmissionTexture       = Unpack(o.Find(x => x.spaceEmissionTexture));
            m_SpaceRotation              = Unpack(o.Find(x => x.spaceRotation));
        }
示例#9
0
        public override void OnEnable()
        {
            var o = new PropertyFetcher <Fog>(serializedObject);

            m_Enabled        = Unpack(o.Find(x => x.enabled));
            m_MaxFogDistance = Unpack(o.Find(x => x.maxFogDistance));

            // Fog Color
            m_ColorMode                   = Unpack(o.Find(x => x.colorMode));
            m_Color                       = Unpack(o.Find(x => x.color));
            m_Tint                        = Unpack(o.Find(x => x.tint));
            m_MipFogNear                  = Unpack(o.Find(x => x.mipFogNear));
            m_MipFogFar                   = Unpack(o.Find(x => x.mipFogFar));
            m_MipFogMaxMip                = Unpack(o.Find(x => x.mipFogMaxMip));
            m_Albedo                      = Unpack(o.Find(x => x.albedo));
            m_MeanFreePath                = Unpack(o.Find(x => x.meanFreePath));
            m_BaseHeight                  = Unpack(o.Find(x => x.baseHeight));
            m_MaximumHeight               = Unpack(o.Find(x => x.maximumHeight));
            m_Anisotropy                  = Unpack(o.Find(x => x.anisotropy));
            m_GlobalLightProbeDimmer      = Unpack(o.Find(x => x.globalLightProbeDimmer));
            m_EnableVolumetricFog         = Unpack(o.Find(x => x.enableVolumetricFog));
            m_DepthExtent                 = Unpack(o.Find(x => x.depthExtent));
            m_SliceDistributionUniformity = Unpack(o.Find(x => x.sliceDistributionUniformity));
            m_FogControlMode              = Unpack(o.Find(x => x.fogControlMode));
            m_ScreenResolutionPercentage  = Unpack(o.Find(x => x.screenResolutionPercentage));
            m_VolumeSliceCount            = Unpack(o.Find(x => x.volumeSliceCount));
            m_VolumetricFogBudget         = Unpack(o.Find(x => x.volumetricFogBudget));
            m_ResolutionDepthRatio        = Unpack(o.Find(x => x.resolutionDepthRatio));
            m_DirectionalLightsOnly       = Unpack(o.Find(x => x.directionalLightsOnly));
            m_DenoisingMode               = Unpack(o.Find(x => x.denoisingMode));

            base.OnEnable();
        }
示例#10
0
        // TODO: See if this can be refactored into a custom VolumeParameterDrawer
        void DoExposurePropertyField(SerializedDataParameter exposureProperty)
        {
            using (new EditorGUILayout.HorizontalScope())
            {
                DrawOverrideCheckbox(exposureProperty);

                using (new EditorGUI.DisabledScope(!exposureProperty.overrideState.boolValue))
                {
                    using (new EditorGUILayout.VerticalScope())
                    {
                        EditorGUILayout.LabelField(exposureProperty.displayName);

                        var xOffset = EditorGUIUtility.labelWidth;

                        var lineRect = EditorGUILayout.GetControlRect();
                        lineRect.x     += xOffset;
                        lineRect.width -= xOffset;

                        var sliderRect = lineRect;
                        sliderRect.y -= EditorGUIUtility.singleLineHeight;
                        k_LightUnitSlider.SetSerializedObject(serializedObject);
                        k_LightUnitSlider.DrawExposureSlider(exposureProperty.value, sliderRect);

                        // GUIContent.none disables horizontal scrolling, use TrTextContent and adjust the rect to make it work.
                        lineRect.x     -= EditorGUIUtility.labelWidth + 2;
                        lineRect.y     += EditorGUIUtility.standardVerticalSpacing;
                        lineRect.width += EditorGUIUtility.labelWidth + 2;
                        EditorGUI.PropertyField(lineRect, exposureProperty.value, EditorGUIUtility.TrTextContent(" "));
                    }
                }
            }
        }
示例#11
0
        // TODO: See if this can be refactored into a custom VolumeParameterDrawer
        void DoExposurePropertyField(SerializedDataParameter exposureProperty)
        {
            using (var scope = new OverridablePropertyScope(exposureProperty, exposureProperty.displayName, this))
            {
                if (!scope.displayed)
                {
                    return;
                }

                using (new EditorGUILayout.VerticalScope())
                {
                    EditorGUILayout.LabelField(scope.label);

                    var xOffset = EditorGUIUtility.labelWidth + 2;

                    var lineRect = EditorGUILayout.GetControlRect();
                    lineRect.x     += xOffset;
                    lineRect.width -= xOffset;

                    var sliderRect = lineRect;
                    sliderRect.y -= EditorGUIUtility.singleLineHeight;
                    k_LightUnitSlider.SetSerializedObject(serializedObject);
                    k_LightUnitSlider.DrawExposureSlider(exposureProperty.value, sliderRect);

                    // GUIContent.none disables horizontal scrolling, use TrTextContent and adjust the rect to make it work.
                    lineRect.x     -= EditorGUIUtility.labelWidth + 2;
                    lineRect.y     += EditorGUIUtility.standardVerticalSpacing;
                    lineRect.width += EditorGUIUtility.labelWidth + 2;
                    EditorGUI.PropertyField(lineRect, exposureProperty.value, EditorGUIUtility.TrTextContent(" "));
                }
            }
        }
示例#12
0
        public override void OnEnable()
        {
            var o = new PropertyFetcher <DepthOfField>(serializedObject);

            m_FocusMode = Unpack(o.Find(x => x.focusMode));

            m_FocusDistance     = Unpack(o.Find(x => x.focusDistance));
            m_FocusDistanceMode = Unpack(o.Find(x => x.focusDistanceMode));

            m_NearFocusStart = Unpack(o.Find(x => x.nearFocusStart));
            m_NearFocusEnd   = Unpack(o.Find(x => x.nearFocusEnd));
            m_FarFocusStart  = Unpack(o.Find(x => x.farFocusStart));
            m_FarFocusEnd    = Unpack(o.Find(x => x.farFocusEnd));

            m_NearSampleCount = Unpack(o.Find("m_NearSampleCount"));
            m_NearMaxBlur     = Unpack(o.Find("m_NearMaxBlur"));
            m_FarSampleCount  = Unpack(o.Find("m_FarSampleCount"));
            m_FarMaxBlur      = Unpack(o.Find("m_FarMaxBlur"));

            m_HighQualityFiltering = Unpack(o.Find("m_HighQualityFiltering"));
            m_Resolution           = Unpack(o.Find("m_Resolution"));
            m_PhysicallyBased      = Unpack(o.Find("m_PhysicallyBased"));

            base.OnEnable();
        }
示例#13
0
        public override void OnEnable()
        {
            var o = new PropertyFetcher <SubSurfaceScattering>(serializedObject);

            m_RayTracing  = Unpack(o.Find(x => x.rayTracing));
            m_SampleCount = Unpack(o.Find(x => x.sampleCount));
        }
        public override void OnEnable()
        {
            var o = new PropertyFetcher <DiffusionProfileOverride>(serializedObject);

            m_Volume            = (m_Inspector.target as Volume);
            m_DiffusionProfiles = Unpack(o.Find(x => x.diffusionProfiles));
        }
示例#15
0
        public override void OnEnable()
        {
            base.OnEnable();

            var o = new PropertyFetcher <ScreenSpaceReflection>(serializedObject);

            m_MinSmoothness = Unpack(o.Find(x => x.minSmoothness));
        }
        public override void OnEnable()
        {
            base.OnEnable();

            var o = new PropertyFetcher <ScreenSpaceReflection>(serializedObject);

            m_DeferredProjectionModel = Unpack(o.Find(x => x.deferredProjectionModel));
        }
        public override void OnEnable()
        {
            base.OnEnable();
            var o = new PropertyFetcher <VisualEnvironment>(serializedObject);

            m_SkyType        = Unpack(o.Find(x => x.skyType));
            m_SkyAmbientMode = Unpack(o.Find(x => x.skyAmbientMode));
        }
        public override void OnEnable()
        {
            var o = new PropertyFetcher <RecursiveRendering>(serializedObject);

            m_Enable    = Unpack(o.Find(x => x.enable));
            m_MaxDepth  = Unpack(o.Find(x => x.maxDepth));
            m_RayLength = Unpack(o.Find(x => x.rayLength));
        }
示例#19
0
        public override void OnEnable()
        {
            var o = new PropertyFetcher <FogVolume>(serializedObject);

            m_Color       = Unpack(o.Find(x => x.color));
            m_DistanceMin = Unpack(o.Find(x => x.distanceMin));
            m_DistanceMax = Unpack(o.Find(x => x.distanceMax));
        }
        public override void OnEnable()
        {
            var o = new PropertyFetcher <LiftGammaGain>(serializedObject);

            m_Lift  = Unpack(o.Find(x => x.lift));
            m_Gamma = Unpack(o.Find(x => x.gamma));
            m_Gain  = Unpack(o.Find(x => x.gain));
        }
示例#21
0
        public override void OnEnable()
        {
            base.OnEnable();

            var o = new PropertyFetcher <HDRISky>(serializedObject);

            m_hdriSky = Unpack(o.Find(x => x.hdriSky));
        }
        public override void OnEnable()
        {
            var o = new PropertyFetcher <DiffusionProfileOverride>(serializedObject);

            m_Volume            = (m_Inspector.target as Volume);
            m_DiffusionProfiles = Unpack(o.Find(x => x.diffusionProfiles));
            var hdAsset = GraphicsSettings.renderPipelineAsset as HDRenderPipelineAsset;
        }
 // Attempts to fill a quality setting with its custom value and override state.
 public void TryLoad <T>(ref SerializedDataParameter setting) where T : struct
 {
     if (settings.TryGetValue(Hash(setting), out QualitySetting s))
     {
         setting.value.SetInline((T)s.value);
         setting.overrideState.boolValue = s.state;
     }
 }
        public override void OnEnable()
        {
            base.OnEnable();
            var o = new PropertyFetcher <LinearFog>(serializedObject);

            m_FogStart = Unpack(o.Find(x => x.fogStart));
            m_FogEnd   = Unpack(o.Find(x => x.fogEnd));
        }
示例#25
0
        public override void OnEnable()
        {
            base.OnEnable();

            var o = new PropertyFetcher <RayTracingSettings>(serializedObject);

            m_RayBias       = Unpack(o.Find(x => x.rayBias));
            m_ExtendCulling = Unpack(o.Find(x => x.extendCulling));
        }
        public override void OnEnable()
        {
            var o = new PropertyFetcher <FilmGrain>(serializedObject);

            m_Type      = Unpack(o.Find(x => x.type));
            m_Intensity = Unpack(o.Find(x => x.intensity));
            m_Response  = Unpack(o.Find(x => x.response));
            m_Texture   = Unpack(o.Find(x => x.texture));
        }
示例#27
0
        public override void OnEnable()
        {
            base.OnEnable();
            var o = new PropertyFetcher <VolumetricFog>(serializedObject);

            m_Albedo       = Unpack(o.Find(x => x.albedo));
            m_MeanFreePath = Unpack(o.Find(x => x.meanFreePath));
            m_Anisotropy   = Unpack(o.Find(x => x.anisotropy));
        }
        public override void OnEnable()
        {
            base.OnEnable();
            var o = new PropertyFetcher <ExponentialFog>(serializedObject);

            m_FogDistance          = Unpack(o.Find(x => x.fogDistance));
            m_FogBaseHeight        = Unpack(o.Find(x => x.fogBaseHeight));
            m_FogHeightAttenuation = Unpack(o.Find(x => x.fogHeightAttenuation));
        }
示例#29
0
        public override void OnEnable()
        {
            var o = new PropertyFetcher <MotionBlur>(serializedObject);

            m_Mode      = Unpack(o.Find(x => x.mode));
            m_Quality   = Unpack(o.Find(x => x.quality));
            m_Intensity = Unpack(o.Find(x => x.intensity));
            m_Clamp     = Unpack(o.Find(x => x.clamp));
        }
        public override void OnEnable()
        {
            var o = new PropertyFetcher <SkySettings>(serializedObject);

            m_SkyExposure     = Unpack(o.Find(x => x.exposure));
            m_SkyMultiplier   = Unpack(o.Find(x => x.multiplier));
            m_SkyRotation     = Unpack(o.Find(x => x.rotation));
            m_EnvUpdateMode   = Unpack(o.Find(x => x.updateMode));
            m_EnvUpdatePeriod = Unpack(o.Find(x => x.updatePeriod));
        }