protected override void SetupPQS(PQS pqs) { //disable easter eggs and color map DisableUnneededObjects(pqs); //change out heightmap for new one var height = pqs.GetPQSMod <PQSMod_VertexHeightMap> (); height.heightMap = MapSO.CreateInstance <MapSO> (); var heightMap = Utils.LoadTexture("Height/Duna_height.png"); height.heightMap.CreateMap(MapSO.MapDepth.Greyscale, heightMap); height.scaleDeformityByRadius = false; height.heightMapDeformity = 8000.0; GameObject.Destroy(heightMap); //new colormap var colorMapBlend = pqs.GetPQSMod <PQSMod_VertexColorMapBlend> (); colorMapBlend.modEnabled = false; var colorNoise = pqs.GetPQSMod <PQSMod_VertexSimplexNoiseColor> (); colorNoise.modEnabled = false; var land = pqs.GetPQSMod <PQSLandControl> (); land.createScatter = false; land.createColors = false; var _LandClass = pqs.transform.FindChild("_LandClass").gameObject; var heightColor = _LandClass.AddComponent <PQSMod_HeightColorRamp> (); heightColor.modEnabled = true; //just before the original color map, which is now disabled heightColor.order = 9999990; heightColor.sphere = pqs; //new color ramp var ramp = new PQSMod_HeightColorRamp.ColorRamp(); ramp.Add(Utils.Color(149, 85, 58), Utils.Color(122, 58, 30), -100f); //lowlands ramp.Add(Utils.Color(149, 85, 58), Utils.Color(122, 58, 30), 200f); //end of lowlands ramp.Add(Utils.Color(192, 119, 87), Utils.Color(178, 79, 37), 1000f); //fade into midlands ramp.Add(Utils.Color(192, 119, 87), Utils.Color(178, 79, 37), 2100f); //end of midlands ramp.Add(Utils.Color(215, 170, 150), Utils.Color(220, 150, 120), 3000f); //fade into highlands ramp.Add(new Color(0.9f, 0.9f, 0.9f), new Color(0.75f, 0.75f, 0.75f), 3200f); //sharp start of snowlands ramp.Add(new Color(0.9f, 0.9f, 0.9f), new Color(0.75f, 0.75f, 0.75f), 5750f); //snowlands ramp.Add(new Color(0.87f, 0.87f, 0.87f), new Color(0.8f, 0.8f, 0.85f), 6000f); //sharp start of veryhighlands ramp.Add(new Color(0.87f, 0.87f, 0.87f), new Color(0.8f, 0.8f, 0.85f), 100000f); //veryhighlands go to the top heightColor.Ramp = ramp; heightColor.simplex = new Simplex(555, 5, 0.5, 5); heightColor.BaseColorBias = 0.2f; heightColor.OnSetup(); //rebuild sphere pqs.RebuildSphere(); }
protected override void SetupPQS(PQS pqs) { //new heightmap var height = pqs.GetPQSMod <PQSMod_VertexHeightMap> (); height.heightMap = MapSO.CreateInstance <MapSO> (); height.heightMapDeformity = 20000; var heightMap = Utils.LoadTexture("Height/Moho_height.png"); height.heightMap.CreateMap(MapSO.MapDepth.Greyscale, heightMap); GameObject.Destroy(heightMap); //setup fine details var simplexAbsolute = pqs.GetPQSMod <PQSMod_VertexSimplexHeightAbsolute> (); simplexAbsolute.deformity = 100; var simplex = pqs.GetPQSMod <PQSMod_VertexSimplexHeight> (); simplex.modEnabled = false; //remove old colormap var noiseColor = pqs.GetPQSMod <PQSMod_VertexSimplexNoiseColor> (); noiseColor.modEnabled = false; var heightColor = pqs.GetPQSMod <PQSMod_HeightColorMap> (); heightColor.modEnabled = false; var _Color = pqs.transform.FindChild("_Color").gameObject; var colorRamp = _Color.AddComponent <PQSMod_HeightColorRamp> (); var ramp = new PQSMod_HeightColorRamp.ColorRamp(); ramp.Add(Utils.Color(101, 48, 37), Utils.Color(104, 65, 58), -100f); ramp.Add(Utils.Color(118, 40, 25), Utils.Color(129, 64, 50), 3900f); ramp.Add(Utils.Color(155, 123, 105), Utils.Color(121, 102, 91), 13000f); ramp.Add(Utils.Color(90, 69, 57), Utils.Color(95, 79, 70), 17000f); ramp.Add(Utils.Color(115, 105, 100), Utils.Color(152, 148, 145), 20000f); ramp.Add(Utils.Color(115, 105, 100), Utils.Color(152, 148, 145), 100000f); //TODO: make ramp colorRamp.Ramp = ramp; colorRamp.simplex = new Simplex(666, 6, 0.6, 6); //>:D colorRamp.BaseColorBias = 0.1f; colorRamp.modEnabled = true; colorRamp.order = 202; colorRamp.sphere = pqs; pqs.RebuildSphere(); }
protected override void SetupPQS(PQS pqs) { //new heightmap var height = pqs.GetPQSMod <PQSMod_VertexHeightMap> (); height.heightMap = MapSO.CreateInstance <MapSO> (); var heightMap = Utils.LoadTexture("Height/Laythe_height.png"); height.heightMap.CreateMap(MapSO.MapDepth.Greyscale, heightMap); GameObject.Destroy(heightMap); //all that cool stuff SetupLaythe(pqs); //rebuild sphere pqs.RebuildSphere(); }
protected override void SetupPQS(PQS pqs) { var fractal = pqs.GetPQSMod <PQSMod_VertexPlanet> (); fractal.deformity = 3500; fractal.seed = 425364; foreach (var lc in fractal.landClasses) { if (lc.name == "AbyPl") { lc.baseColor = Utils.Color(100, 203, 173); lc.colorNoise = Utils.Color(92, 224, 185); } if (lc.name == "Beach") { lc.baseColor = Utils.Color(96, 196, 169); lc.colorNoise = Utils.Color(96, 196, 169); } if (lc.name == "Grass") { lc.baseColor = Utils.Color(44, 94, 84); lc.colorNoise = Utils.Color(41, 111, 91); } if (lc.name == "Snow") { lc.baseColor = Utils.Color(66, 104, 96); lc.colorNoise = Utils.Color(76, 124, 114); } } var land = pqs.GetPQSMod <PQSLandControl> (); land.createScatter = false; pqs.RebuildSphere(); }
/// <summary> /// Renders the Window /// </summary> protected override void Render(Int32 id) { // Call base base.Render(id); // Check for PQS if (Current.pqsController == null) { Button(Localization.LOC_KITTOPIATECH_PQSEDITOR_ADD, () => { // Create a new PQS GameObject controllerRoot = new GameObject(Current.name); controllerRoot.transform.parent = Current.transform; PQS pqsVersion = controllerRoot.AddComponent <PQS>(); // I am at this time unable to determine some of the magic parameters which cause the PQS to work... (Or just lazy but who cares :P) PSystemBody Laythe = Utility.FindBody(Injector.StockSystemPrefab.rootBody, "Laythe"); Utility.CopyObjectFields(Laythe.pqsVersion, pqsVersion); pqsVersion.surfaceMaterial = Laythe.pqsVersion.surfaceMaterial; // Create the fallback material (always the same shader) pqsVersion.fallbackMaterial = new PQSProjectionFallbackLoader(); pqsVersion.fallbackMaterial.name = Guid.NewGuid().ToString(); // Create the celestial body transform GameObject mod = new GameObject("_CelestialBody"); mod.transform.parent = controllerRoot.transform; PQSMod_CelestialBodyTransform transform = mod.AddComponent <PQSMod_CelestialBodyTransform>(); transform.sphere = pqsVersion; transform.forceActivate = false; transform.deactivateAltitude = 115000; transform.forceRebuildOnTargetChange = false; transform.planetFade = new PQSMod_CelestialBodyTransform.AltitudeFade(); transform.planetFade.fadeFloatName = "_PlanetOpacity"; transform.planetFade.fadeStart = 100000.0f; transform.planetFade.fadeEnd = 110000.0f; transform.planetFade.valueStart = 0.0f; transform.planetFade.valueEnd = 1.0f; transform.planetFade.secondaryRenderers = new List <GameObject>(); transform.secondaryFades = new PQSMod_CelestialBodyTransform.AltitudeFade[0]; transform.requirements = PQS.ModiferRequirements.Default; transform.modEnabled = true; transform.order = 10; // Create the material direction mod = new GameObject("_Material_SunLight"); mod.transform.parent = controllerRoot.gameObject.transform; PQSMod_MaterialSetDirection lightDirection = mod.AddComponent <PQSMod_MaterialSetDirection>(); lightDirection.sphere = pqsVersion; lightDirection.valueName = "_sunLightDirection"; lightDirection.requirements = PQS.ModiferRequirements.Default; lightDirection.modEnabled = true; lightDirection.order = 100; // Create the UV planet relative position mod = new GameObject("_Material_SurfaceQuads"); mod.transform.parent = controllerRoot.transform; PQSMod_UVPlanetRelativePosition uvs = mod.AddComponent <PQSMod_UVPlanetRelativePosition>(); uvs.sphere = pqsVersion; uvs.requirements = PQS.ModiferRequirements.Default; uvs.modEnabled = true; uvs.order = 999999; // Crete the quad mesh colliders mod = new GameObject("QuadMeshColliders"); mod.transform.parent = controllerRoot.gameObject.transform; PQSMod_QuadMeshColliders collider = mod.AddComponent <PQSMod_QuadMeshColliders>(); collider.sphere = pqsVersion; collider.maxLevelOffset = 0; collider.physicsMaterial = new PhysicMaterial(); collider.physicsMaterial.name = "Ground"; collider.physicsMaterial.dynamicFriction = 0.6f; collider.physicsMaterial.staticFriction = 0.8f; collider.physicsMaterial.bounciness = 0.0f; collider.physicsMaterial.frictionCombine = PhysicMaterialCombine.Maximum; collider.physicsMaterial.bounceCombine = PhysicMaterialCombine.Average; collider.requirements = PQS.ModiferRequirements.Default; collider.modEnabled = true; collider.order = 100; // Assing the new PQS Current.pqsController = pqsVersion; pqsVersion.transform.position = Current.transform.position; pqsVersion.transform.localPosition = Vector3.zero; // Set mode _mode = Modes.List; }, new Rect(20, index * distance + 10, 350, 20)); return; } // Mode List if (_mode == Modes.List) { // Get the PQS-Spheres and their mods IEnumerable <PQS> pqsList = Current.GetComponentsInChildren <PQS>(true); IEnumerable <PQSMod> pqsModList = Current.GetComponentsInChildren <PQSMod>(true); // Scroll BeginScrollView(250, (pqsList.Count() + pqsModList.Count()) * distance + distance * 4, 20); // Index index = 0; // Render foreach (PQS pqs in pqsList) { Button(pqs.ToString(), () => { _mode = Modes.PQS; _sphere = pqs; }, new Rect(20, index * distance + 10, 350, 20)); } foreach (PQSMod mod in pqsModList) { Button(mod.ToString(), () => { _mode = Modes.PQSMod; _sphere = mod.sphere; _mod = mod; }, new Rect(20, index * distance + 10, 350, 20)); } index++; Button(Localization.LOC_KITTOPIATECH_PQSEDITOR_ADD_MOD, () => _mode = Modes.AddMod, new Rect(20, index * distance + 10, 350, 20)); if (Current.pqsController.ChildSpheres.All(s => s.name != Current.pqsController.name + "Ocean")) { Button(Localization.LOC_KITTOPIATECH_PQSEDITOR_ADD_OCEAN, () => { // Generate the PQS object GameObject gameObject = new GameObject("Ocean"); gameObject.layer = Constants.GameLayers.LocalSpace; PQS ocean = gameObject.AddComponent <PQS>(); // Setup materials PSystemBody Body = Utility.FindBody(Injector.StockSystemPrefab.rootBody, "Laythe"); foreach (PQS oc in Body.pqsVersion.GetComponentsInChildren <PQS>(true)) { if (oc.name != "LaytheOcean") { continue; } // Copying Laythes Ocean-properties Utility.CopyObjectFields <PQS>(oc, ocean); } // Load our new Material into the PQS ocean.surfaceMaterial = new PQSOceanSurfaceQuadLoader(ocean.surfaceMaterial); ocean.surfaceMaterial.name = Guid.NewGuid().ToString(); // Load fallback material into the PQS ocean.fallbackMaterial = new PQSOceanSurfaceQuadFallbackLoader(ocean.fallbackMaterial); ocean.fallbackMaterial.name = Guid.NewGuid().ToString(); // Create the UV planet relative position GameObject mod = new GameObject("_Material_SurfaceQuads"); mod.transform.parent = gameObject.transform; PQSMod_UVPlanetRelativePosition uvs = mod.AddComponent <PQSMod_UVPlanetRelativePosition>(); uvs.sphere = ocean; uvs.requirements = PQS.ModiferRequirements.Default; uvs.modEnabled = true; uvs.order = 999999; // Create the AerialPerspective Material AerialPerspectiveMaterial mat = new AerialPerspectiveMaterial(); mat.Create(ocean); // Create the OceanFX OceanFX oceanFX = new OceanFX(); oceanFX.Create(ocean); // Apply the Ocean ocean.transform.parent = Current.pqsController.transform; // Add the ocean PQS to the secondary renders of the CelestialBody Transform PQSMod_CelestialBodyTransform transform = Current.pqsController.GetComponentsInChildren <PQSMod_CelestialBodyTransform>(true).FirstOrDefault(mod_ => mod_.transform.parent == Current.pqsController.transform); transform.planetFade.secondaryRenderers.Add(ocean.gameObject); typeof(PQS).GetField("_childSpheres", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(Current.pqsController, null); // Names! ocean.name = Current.pqsController.name + "Ocean"; ocean.gameObject.name = Current.pqsController.name + "Ocean"; ocean.transform.name = Current.pqsController.name + "Ocean"; // Set up the ocean PQS ocean.parentSphere = Current.pqsController; ocean.transform.position = Current.pqsController.transform.position; ocean.transform.localPosition = Vector3.zero; ocean.radius = Current.Radius; }, new Rect(20, index * distance + 10, 350, 20)); } else { Button(Localization.LOC_KITTOPIATECH_PQSEDITOR_REMOVE_OCEAN, () => { // Find atmosphere the ocean PQS PQS ocean = Current.pqsController.GetComponentsInChildren <PQS>(true).First(pqs => pqs != Current.pqsController); PQSMod_CelestialBodyTransform cbt = Current.pqsController.GetComponentsInChildren <PQSMod_CelestialBodyTransform>(true).First(); // Destroy the ocean PQS (this could be bad - destroying the secondary fades...) cbt.planetFade.secondaryRenderers.Remove(ocean.gameObject); typeof(PQS).GetField("_childSpheres", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(Current.pqsController, null); cbt.secondaryFades = new PQSMod_CelestialBodyTransform.AltitudeFade[0]; ocean.transform.parent = null; UnityEngine.Object.Destroy(ocean); }, new Rect(20, index * distance + 10, 350, 20)); } // End Scroll EndScrollView(); } // Mode PQS if (_mode == Modes.PQS) { // Scroll BeginScrollView(250, Utils.GetScrollSize <PQS>() + Utils.GetScrollSize <HazardousOcean>() + distance * 1, 20); // Index index = 0; // Render the PQS RenderObject(_sphere); // If it is an ocean, create an Hazardous Ocean button if (PQSOceanSurfaceQuad.UsesSameShader(_sphere.surfaceMaterial)) { Label("hazardousOcean"); index--; if (_sphere.GetComponent <HazardousOcean>() != null) { Button(Localization.LOC_KITTOPIATECH_EDIT, () => { UIController.Instance.SetEditedObject(KittopiaWindows.Curve, _sphere.GetComponent <HazardousOcean>().heatCurve ?? new FloatCurve(), c => _sphere.GetComponent <HazardousOcean>().heatCurve = c); UIController.Instance.EnableWindow(KittopiaWindows.Curve); }, new Rect(200, index * distance + 10, 75, 20)); index--; Button(Localization.LOC_KITTOPIATECH_REMOVE, () => UnityEngine.Object.DestroyImmediate(_sphere.GetComponent <HazardousOcean>()), new Rect(285, index * distance + 10, 75, 20)); } else { Button(Localization.LOC_KITTOPIATECH_PQSEDITOR_ADD_HAZOCEAN, () => _sphere.gameObject.AddComponent <HazardousOcean>(), new Rect(200, index * distance + 10, 170, 20)); } } index++; // Rebuild Button(Localization.LOC_KITTOPIATECH_PQSEDITOR_REBUILD, () => _sphere.RebuildSphere()); // End Scroll EndScrollView(); } // Mode PQSMod if (_mode == Modes.PQSMod) { // Scroll BeginScrollView(250, Utils.GetScrollSize(_mod.GetType()) + distance * 5, 20); // Index index = 0; // Render the PQS RenderObject(_mod); index++; // Rebuild Button(Localization.LOC_KITTOPIATECH_PQSEDITOR_REBUILD, () => _sphere.RebuildSphere()); // Remove Button(Localization.LOC_KITTOPIATECH_PQSEDITOR_REMOVE_MOD, () => { _mod.sphere = null; UnityEngine.Object.Destroy(_mod); _mod = null; // Hack _sphere.SetupExternalRender(); _sphere.CloseExternalRender(); _mode = Modes.List; }); // End Scroll EndScrollView(); } // Mode AddPQSMod if (_mode == Modes.AddMod) { // Get all PQSMod types List <Type> types = Parser.ModTypes.Where(t => t.IsSubclassOf(typeof(PQSMod))).ToList(); // Begin Scroll BeginScrollView(250, types.Count * distance + 10, 20); // Index index = 0; // Render the possible types foreach (Type t in types) { Button(t.FullName, () => { // Hack^6 GameObject pqsModObject = new GameObject(t.Name); pqsModObject.transform.parent = Current.pqsController.transform; PQSMod mod = pqsModObject.AddComponent(t) as PQSMod; mod.sphere = Current.pqsController; if (t == typeof(PQSMod_VoronoiCraters)) { PQS mun = Utility.FindBody(Injector.StockSystemPrefab.rootBody, "Mun").pqsVersion; PQSMod_VoronoiCraters craters = mun.GetComponentsInChildren <PQSMod_VoronoiCraters>()[0]; PQSMod_VoronoiCraters nc = pqsModObject.GetComponentsInChildren <PQSMod_VoronoiCraters>()[0]; nc.craterColourRamp = craters.craterColourRamp; nc.craterCurve = craters.craterCurve; nc.jitterCurve = craters.jitterCurve; } else if (t == typeof(PQSMod_VertexPlanet)) { PQSMod_VertexPlanet vp = mod as PQSMod_VertexPlanet; vp.landClasses = new [] { new PQSMod_VertexPlanet.LandClass("Class", 0, 1, Color.black, Color.white, 0) }; vp.continental = new PQSMod_VertexPlanet.SimplexWrapper(0, 0, 0, 0); vp.continentalRuggedness = new PQSMod_VertexPlanet.SimplexWrapper(0, 0, 0, 0); vp.continentalSharpness = new PQSMod_VertexPlanet.NoiseModWrapper(0, 0, 0, 0); vp.continentalSharpnessMap = new PQSMod_VertexPlanet.SimplexWrapper(0, 0, 0, 0); vp.terrainType = new PQSMod_VertexPlanet.SimplexWrapper(0, 0, 0, 0); } else if (t == typeof(PQSMod_HeightColorMap)) { (mod as PQSMod_HeightColorMap).landClasses = new [] { new PQSMod_HeightColorMap.LandClass("Class", 0, 1, Color.black, Color.white, 0) }; } else if (t == typeof(PQSMod_HeightColorMap2)) { (mod as PQSMod_HeightColorMap2).landClasses = new[] { new PQSMod_HeightColorMap2.LandClass("Class", 0, 1, Color.black, Color.white, 0) }; } else if (t == typeof(PQSMod_HeightColorMapNoise)) { (mod as PQSMod_HeightColorMapNoise).landClasses = new[] { new PQSMod_HeightColorMapNoise.LandClass("Class", 0, 1, Color.black, Color.white, 0) }; } else if (t == typeof(PQSLandControl)) { PQSLandControl lc = mod as PQSLandControl; lc.altitudeSimplex = new Simplex(); lc.scatters = new PQSLandControl.LandClassScatter[0]; lc.landClasses = new [] { new PQSLandControl.LandClass() { altitudeRange = new PQSLandControl.LerpRange(), coverageSimplex = new Simplex(), longitudeRange = new PQSLandControl.LerpRange(), latitudeDoubleRange = new PQSLandControl.LerpRange(), latitudeRange = new PQSLandControl.LerpRange(), scatter = new PQSLandControl.LandClassScatterAmount[0] } }; lc.latitudeSimplex = new Simplex(); lc.longitudeSimplex = new Simplex(); } // Edit the mod _mod = mod; _sphere = mod.sphere; _mode = Modes.PQSMod; }, new Rect(20, index * distance + 10, 350, 20)); } // End Scroll EndScrollView(); } }
private bool PatchPQS(PQS pqs, ConfigNode node) { bool pqsChanged = false; double oldR = pqs.radius; if (node.HasValue("radius")) double.TryParse(node.GetValue("radius"), out pqs.radius); if (pqs.radius != oldR) pqsChanged = true; List<PQSMod> mods; if (node.HasNode("Mods")) { mods = pqs.transform.GetComponentsInChildren<PQSMod>(true).Where(m => m.sphere == pqs).ToList<PQSMod>(); foreach (ConfigNode modNode in node.GetNode("Mods").nodes) { PQSMod delMod = null; foreach (PQSMod m in mods) { Type mType = m.GetType(); if (mType.ToString() != modNode.name) continue; if (modNode.HasValue("name")) if (m.name != modNode.GetValue("name")) continue; if(modNode.name != "PQSMod_CelestialBodyTransform") // not really a change pqsChanged = true; ParseObject(m, modNode); if (mType == typeof(PQSCity) || mType == typeof(PQSMod_MapDecal) || mType == typeof(PQSMod_MapDecalTangent)) ModDecal(m, modNode); delMod = m; break; } // If we found the mod, remove from the list since we edited it. if (delMod != null) mods.Remove(delMod); } } // Get the whole list again. mods = pqs.transform.GetComponentsInChildren<PQSMod>(true).Where(m => m.sphere == pqs).ToList<PQSMod>(); if (node.HasNode("RemoveMods")) { List<GameObject> toCheck = new List<GameObject>(); foreach (ConfigNode modNode in node.GetNode("RemoveMods").nodes) { PQSMod delMod = null; foreach (PQSMod m in mods) { Type mType = m.GetType(); if (mType.ToString() != modNode.name) continue; if (modNode.HasValue("name")) if (m.name != modNode.GetValue("name")) continue; delMod = m; break; } // If we found the mod, remove from the list since we edited it. if (delMod != null) { pqsChanged = true; toCheck.Add(delMod.gameObject); mods.Remove(delMod); delMod.sphere = null; PQSMod.DestroyImmediate(delMod); } } Utility.RemoveEmptyGO(toCheck); } // add some mods if(node.HasNode("AddMods")) { AddModLoader newMods = Parser.CreateObjectFromConfigNode<AddModLoader>(node); if (newMods.mods != null) { foreach (ModLoader loader in newMods.mods) { loader.mod.transform.parent = pqs.transform; loader.mod.sphere = pqs; loader.mod.transform.gameObject.SetLayerRecursive(Constants.GameLayers.LocalSpace); } } } // just in case, run setup for everyone. mods = pqs.transform.GetComponentsInChildren<PQSMod>(true).Where(m => m.sphere == pqs).ToList<PQSMod>(); foreach (var m in mods) { m.OnSetup(); m.OnPostSetup(); } try { pqs.RebuildSphere(); } catch (Exception e) { Logger.Active.Log("Rebuild sphere for " + node.name + " failed: " + e.Message); } return pqsChanged; }
protected override void SetupPQS(PQS pqs) { var color = pqs.GetPQSMod <PQSMod_VertexSimplexNoiseColor> (); color.modEnabled = false; var land = pqs.GetPQSMod <PQSLandControl> (); land.modEnabled = false; var simplex = pqs.GetPQSMod <PQSMod_VertexSimplexHeightAbsolute> (); simplex.deformity = 1000; simplex.frequency = 4; simplex.octaves = 4; simplex.persistence = 0.9; simplex.seed = 45276; simplex.OnSetup(); var heightNoise = pqs.GetPQSMod <PQSMod_VertexHeightNoise> (); heightNoise.modEnabled = false; var _Height = pqs.transform.FindChild("_Height").gameObject; var _Color = pqs.transform.FindChild("_Color").gameObject; var noise = _Height.AddComponent <PQSMod_VertexSimplexHeightAbsolute>(); noise.modEnabled = true; noise.order = 8; noise.sphere = pqs; noise.deformity = 20000; noise.frequency = 0.65; noise.octaves = 4; noise.persistence = 0.55; noise.seed = 45276; var noise2 = _Height.AddComponent <PQSMod_VertexSimplexHeightAbsolute>(); noise2.modEnabled = true; noise2.order = 9; noise2.sphere = pqs; noise2.deformity = 4000; noise2.frequency = 3; noise2.octaves = 4; noise2.persistence = 0.65; noise2.seed = 45276; noise.OnSetup(); var flatten = _Height.AddComponent <PQSMod_FlattenOcean> (); flatten.modEnabled = true; flatten.order = 12; flatten.sphere = pqs; flatten.oceanRadius = 0.0; flatten.OnSetup(); var colorRamp = _Color.AddComponent <PQSMod_HeightColorRamp> (); colorRamp.modEnabled = true; colorRamp.order = 110; colorRamp.sphere = pqs; var ramp = new PQSMod_HeightColorRamp.ColorRamp(); ramp.Add(Utils.Color(30, 30, 30), Utils.Color(45, 45, 45), -100f); ramp.Add(Utils.Color(150, 150, 150), Utils.Color(200, 200, 200), 20000); ramp.Add(Utils.Color(150, 150, 150), Utils.Color(200, 200, 200), 60000); colorRamp.Ramp = ramp; colorRamp.simplex = new Simplex(45267, 3, 0.5, 8); colorRamp.BaseColorBias = 0.45f; pqs.RebuildSphere(); }
protected override void SetupPQS(PQS pqs) { //MUA HA HA HA... if (SpaceKraken) { //disable the special craters var decals = pqs.GetPQSMods <PQSMod_MapDecal> (); foreach (var decal in decals) { decal.modEnabled = false; } var flattens = pqs.GetPQSMods <PQSMod_MapDecal> (); foreach (var flatten in flattens) { flatten.modEnabled = false; } //disable the heightmap, scatter, and colormap var scatter = pqs.GetPQSMod <PQSLandControl> (); scatter.modEnabled = false; var heightNoise = pqs.GetPQSMod <PQSMod_VertexHeightNoise> (); heightNoise.modEnabled = false; //collect gameobjects var _Color = pqs.transform.FindChild("_Color").gameObject; var _Height = pqs.transform.FindChild("_Height").gameObject; var simplexColor = pqs.GetPQSMod <PQSMod_VertexSimplexNoiseColor> (); var simplex = pqs.GetPQSMod <PQSMod_VertexSimplexHeightAbsolute> (); simplexColor.modEnabled = false; //the guy can't have perfectly flat skin, can he? simplex.deformity = 50; simplex.frequency = 4; simplex.octaves = 4; simplex.persistence = 0.4; simplex.seed = 4; simplex.modEnabled = true; simplex.order = 6; simplex.OnSetup(); var height = _Height.AddComponent <PQSMod_VertexHeightMap> (); height.heightMap = CreateMapSO(Utils.LoadTexture("Height/Kraken_height.png")); height.heightMapDeformity = 25000; height.heightMapOffset = 50.0; height.scaleDeformityByRadius = false; height.modEnabled = true; height.order = 5; height.sphere = pqs; height.OnSetup(); var color = _Height.AddComponent <PQSMod_VertexColorMap> (); color.vertexColorMap = CreateColorMapSO(Utils.LoadTexture("Scaled/Kraken_color.png")); color.modEnabled = true; color.order = 200; color.sphere = pqs; color.OnSetup(); Log("THE KRAKEN HAS RISEN! >:D"); } else { Log("The kraken decided to sleep in today... :'("); } pqs.RebuildSphere(); }
protected override void SetupPQS(PQS pqs) { pqs.RebuildSphere(); }