void DrawOceanGUI() { OceanWhiteCaps oceanNode = Scatterer.Instance.planetsConfigsReader.scattererCelestialBodies [selectedPlanet].m_manager.GetOceanNode(); //GUItoggle("Toggle ocean", ref stockOcean); _scroll2 = GUILayout.BeginScrollView(_scroll2, false, true, GUILayout.Width(400), GUILayout.Height(Scatterer.Instance.pluginData.scrollSectionHeight + 100)); { oceanModularGUI.RenderGUI(); } GUILayout.EndScrollView(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Apply settings/Rebuild ocean")) { Scatterer.Instance.planetsConfigsReader.scattererCelestialBodies [selectedPlanet].m_manager.GetOceanNode().saveToConfigNode(); Scatterer.Instance.planetsConfigsReader.scattererCelestialBodies [selectedPlanet].m_manager.reBuildOcean(); buildOceanGUI(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Save ocean")) { Scatterer.Instance.planetsConfigsReader.scattererCelestialBodies [selectedPlanet].m_manager.GetOceanNode().saveToConfigNode(); } if (GUILayout.Button("Load ocean")) { Scatterer.Instance.planetsConfigsReader.scattererCelestialBodies [selectedPlanet].m_manager.GetOceanNode().loadFromConfigNode(); buildOceanGUI(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label(".cfg file used:"); GUILayout.TextField(Scatterer.Instance.planetsConfigsReader.scattererCelestialBodies [selectedPlanet].m_manager.GetOceanNode().configUrl.parent.url); GUILayout.EndHorizontal(); }
// Initialization public void Awake() { m_radius = parentCelestialBody.Radius; // print (m_radius); m_sunNode = new SunNode(); m_sunNode.Start(); m_skyNode = new SkyNode(); m_skyNode.setManager(this); m_skyNode.SetParentCelestialBody(parentCelestialBody); m_skyNode.setParentPlanetTransform(ParentPlanetTransform); // print ("skynode parent CB and PP set"); //m_skyNode.loadSettings (); m_skyNode.loadFromConfigNode(false); m_skyNode.Start(); //m_skyNode.loadFromConfigNode(false); //m_skyNode.loadFromConfigNode (); // print ("skynode started"); if (hasOcean && Core.Instance.useOceanShaders) { m_oceanNode = new OceanWhiteCaps(); m_oceanNode.setManager(this); m_oceanNode.setCore(Core.Instance); m_oceanNode.loadFromConfigNode(false); m_oceanNode.Start(); } }
// Initialization public void Awake() { managerState = "waking up"; m_radius = (float) parentCelestialBody.Radius; // print (m_radius); m_sunNode = new SunNode(); m_sunNode.Start(); m_skyNode = new SkyNode(); m_skyNode.setManager(this); m_skyNode.SetParentCelestialBody(parentCelestialBody); m_skyNode.setParentPlanetTransform(ParentPlanetTransform); // print ("skynode parent CB and PP set"); //m_skyNode.loadSettings (); m_skyNode.loadFromConfigNode(false); m_skyNode.Start(); //m_skyNode.loadFromConfigNode(false); //m_skyNode.loadFromConfigNode (); // print ("skynode started"); if (hasOcean) { m_oceanNode = new OceanWhiteCaps(); m_oceanNode.setManager(this); m_oceanNode.setCore(m_core); m_oceanNode.loadFromConfigNode(false); m_oceanNode.Start(); } managerState = "awake"; }
// Initialization public void Awake() { managerState = "waking up"; m_radius = (float)parentCelestialBody.Radius; // print (m_radius); m_sunNode = new SunNode(); m_sunNode.Start(); m_skyNode = new SkyNode(); m_skyNode.setManager(this); m_skyNode.SetParentCelestialBody(parentCelestialBody); m_skyNode.setParentPlanetTransform(ParentPlanetTransform); // print ("skynode parent CB and PP set"); //m_skyNode.loadSettings (); m_skyNode.loadFromConfigNode(false); m_skyNode.Start(); //m_skyNode.loadFromConfigNode(false); //m_skyNode.loadFromConfigNode (); // print ("skynode started"); if (hasOcean) { m_oceanNode = new OceanWhiteCaps(); m_oceanNode.setManager(this); m_oceanNode.setCore(m_core); m_oceanNode.loadFromConfigNode(false); m_oceanNode.Start(); } managerState = "awake"; }
//this fixes the alt-enter bug the really stupid way but it'll do for now public void reBuildOcean() { if (hasOcean) { UnityEngine.Object.Destroy(m_oceanNode); m_oceanNode = new OceanWhiteCaps(); m_oceanNode.setManager(this); m_oceanNode.setCore(m_core); m_oceanNode.loadFromConfigNode(false); m_oceanNode.Start(); Debug.Log("[Scatterer] Rebuilt Ocean"); } }
//this fixes the alt-enter bug the really stupid way but it's fast so it'll do for now public void reBuildOcean() { if (hasOcean && Core.Instance.useOceanShaders) { m_oceanNode.OnDestroy(); UnityEngine.Object.Destroy(m_oceanNode); m_oceanNode = new OceanWhiteCaps(); m_oceanNode.setManager(this); m_oceanNode.setCore(Core.Instance); m_oceanNode.loadFromConfigNode(false); m_oceanNode.Start(); Debug.Log("[Scatterer] Rebuilt Ocean"); } }
public void getSettingsFromOceanNode() { OceanWhiteCaps oceanNode = Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.GetOceanNode(); oceanLevel = oceanNode.m_oceanLevel; oceanAlpha = oceanNode.oceanAlpha; oceanAlphaRadius = oceanNode.alphaRadius; oceanUpwellingColorR = oceanNode.m_oceanUpwellingColor.x; oceanUpwellingColorG = oceanNode.m_oceanUpwellingColor.y; oceanUpwellingColorB = oceanNode.m_oceanUpwellingColor.z; oceanUnderwaterColorR = oceanNode.m_UnderwaterColor.x; oceanUnderwaterColorG = oceanNode.m_UnderwaterColor.y; oceanUnderwaterColorB = oceanNode.m_UnderwaterColor.z; transparencyDepth = oceanNode.transparencyDepth; darknessDepth = oceanNode.darknessDepth; refractionIndex = oceanNode.refractionIndex; shoreFoam = oceanNode.shoreFoam; //oceanScale = oceanNode.oceanScale; choppynessMultiplier = oceanNode.choppynessMultiplier; // WAVE_CM = oceanNode.WAVE_CM; // WAVE_KM = oceanNode.WAVE_KM; AMP = oceanNode.AMP; m_windSpeed = oceanNode.m_windSpeed; m_omega = oceanNode.m_omega; m_gridSizes = oceanNode.m_gridSizes; m_choppyness = oceanNode.m_choppyness; // m_fourierGridSize = oceanNode.m_fourierGridSize; m_ansio = oceanNode.m_ansio; m_varianceSize = oceanNode.m_varianceSize; m_foamAnsio = oceanNode.m_foamAnsio; m_foamMipMapBias = oceanNode.m_foamMipMapBias; m_whiteCapStr = oceanNode.m_whiteCapStr; farWhiteCapStr = oceanNode.m_farWhiteCapStr; m_resolution = oceanNode.m_resolution; // m_fourierGridSize = oceanNode.m_fourierGridSize; }
void InitSkyAndOceanNodes() { m_skyNode = (SkyNode)Scatterer.Instance.scaledSpaceCamera.gameObject.AddComponent(typeof(SkyNode)); m_skyNode.setManager(this); m_skyNode.setCelestialBodyName(parentCelestialBody.name); m_skyNode.setParentScaledTransform(parentScaledTransform); m_skyNode.setParentLocalTransform(parentLocalTransform); m_skyNode.usesCloudIntegration = usesCloudIntegration; if (m_skyNode.loadFromConfigNode()) { m_skyNode.Init(); if (hasOcean && Scatterer.Instance.mainSettings.useOceanShaders && (HighLogic.LoadedScene != GameScenes.MAINMENU)) { m_oceanNode = (OceanWhiteCaps)Scatterer.Instance.ReturnProperCamera(true, false).gameObject.AddComponent(typeof(OceanWhiteCaps)); m_oceanNode.Init(this); } } }
public void buildOceanGUI() { OceanWhiteCaps oceanNode = Scatterer.Instance.planetsConfigsReader.scattererCelestialBodies [selectedPlanet].m_manager.GetOceanNode(); oceanModularGUI.ClearModules(); oceanModularGUI.AddModule(new GUIModuleFloat("Alpha/WhiteCap Radius", oceanNode, "alphaRadius")); //TODO rename this and check what it does oceanModularGUI.AddModule(new GUIModuleFloat("ocean Alpha", oceanNode, "oceanAlpha")); oceanModularGUI.AddModule(new GUIModuleFloat("Transparency Depth", oceanNode, "transparencyDepth")); oceanModularGUI.AddModule(new GUIModuleFloat("Darkness Depth", oceanNode, "darknessDepth")); oceanModularGUI.AddModule(new GUIModuleFloat("Refraction Index", oceanNode, "refractionIndex")); oceanModularGUI.AddModule(new GUIModuleFloat("Shore foam strength", oceanNode, "shoreFoam")); oceanModularGUI.AddModule(new GUIModuleFloat("Foam strength (m_whiteCapStr)", oceanNode, "m_whiteCapStr")); oceanModularGUI.AddModule(new GUIModuleFloat("Far foam strength (m_farWhiteCapStr)", oceanNode, "m_farWhiteCapStr")); oceanModularGUI.AddModule(new GUIModuleVector3("Ocean Upwelling Color", oceanNode, "m_oceanUpwellingColor")); oceanModularGUI.AddModule(new GUIModuleVector3("Ocean Underwater Color", oceanNode, "m_UnderwaterColor")); if (Scatterer.Instance.mainSettings.oceanCaustics) { oceanModularGUI.AddModule(new GUIModuleString("Caustics texture path", oceanNode, "causticsTexturePath")); oceanModularGUI.AddModule(new GUIModuleVector2("Caustics layer 1 scale", oceanNode, "causticsLayer1Scale")); oceanModularGUI.AddModule(new GUIModuleVector2("caustics layer 1 speed", oceanNode, "causticsLayer1Speed")); oceanModularGUI.AddModule(new GUIModuleVector2("Caustics Layer 2 scale", oceanNode, "causticsLayer2Scale")); oceanModularGUI.AddModule(new GUIModuleVector2("caustics Layer 2 speed", oceanNode, "causticsLayer2Speed")); oceanModularGUI.AddModule(new GUIModuleFloat("Caustics texture multiply", oceanNode, "causticsMultiply")); oceanModularGUI.AddModule(new GUIModuleFloat("Caustics underwater light boost", oceanNode, "causticsUnderwaterLightBoost")); oceanModularGUI.AddModule(new GUIModuleFloat("Caustics minimum brightness (of dark areas in the caustics texture)", oceanNode, "causticsMinBrightness")); oceanModularGUI.AddModule(new GUIModuleFloat("Caustics blur depth", oceanNode, "causticsBlurDepth")); } oceanModularGUI.AddModule(new GUIModuleLabel("To apply the next setting press \"rebuild ocean\" and wait")); oceanModularGUI.AddModule(new GUIModuleLabel("Keep in mind this saves your current settings")); oceanModularGUI.AddModule(new GUIModuleFloat("AMP (default 1)", oceanNode, "AMP")); oceanModularGUI.AddModule(new GUIModuleFloat("wind Speed", oceanNode, "m_windSpeed")); oceanModularGUI.AddModule(new GUIModuleFloat("omega: inverse wave age", oceanNode, "m_omega")); oceanModularGUI.AddModule(new GUIModuleFloat("foamMipMapBias", oceanNode, "m_foamMipMapBias")); oceanModularGUI.AddModule(new GUIModuleInt("m_ansio", oceanNode, "m_ansio")); oceanModularGUI.AddModule(new GUIModuleInt("m_foamAnsio", oceanNode, "m_foamAnsio")); oceanModularGUI.AddModule(new GUIModuleLabel("Performance settings")); oceanModularGUI.AddModule(new GUIModuleInt("m_varianceSize (sun reflection, power of 2)", oceanNode, "m_varianceSize")); oceanModularGUI.AddModule(new GUIModuleLabel("m_varianceSize increases rebuild time exponentially")); oceanModularGUI.AddModule(new GUIModuleInt("Ocean mesh resolution (lower is better)", oceanNode, "m_resolution")); oceanModularGUI.AddModule(new GUIModuleLabel("current fourierGridSize: " + Scatterer.Instance.mainSettings.m_fourierGridSize.ToString())); }
//this fixes the alt-enter bug the really stupid way but it's fast and simple so it'll do public void reBuildOcean() { if (!ReferenceEquals(m_oceanNode, null)) { m_oceanNode.Cleanup(); Component.Destroy(m_oceanNode); UnityEngine.Object.Destroy(m_oceanNode); m_oceanNode = (OceanWhiteCaps)Scatterer.Instance.ReturnProperCamera(true, false).gameObject.AddComponent(typeof(OceanWhiteCaps)); m_oceanNode.Init(this); if (Scatterer.Instance.mainSettings.oceanRefraction && Scatterer.Instance.bufferManager.refractionTexture.IsCreated()) { Scatterer.Instance.bufferManager.refractionTexture.Create(); } Utils.LogDebug("Rebuilt Ocean"); } }
public void Awake() { if (HighLogic.LoadedScene == GameScenes.MAINMENU) { GameObject _go = Core.GetMainMenuObject(parentCelestialBody.name); if (_go) { MeshRenderer _mr = _go.GetComponent <MeshRenderer> (); if (_mr) { var sctBodyTransform = ScaledSpace.Instance.transform.FindChild(parentCelestialBody.name); m_radius = (_go.transform.localScale.x / sctBodyTransform.localScale.x) * parentCelestialBody.Radius; } } } else { m_radius = parentCelestialBody.Radius; } m_skyNode = (SkyNode)Core.Instance.scaledSpaceCamera.gameObject.AddComponent(typeof(SkyNode)); m_skyNode.setManager(this); m_skyNode.setCelestialBodyName(parentCelestialBody.name); m_skyNode.setParentScaledTransform(parentScaledTransform); m_skyNode.setParentLocalTransform(parentLocalTransform); m_skyNode.usesCloudIntegration = usesCloudIntegration; if (m_skyNode.loadFromConfigNode()) { m_skyNode.Init(); if (hasOcean && Core.Instance.useOceanShaders && (HighLogic.LoadedScene != GameScenes.MAINMENU)) { m_oceanNode = (OceanWhiteCaps)Core.Instance.farCamera.gameObject.AddComponent(typeof(OceanWhiteCaps)); m_oceanNode.setManager(this); m_oceanNode.loadFromConfigNode(); m_oceanNode.Init(); } } }
//this fixes the alt-enter bug the really stupid way but it's fast and simple so it'll do public void reBuildOcean() { if (hasOcean && Core.Instance.useOceanShaders) { m_oceanNode.OnDestroy(); UnityEngine.Object.Destroy(m_oceanNode); m_oceanNode = new OceanWhiteCaps(); m_oceanNode.setManager(this); m_oceanNode.loadFromConfigNode(); m_oceanNode.Start(); if (Core.Instance.oceanRefraction) { Core.Instance.refractionCam.waterMeshRenderers = m_oceanNode.waterMeshRenderers; Core.Instance.refractionCam.numGrids = m_oceanNode.numGrids; } Debug.Log("[Scatterer] Rebuilt Ocean"); } }
//this fixes the alt-enter bug the really stupid way but it's fast and simple so it'll do public void reBuildOcean() { if (!ReferenceEquals(m_oceanNode, null)) { m_oceanNode.Cleanup(); Component.Destroy(m_oceanNode); UnityEngine.Object.Destroy(m_oceanNode); m_oceanNode = (OceanWhiteCaps)Core.Instance.farCamera.gameObject.AddComponent(typeof(OceanWhiteCaps)); m_oceanNode.setManager(this); m_oceanNode.loadFromConfigNode(); m_oceanNode.Init(); if (Core.Instance.oceanRefraction && Core.Instance.bufferRenderingManager.refractionTexture.IsCreated()) { Core.Instance.bufferRenderingManager.refractionTexture.Create(); } Debug.Log("[Scatterer] Rebuilt Ocean"); } }
// Initialization public void Awake() { m_radius = parentCelestialBody.Radius; m_skyNode = (SkyNode)Core.Instance.scaledSpaceCamera.gameObject.AddComponent(typeof(SkyNode)); m_skyNode.setManager(this); m_skyNode.usesCloudIntegration = usesCloudIntegration; m_skyNode.SetParentCelestialBody(parentCelestialBody); m_skyNode.setParentPlanetTransform(ParentPlanetTransform); if (m_skyNode.loadFromConfigNode()) { m_skyNode.Init(); if (hasOcean && Core.Instance.useOceanShaders) { m_oceanNode = (OceanWhiteCaps)Core.Instance.farCamera.gameObject.AddComponent(typeof(OceanWhiteCaps)); m_oceanNode.setManager(this); m_oceanNode.loadFromConfigNode(); m_oceanNode.Init(); } } }
// Initialization public void Awake() { m_radius = parentCelestialBody.Radius; // print (m_radius); m_skyNode = new SkyNode(); m_skyNode.setManager(this); m_skyNode.SetParentCelestialBody(parentCelestialBody); m_skyNode.setParentPlanetTransform(ParentPlanetTransform); if (m_skyNode.loadFromConfigNode()) { m_skyNode.Start(); if (hasOcean && Core.Instance.useOceanShaders) { m_oceanNode = new OceanWhiteCaps(); m_oceanNode.setManager(this); m_oceanNode.loadFromConfigNode(); m_oceanNode.Start(); } } }
//this fixes the alt-enter bug the really stupid way but it'll do for now public void reBuildOcean() { if (hasOcean) { UnityEngine.Object.Destroy(m_oceanNode); m_oceanNode = new OceanWhiteCaps(); m_oceanNode.setManager(this); m_oceanNode.setCore(m_core); m_oceanNode.loadFromConfigNode(false); m_oceanNode.Start(); Debug.Log("[Scatterer] Rebuilt Ocean"); } }
// UI BUTTONS // This isn't the most elegant section due to how many elements are here // I don't care enough to do it in a cleaner way // After all it's a basic UI for tweaking settings and it does it's job public void DrawScattererWindow(int windowId) { GUItoggle("Hide", ref Core.Instance.visible); if (Core.Instance.mainMenu) //MAIN MENU options { GUILayout.Label(String.Format("Scatterer: features selector")); Core.Instance.useOceanShaders = GUILayout.Toggle(Core.Instance.useOceanShaders, "Ocean shaders (may require game restart on change)"); GUILayout.BeginHorizontal(); GUILayout.Label("Ocean: fourierGridSize (64:fast,128:normal,256:HQ)"); Core.Instance.m_fourierGridSize = (Int32)(Convert.ToInt32(GUILayout.TextField(Core.Instance.m_fourierGridSize.ToString()))); GUILayout.EndHorizontal(); Core.Instance.oceanSkyReflections = GUILayout.Toggle(Core.Instance.oceanSkyReflections, "Ocean: accurate sky reflection"); Core.Instance.oceanRefraction = GUILayout.Toggle(Core.Instance.oceanRefraction, "Ocean: refraction effects"); Core.Instance.oceanPixelLights = GUILayout.Toggle(Core.Instance.oceanPixelLights, "Ocean: lights compatibility (huge performance hit when lights on)"); //Core.Instance.usePlanetShine = GUILayout.Toggle(Core.Instance.usePlanetShine, "PlanetShine"); Core.Instance.integrateWithEVEClouds = GUILayout.Toggle(Core.Instance.integrateWithEVEClouds, "Integrate effects with EVE clouds (may require restart)"); Core.Instance.drawAtmoOnTopOfClouds = GUILayout.Toggle(Core.Instance.drawAtmoOnTopOfClouds, "Draw atmo on top of EVE clouds(old cloud shading, use with EVE 7-4)"); Core.Instance.fullLensFlareReplacement = GUILayout.Toggle(Core.Instance.fullLensFlareReplacement, "Lens flare shader"); Core.Instance.useEclipses = GUILayout.Toggle(Core.Instance.useEclipses, "Eclipses (WIP, sky/orbit only for now)"); Core.Instance.useRingShadows = GUILayout.Toggle(Core.Instance.useRingShadows, "Kopernicus ring shadows"); Core.Instance.useGodrays = GUILayout.Toggle(Core.Instance.useGodrays, "Godrays (early WIP)"); Core.Instance.terrainShadows = GUILayout.Toggle(Core.Instance.terrainShadows, "Terrain shadows"); GUILayout.BeginHorizontal(); GUILayout.Label("Shadow bias"); Core.Instance.shadowBias = float.Parse(GUILayout.TextField(Core.Instance.shadowBias.ToString("0.000"))); GUILayout.Label("Shadow normal bias"); Core.Instance.shadowNormalBias = float.Parse(GUILayout.TextField(Core.Instance.shadowNormalBias.ToString("0.000"))); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("Menu scroll section height"); Core.Instance.scrollSectionHeight = (Int32)(Convert.ToInt32(GUILayout.TextField(Core.Instance.scrollSectionHeight.ToString()))); GUILayout.EndHorizontal(); Core.Instance.disableAmbientLight = GUILayout.Toggle(Core.Instance.disableAmbientLight, "Disable scaled space ambient light"); Core.Instance.showMenuOnStart = GUILayout.Toggle(Core.Instance.showMenuOnStart, "Show this menu on start-up"); GUILayout.BeginHorizontal(); GUILayout.Label(".cfg file used:"); GUILayout.TextField(Core.Instance.baseConfigs [0].parent.url); GUILayout.EndHorizontal(); } else if (Core.Instance.isActive) { GUILayout.BeginHorizontal(); GUILayout.Label("Planet:"); if (GUILayout.Button("<")) { if (selectedPlanet > 0) { selectedPlanet -= 1; selectedConfigPoint = 0; if (Core.Instance.scattererCelestialBodies [selectedPlanet].active) { loadConfigPoint(selectedConfigPoint); getSettingsFromSkynode(); if (Core.Instance.scattererCelestialBodies [selectedPlanet].hasOcean) { getSettingsFromOceanNode(); } } } } GUILayout.TextField((Core.Instance.scattererCelestialBodies [selectedPlanet].celestialBodyName).ToString()); if (GUILayout.Button(">")) { if (selectedPlanet < Core.Instance.scattererCelestialBodies.Count - 1) { selectedPlanet += 1; selectedConfigPoint = 0; if (Core.Instance.scattererCelestialBodies [selectedPlanet].active) { loadConfigPoint(selectedConfigPoint); getSettingsFromSkynode(); if (Core.Instance.scattererCelestialBodies [selectedPlanet].hasOcean) { getSettingsFromOceanNode(); } } } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("Planet loaded:" + Core.Instance.scattererCelestialBodies [selectedPlanet].active.ToString() + " Has ocean:" + Core.Instance.scattererCelestialBodies [selectedPlanet].hasOcean.ToString()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("Load distance:" + Core.Instance.scattererCelestialBodies [selectedPlanet].loadDistance.ToString() + " Unload distance:" + Core.Instance.scattererCelestialBodies [selectedPlanet].unloadDistance.ToString()); GUILayout.EndHorizontal(); if (Core.Instance.scattererCelestialBodies [selectedPlanet].active) { configPointsCnt = Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.configPoints.Count; GUILayout.BeginHorizontal(); if (GUILayout.Button("Atmosphere settings")) { displayOceanSettings = false; //displaySunflareSettings = false; } if (GUILayout.Button("Ocean settings")) { if (Core.Instance.scattererCelestialBodies [selectedPlanet].hasOcean) { displayOceanSettings = true; } //displaySunflareSettings = false; } // if (GUILayout.Button ("Sunflare(s) Settings")) { // displayOceanSettings = false; // displaySunflareSettings = true; // } GUILayout.EndHorizontal(); ConfigPoint _cur = Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.configPoints [selectedConfigPoint]; if (!displayOceanSettings) { if (!MapView.MapIsEnabled) { GUILayout.BeginHorizontal(); GUILayout.Label("New point altitude:"); newCfgPtAlt = Convert.ToSingle(GUILayout.TextField(newCfgPtAlt.ToString())); if (GUILayout.Button("Add")) { Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.configPoints.Insert(selectedConfigPoint + 1, new ConfigPoint(newCfgPtAlt, alphaGlobal / 100, exposure / 100, skyRimExposure / 100, postProcessingalpha / 100, postProcessDepth / 10000, postProcessExposure / 100, extinctionMultiplier / 100, extinctionTint / 100, skyExtinctionRimFade / 100, skyExtinctionGroundFade / 100, openglThreshold, edgeThreshold / 100, viewdirOffset, _Post_Extinction_Tint / 100, postExtinctionMultiplier / 100, _GlobalOceanAlpha / 100, _extinctionScatterIntensity / 100)); selectedConfigPoint += 1; configPointsCnt = Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.configPoints.Count; loadConfigPoint(selectedConfigPoint); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("Config point:"); if (GUILayout.Button("<")) { if (selectedConfigPoint > 0) { selectedConfigPoint -= 1; loadConfigPoint(selectedConfigPoint); } } GUILayout.TextField((selectedConfigPoint).ToString()); if (GUILayout.Button(">")) { if (selectedConfigPoint < configPointsCnt - 1) { selectedConfigPoint += 1; loadConfigPoint(selectedConfigPoint); } } //GUILayout.Label (String.Format("Total:{0}", configPointsCnt)); if (GUILayout.Button("Delete")) { if (configPointsCnt <= 1) { print("Can't delete config point, one or no points remaining"); } else { Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.configPoints.RemoveAt(selectedConfigPoint); if (selectedConfigPoint >= configPointsCnt - 1) { selectedConfigPoint = configPointsCnt - 2; } configPointsCnt = Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.configPoints.Count; loadConfigPoint(selectedConfigPoint); } } GUILayout.EndHorizontal(); GUIfloat("Point altitude", ref pointAltitude, ref _cur.altitude); _scroll = GUILayout.BeginScrollView(_scroll, false, true, GUILayout.Width(400), GUILayout.Height(Core.Instance.scrollSectionHeight)); GUIfloat("experimentalAtmoScale", ref experimentalAtmoScale, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.experimentalAtmoScale); GUIfloat("AtmosphereGlobalScale", ref atmosphereGlobalScale, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.atmosphereGlobalScale); GUIfloat("experimentalViewDirOffset", ref viewdirOffset, ref _cur.viewdirOffset); // GUILayout.Label("Sky/Orbit shader"); GUIfloat("Sky/orbit Alpha", ref alphaGlobal, ref _cur.skyAlpha); GUIfloat("Sky/orbit Exposure", ref exposure, ref _cur.skyExposure); // tonemapper.setExposure(exposure); GUIfloat("Sky/orbit Rim Exposure", ref skyRimExposure, ref _cur.skyRimExposure); GUIfloat("extinctionMultiplier", ref extinctionMultiplier, ref _cur.skyExtinctionMultiplier); GUIfloat("extinctionTint", ref extinctionTint, ref _cur.skyExtinctionTint); GUIfloat("extinctionRimFade", ref skyExtinctionRimFade, ref _cur.skyextinctionRimFade); GUIfloat("extinctionGroundFade", ref skyExtinctionGroundFade, ref _cur.skyextinctionGroundFade); GUIfloat("extinctionScatterIntensity", ref _extinctionScatterIntensity, ref _cur._extinctionScatterIntensity); // GUILayout.Label("Post-processing shader"); GUIfloat("Post Processing Alpha", ref postProcessingalpha, ref _cur.postProcessAlpha); GUIfloat("Post Processing Depth", ref postProcessDepth, ref _cur.postProcessDepth); GUIfloat("Post Processing Extinction Multiplier", ref postExtinctionMultiplier, ref _cur.postExtinctionMultiplier); GUIfloat("Post Processing Extinction Tint", ref _Post_Extinction_Tint, ref _cur._Post_Extinction_Tint); GUIfloat("Post Processing Exposure", ref postProcessExposure, ref _cur.postProcessExposure); // if (!d3d9) { GUIfloat("Depth buffer Threshold", ref openglThreshold, ref _cur.openglThreshold); } GUIfloat("_GlobalOceanAlpha", ref _GlobalOceanAlpha, ref _cur._GlobalOceanAlpha); } else { _scroll = GUILayout.BeginScrollView(_scroll, false, true, GUILayout.Width(400), GUILayout.Height(Core.Instance.scrollSectionHeight)); GUIfloat("experimentalAtmoScale", ref experimentalAtmoScale, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.experimentalAtmoScale); GUIfloat("AtmosphereGlobalScale", ref atmosphereGlobalScale, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.atmosphereGlobalScale); GUIfloat("Map view alpha", ref mapAlphaGlobal, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.mapAlphaGlobal); GUIfloat("Map view exposure", ref mapExposure, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.mapExposure); GUIfloat("Map view rim exposure", ref mapSkyRimeExposure, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.mapSkyRimExposure); GUIfloat("MapExtinctionMultiplier", ref mapExtinctionMultiplier, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.mapExtinctionMultiplier); GUIfloat("MapExtinctionTint", ref mapExtinctionTint, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.mapExtinctionTint); GUIfloat("MapExtinctionRimFade", ref mapSkyExtinctionRimFade, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.mapSkyExtinctionRimFade); GUIfloat("MapExtinctionScatterIntensity", ref _mapExtinctionScatterIntensity, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode._mapExtinctionScatterIntensity); } GUIfloat("mieG", ref mieG, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.m_mieG); if (Core.Instance.integrateWithEVEClouds && Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.usesCloudIntegration) { GUIfloat("Cloud Color Multiplier", ref cloudColorMultiplier, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.cloudColorMultiplier); GUIfloat("Cloud Scattering Multiplier", ref cloudScatteringMultiplier, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.cloudScatteringMultiplier); GUIfloat("Cloud Sky irradiance Multiplier", ref cloudSkyIrradianceMultiplier, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.cloudSkyIrradianceMultiplier); GUIfloat("Volumetrics Color Multiplier", ref volumetricsColorMultiplier, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.volumetricsColorMultiplier); GUILayout.BeginHorizontal(); GUILayout.Label("Preserve cloud colors "); GUILayout.TextField(Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.EVEIntegration_preserveCloudColors.ToString()); if (GUILayout.Button("Toggle")) { Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.togglePreserveCloudColors(); } GUILayout.EndHorizontal(); // GUIfloat("Volumetrics Scattering Multiplier", ref volumetricsScatteringMultiplier, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.volumetricsScatteringMultiplier); // GUIfloat("Volumetrics Sky irradiance Multiplier", ref volumetricsSkyIrradianceMultiplier, ref Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.volumetricsSkyIrradianceMultiplier); } GUILayout.BeginHorizontal(); GUILayout.Label("RimBlend"); rimBlend = Convert.ToSingle(GUILayout.TextField(rimBlend.ToString())); GUILayout.Label("RimPower"); rimpower = Convert.ToSingle(GUILayout.TextField(rimpower.ToString())); if (GUILayout.Button("Set")) { Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.rimBlend = rimBlend; Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.rimpower = rimpower; Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.tweakStockAtmosphere(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("Spec: R"); specR = (float)(Convert.ToDouble(GUILayout.TextField(specR.ToString()))); GUILayout.Label("G"); specG = (float)(Convert.ToDouble(GUILayout.TextField(specG.ToString()))); GUILayout.Label("B"); specB = (float)(Convert.ToDouble(GUILayout.TextField(specB.ToString()))); GUILayout.Label("shine"); shininess = (float)(Convert.ToDouble(GUILayout.TextField(shininess.ToString()))); if (GUILayout.Button("Set")) { Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.specR = specR; Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.specG = specG; Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.specB = specB; Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.shininess = shininess; Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.tweakStockAtmosphere(); } GUILayout.EndHorizontal(); if (!MapView.MapIsEnabled) { GUILayout.BeginHorizontal(); if (Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.currentConfigPoint == 0) { GUILayout.Label("Current state:Ground, cfgPoint 0"); } else if (Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.currentConfigPoint >= configPointsCnt) { GUILayout.Label(String.Format("Current state:Orbit, cfgPoint{0}", Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.currentConfigPoint - 1)); } else { GUILayout.Label(String.Format("Current state:{0}% cfgPoint{1} + {2}% cfgPoint{3} ", (int)(100 * (1 - Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.percentage)), Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.currentConfigPoint - 1, (int)(100 * Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.percentage), Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.currentConfigPoint)); } GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); GUILayout.BeginHorizontal(); GUItoggle("Toggle depth buffer", ref Core.Instance.depthbufferEnabled); if (GUILayout.Button("Toggle PostProcessing")) { Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.togglePostProcessing(); } GUILayout.EndHorizontal(); // GUILayout.BeginHorizontal (); // if (GUILayout.Button ("toggle sky")) // { // Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.skyEnabled = !Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.skyEnabled; // if (Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.skyEnabled) // Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.tweakStockAtmosphere(); // else // Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.RestoreStockAtmosphere(); // } // GUILayout.EndHorizontal (); GUILayout.BeginHorizontal(); if (GUILayout.Button("Save atmo")) { Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.displayInterpolatedVariables = showInterpolatedValues; Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.saveToConfigNode(); } if (GUILayout.Button("Load atmo")) { Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.loadFromConfigNode(); getSettingsFromSkynode(); loadConfigPoint(selectedConfigPoint); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label(".cfg file used:"); GUILayout.TextField(Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode.configUrl.parent.url); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Map EVE clouds")) { Core.Instance.mapEVEClouds(); foreach (ScattererCelestialBody _cel in Core.Instance.scattererCelestialBodies) { if (_cel.active) { if (!_cel.m_manager.m_skyNode.inScaledSpace) { _cel.m_manager.m_skyNode.mapEVEvolumetrics(); } } } } GUILayout.EndHorizontal(); } else { OceanWhiteCaps oceanNode = Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.GetOceanNode(); //GUItoggle("Toggle ocean", ref stockOcean); _scroll2 = GUILayout.BeginScrollView(_scroll2, false, true, GUILayout.Width(400), GUILayout.Height(Core.Instance.scrollSectionHeight + 100)); { GUIfloat("ocean Level", ref oceanLevel, ref oceanNode.m_oceanLevel); GUIfloat("Alpha/WhiteCap Radius", ref oceanAlphaRadius, ref oceanNode.alphaRadius); GUIfloat("ocean Alpha", ref oceanAlpha, ref oceanNode.oceanAlpha); GUIfloat("Transparency Depth", ref transparencyDepth, ref oceanNode.transparencyDepth); GUIfloat("Darkness Depth", ref darknessDepth, ref oceanNode.darknessDepth); GUIfloat("Refraction Index", ref refractionIndex, ref oceanNode.refractionIndex); GUIfloat("Shore foam", ref shoreFoam, ref oceanNode.shoreFoam); GUIfloat("whiteCapStr (foam)", ref m_whiteCapStr, ref oceanNode.m_whiteCapStr); GUIfloat("far whiteCapStr", ref farWhiteCapStr, ref oceanNode.m_farWhiteCapStr); GUIfloat("choppyness multiplier", ref choppynessMultiplier, ref oceanNode.choppynessMultiplier); GUIvector3("Ocean Upwelling Color", ref oceanUpwellingColorR, ref oceanUpwellingColorG, ref oceanUpwellingColorB, ref oceanNode.m_oceanUpwellingColor); GUIvector3("Ocean Underwater Color", ref oceanUnderwaterColorR, ref oceanUnderwaterColorG, ref oceanUnderwaterColorB, ref oceanNode.m_UnderwaterColor); GUILayout.BeginHorizontal(); GUILayout.Label("To apply the next setting press \"rebuild ocean\" and wait"); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("Keep in mind this saves your current settings"); GUILayout.EndHorizontal(); // GUIfloat("ocean Scale", ref oceanScale, ref oceanNode.oceanScale); // GUIfloat ("WAVE_CM (default 0.23)", ref WAVE_CM, ref oceanNode.WAVE_CM); // GUIfloat ("WAVE_KM (default 370)", ref WAVE_KM, ref oceanNode.WAVE_KM); GUIfloat("AMP (default 1)", ref AMP, ref oceanNode.AMP); GUIfloat("wind Speed", ref m_windSpeed, ref oceanNode.m_windSpeed); GUIfloat("omega: inverse wave age", ref m_omega, ref oceanNode.m_omega); GUIfloat("foamMipMapBias", ref m_foamMipMapBias, ref oceanNode.m_foamMipMapBias); GUIint("m_ansio", ref m_ansio, ref oceanNode.m_ansio, 1); GUIint("m_foamAnsio", ref m_foamAnsio, ref oceanNode.m_foamAnsio, 1); GUILayout.BeginHorizontal(); GUILayout.Label("Performance settings"); GUILayout.EndHorizontal(); GUIint("m_varianceSize (sun reflection, power of 2)", ref m_varianceSize, ref oceanNode.m_varianceSize, 1); GUILayout.BeginHorizontal(); GUILayout.Label("m_varianceSize increases rebuild time exponentially"); GUILayout.EndHorizontal(); GUIint("Ocean mesh resolution (lower is better)", ref m_resolution, ref oceanNode.m_resolution, 1); GUILayout.BeginHorizontal(); GUILayout.Label("current fourierGridSize: " + Core.Instance.m_fourierGridSize.ToString()); GUILayout.EndHorizontal(); //GUIint("Ocean renderqueue", ref oceanRenderQueue, ref oceanRenderQueue,1); } GUILayout.EndScrollView(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Rebuild ocean")) { Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.GetOceanNode().saveToConfigNode(); Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.reBuildOcean(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Save ocean")) { Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.GetOceanNode().saveToConfigNode(); } if (GUILayout.Button("Load ocean")) { Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.GetOceanNode().loadFromConfigNode(); getSettingsFromOceanNode(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label(".cfg file used:"); GUILayout.TextField(Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.GetOceanNode().configUrl.parent.url); GUILayout.EndHorizontal(); } GUILayout.BeginHorizontal(); if (GUILayout.Button("Toggle WireFrame")) { if (wireFrame) { if (Core.Instance.nearCamera.gameObject.GetComponent(typeof(Wireframe))) { Component.Destroy(Core.Instance.nearCamera.gameObject.GetComponent(typeof(Wireframe))); } if (Core.Instance.farCamera.gameObject.GetComponent(typeof(Wireframe))) { Component.Destroy(Core.Instance.farCamera.gameObject.GetComponent(typeof(Wireframe))); } if (Core.Instance.scaledSpaceCamera.gameObject.GetComponent(typeof(Wireframe))) { Component.Destroy(Core.Instance.scaledSpaceCamera.gameObject.GetComponent(typeof(Wireframe))); } wireFrame = false; } else { Core.Instance.nearCamera.gameObject.AddComponent(typeof(Wireframe)); Core.Instance.farCamera.gameObject.AddComponent(typeof(Wireframe)); Core.Instance.scaledSpaceCamera.gameObject.AddComponent(typeof(Wireframe)); wireFrame = true; } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Reload shader bundles")) { ShaderReplacer.Instance.LoadAssetBundle(); } GUILayout.EndHorizontal(); } } else { GUILayout.Label(String.Format("Inactive in tracking station and VAB/SPH")); GUILayout.EndHorizontal(); } GUI.DragWindow(); }