internal void InitializeProfiles() { if (!SettingValues.profile.TryGetSettings(out chromaticAberrationLayer)) { chromaticAberrationLayer = SettingValues.profile.AddSettings <ChromaticAberration>(); } if (!SettingValues.profile.TryGetSettings(out grainLayer)) { grainLayer = SettingValues.profile.AddSettings <Grain>(); } if (!SettingValues.profile.TryGetSettings(out ambientOcclusionLayer)) { ambientOcclusionLayer = SettingValues.profile.AddSettings <AmbientOcclusion>(); } if (!SettingValues.profile.TryGetSettings(out autoExposureLayer)) { autoExposureLayer = SettingValues.profile.AddSettings <AutoExposure>(); } if (!SettingValues.profile.TryGetSettings(out bloomLayer)) { bloomLayer = SettingValues.profile.AddSettings <Bloom>(); } if (!SettingValues.profile.TryGetSettings(out colorGradingLayer)) { colorGradingLayer = SettingValues.profile.AddSettings <ColorGrading>(); } if (!SettingValues.profile.TryGetSettings(out depthOfFieldLayer)) { depthOfFieldLayer = SettingValues.profile.AddSettings <DepthOfField>(); } if (!SettingValues.profile.TryGetSettings(out screenSpaceReflectionsLayer)) { screenSpaceReflectionsLayer = SettingValues.profile.AddSettings <ScreenSpaceReflections>(); } if (!SettingValues.profile.TryGetSettings(out vignetteLayer)) { vignetteLayer = SettingValues.profile.AddSettings <Vignette>(); } if (!SettingValues.profile.TryGetSettings(out motionBlurLayer)) { motionBlurLayer = SettingValues.profile.AddSettings <MotionBlur>(); motionBlurLayer.enabled.value = false; } depthOfFieldLayer.enabled.value = false; // Make people use Depth of Field Manually }
private void Awake() { raycaster = GetComponent <GraphicRaycaster>(); postProcessVolume = Camera.main.GetComponent <PostProcessVolume>(); postProcessLayer = Camera.main.GetComponent <PostProcessLayer>(); autoExposure = postProcessVolume.profile.GetSetting <AutoExposure>(); bloom = postProcessVolume.profile.GetSetting <Bloom>(); vignette = postProcessVolume.profile.GetSetting <Vignette>(); ambientOcclusion = postProcessVolume.profile.GetSetting <AmbientOcclusion>(); }
void AutoExpose() { //get an editing object var autoval = AutoExposure.Get(rawImage.preview, Histo.PointsL); //add history object History.Add(new HistoryObject(EffectType.AutoExposure, EditionValue.GetCopy())); //apply it EditionValue.Copy(autoval); UpdatePreview(false); }
public override void OnPlayableDestroy(Playable playable) { m_FirstFrameHappened = false; m_FadeVolume.enabled = false; GameObject.DestroyImmediate(m_FadeVolume.gameObject); m_FadeVolume = null; GameObject.DestroyImmediate(m_Exposure); m_Exposure = null; }
public override void OnPlayableCreate(Playable playable) { base.OnPlayableCreate(playable); var layer = LayerMask.NameToLayer("PostProcess Volumes"); if (layer == -1) { GameDebug.LogWarning("Unable to find layer mask for camera fader"); } m_Exposure = ScriptableObject.CreateInstance <AutoExposure>(); m_Exposure.enabled.Override(true); m_Exposure.keyValue.Override(0); m_FadeVolume = PostProcessManager.instance.QuickVolume(layer, 100.0f, m_Exposure); }
public void Start() { LockCursor(); postProcessVolume = Camera.main.GetComponent <PostProcessVolume>(); postProcessLayer = Camera.main.GetComponent <PostProcessLayer>(); autoExposure = postProcessVolume.profile.GetSetting <AutoExposure>(); bloom = postProcessVolume.profile.GetSetting <Bloom>(); vignette = postProcessVolume.profile.GetSetting <Vignette>(); ambientOcclusion = postProcessVolume.profile.GetSetting <AmbientOcclusion>(); if (PlayerPrefs.GetInt("set_defaults", 1) == 1) { RestoreDefaults(); } Preferences.UpdatePreferences(); UpdateUIValues(); }
private void Awake() { this.Resolutions = new List <Resolution>(); foreach (var resolution in Screen.resolutions) { if (Mathf.Approximately((float)resolution.width / resolution.height, 16f / 9f)) { if (this.Resolutions.FindIndex(r => r.Equal(resolution)) < 0) { this.Resolutions.Add(resolution); } } } if (this.Exposure == null) { this.Exposure = this.PostProcess.GetSetting <AutoExposure>(); } }
private void renderAutoExposureSettings() { AutoExposure ae = TexturesUnlimitedFXLoader.INSTANCE.CurrentProfile.GetSettingsFor <AutoExposure>(); bool enabled = ae != null && ae.enabled; bool showProps = AddEffectHeader("Auto Exposure", ae); if (enabled && showProps) { AddVector2Parameter("Filtering", ae.filtering); AddFloatParameter("Min Luminance", ae.minLuminance, -9, 9); AddFloatParameter("Max Luminance", ae.maxLuminance, -9, 9); AddFloatParameter("Key Value", ae.keyValue, 0, 10); AddEnumParameter("Eye Adaption", ae.eyeAdaptation); AddFloatParameter("Speed Up", ae.speedUp, 0, 10); AddFloatParameter("Speed Down", ae.speedDown, 0, 10); } GUILayout.BeginHorizontal(); GUILayout.Label("---------------------------------------"); GUILayout.EndHorizontal(); }
private void getSettings() { post_layer = Camera.main.GetComponent <PostProcessLayer>(); if (post_layer == null) { if (Main.settings.DEBUG) { log("Null post layer"); } } if (post_layer.enabled == false) { post_layer.enabled = true; if (Main.settings.DEBUG) { log("post_layer was disabled"); } } post_volume = FindObjectOfType <PostProcessVolume>(); if (post_volume != null) { string not_found = ""; if ((GAME_AO = post_volume.profile.GetSetting <AmbientOcclusion>()) == null) { not_found += "ao,"; GAME_AO = post_volume.profile.AddSettings <AmbientOcclusion>(); GAME_AO.enabled.Override(false); } if ((GAME_EXPO = post_volume.profile.GetSetting <AutoExposure>()) == null) { not_found += "expo,"; GAME_EXPO = post_volume.profile.AddSettings <AutoExposure>(); GAME_EXPO.enabled.Override(false); } if ((GAME_BLOOM = post_volume.profile.GetSetting <Bloom>()) == null) { not_found += "bloom,"; GAME_BLOOM = post_volume.profile.AddSettings <Bloom>(); GAME_BLOOM.enabled.Override(false); } if ((GAME_CA = post_volume.profile.GetSetting <ChromaticAberration>()) == null) { not_found += "ca,"; GAME_CA = post_volume.profile.AddSettings <ChromaticAberration>(); GAME_CA.enabled.Override(false); } if ((GAME_COLOR = post_volume.profile.GetSetting <ColorGrading>()) == null) { not_found += "color,"; GAME_COLOR = post_volume.profile.AddSettings <ColorGrading>(); GAME_COLOR.enabled.Override(false); } if ((GAME_DOF = post_volume.profile.GetSetting <DepthOfField>()) == null) { not_found += "dof,"; GAME_DOF = post_volume.profile.AddSettings <DepthOfField>(); GAME_DOF.enabled.Override(false); } if ((GAME_GRAIN = post_volume.profile.GetSetting <Grain>()) == null) { not_found += "grain,"; GAME_GRAIN = post_volume.profile.AddSettings <Grain>(); GAME_GRAIN.enabled.Override(false); } if ((GAME_BLUR = post_volume.profile.GetSetting <MotionBlur>()) == null) { not_found += "blur,"; GAME_BLUR = post_volume.profile.AddSettings <MotionBlur>(); GAME_BLUR.enabled.Override(false); } if ((GAME_LENS = post_volume.profile.GetSetting <LensDistortion>()) == null) { not_found += "lens,"; GAME_LENS = post_volume.profile.AddSettings <LensDistortion>(); GAME_LENS.enabled.Override(false); } if ((GAME_REFL = post_volume.profile.GetSetting <ScreenSpaceReflections>()) == null) { not_found += "refl,"; GAME_REFL = post_volume.profile.AddSettings <ScreenSpaceReflections>(); GAME_REFL.enabled.Override(false); } if ((GAME_VIGN = post_volume.profile.GetSetting <Vignette>()) == null) { not_found += "vign,"; GAME_VIGN = post_volume.profile.AddSettings <Vignette>(); GAME_VIGN.enabled.Override(false); } if (not_found.Length > 0) { log("Not found: " + not_found); } } else { if (Main.settings.DEBUG) { log("Post_volume is null in getSettings"); } } GAME_FXAA = post_layer.fastApproximateAntialiasing; GAME_TAA = post_layer.temporalAntialiasing; GAME_SMAA = post_layer.subpixelMorphologicalAntialiasing; bool map_preset_enabled = false; if (Main.presets.ContainsKey(Main.map_name)) { map_preset_enabled = Main.presets[Main.map_name].enabled; } map_preset = new Preset(Main.map_name); map_preset.enabled = map_preset_enabled; UpdateMapPreset(map_preset); Main.presets[map_preset.name] = map_preset; if (!Main.settings.presetOrder.Contains(Main.map_name)) { Main.settings.presetOrder.Add(Main.map_name); } if (Main.settings.DEBUG) { log("Before applying"); } ApplySettings(); ApplyPresets(); if (Main.settings.DEBUG) { log("Before after"); } // After applying, can now save Main.canSave = true; Transform skater_transform = PlayerController.Instance.skaterController.transform; List <GameObject> toHide = new List <GameObject>(); List <string> toHide_names = new List <string>(new string[] { "Cory_fixed_Karam:cory_001:body_geo", "Cory_fixed_Karam:cory_001:eyes_geo", "Cory_fixed_Karam:cory_001:lacrima_geo", "Cory_fixed_Karam:cory_001:lashes_geo", "Cory_fixed_Karam:cory_001:tear_geo", "Cory_fixed_Karam:cory_001:teethDn_geo", "Cory_fixed_Karam:cory_001:teethUp_geo", "Cory_fixed_Karam:cory_001:hat_geo" }); for (int i = 0; i < skater_transform.childCount; i++) { var child = skater_transform.GetChild(i); //log("Child: " + child.name); for (int j = 0; j < child.childCount; j++) { var grandchild = child.GetChild(j); //log("Grand: " + grandchild.name); for (int k = 0; k < grandchild.childCount; k++) { var grandgrandchild = grandchild.GetChild(k); //log("Grandgrand: " + grandgrandchild.name); if (toHide_names.Contains(grandgrandchild.name)) { toHide.Add(grandgrandchild.gameObject); } } } } List <string> mat_names = new List <string>(new string[] { "UniqueShaders_head_mat (Instance)", "GenericShaders_eyeInner_mat (Instance)", "GenericShaders_eyeOuter_mat (Instance)", "GenericShaders_teeth_mat (Instance)", "UniqueShaders_hat_mat (Instance)", "GenericShaders_lacrima_mat (Instance)", "GenericShaders_lashes_mat (Instance)", "GenericShaders_tear_mat (Instance)" }); customCameraController.standard_shader = Shader.Find("Standard"); customCameraController.head_shader = Shader.Find("shaderStandard"); customCameraController.head_materials = new List <Material>(); foreach (var obj in toHide) { var materials = obj.GetComponent <SkinnedMeshRenderer>().materials; for (int k = 0; k < materials.Length; k++) { var mat = materials[k]; //log("Obj: " + obj.name + ", mat: " + mat.name); if (mat_names.Contains(mat.name)) { customCameraController.head_materials.Add(mat); } } } customCameraController.mainCamera = Camera.main; if (Main.settings.DEBUG) { log("Done getSettings"); } }
public override int GetHashCode() { int hash = 1; if (CameraDev.Length != 0) { hash ^= CameraDev.GetHashCode(); } if (FrameId.Length != 0) { hash ^= FrameId.GetHashCode(); } if (PixelFormat.Length != 0) { hash ^= PixelFormat.GetHashCode(); } if (IoMethod != 0) { hash ^= IoMethod.GetHashCode(); } if (Width != 0) { hash ^= Width.GetHashCode(); } if (Height != 0) { hash ^= Height.GetHashCode(); } if (FrameRate != 0) { hash ^= FrameRate.GetHashCode(); } if (Monochrome != false) { hash ^= Monochrome.GetHashCode(); } if (Brightness != 0) { hash ^= Brightness.GetHashCode(); } if (Contrast != 0) { hash ^= Contrast.GetHashCode(); } if (Saturation != 0) { hash ^= Saturation.GetHashCode(); } if (Sharpness != 0) { hash ^= Sharpness.GetHashCode(); } if (Gain != 0) { hash ^= Gain.GetHashCode(); } if (AutoFocus != false) { hash ^= AutoFocus.GetHashCode(); } if (Focus != 0) { hash ^= Focus.GetHashCode(); } if (AutoExposure != false) { hash ^= AutoExposure.GetHashCode(); } if (Exposure != 0) { hash ^= Exposure.GetHashCode(); } if (AutoWhiteBalance != false) { hash ^= AutoWhiteBalance.GetHashCode(); } if (WhiteBalance != 0) { hash ^= WhiteBalance.GetHashCode(); } if (BytesPerPixel != 0) { hash ^= BytesPerPixel.GetHashCode(); } if (TriggerInternal != 0) { hash ^= TriggerInternal.GetHashCode(); } if (TriggerFps != 0) { hash ^= TriggerFps.GetHashCode(); } if (ChannelName.Length != 0) { hash ^= ChannelName.GetHashCode(); } if (DeviceWaitMs != 0) { hash ^= DeviceWaitMs.GetHashCode(); } if (SpinRate != 0) { hash ^= SpinRate.GetHashCode(); } if (OutputType != 0) { hash ^= OutputType.GetHashCode(); } if (compressConf_ != null) { hash ^= CompressConf.GetHashCode(); } return(hash); }