MapSO CreateColorMapSO(Texture2D colorMap) { var map = MapSO.CreateInstance <MapSO> (); map.CreateMap(MapSO.MapDepth.RGBA, colorMap); return(map); }
MapSO CreateMapSO(Texture2D heightMap) { var map = MapSO.CreateInstance <MapSO> (); map.CreateMap(MapSO.MapDepth.Greyscale, heightMap); return(map); }
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 dunaPQS = Utils.GetCelestialBody("Duna").pqsController; pqs.surfaceMaterial = new Material(dunaPQS.surfaceMaterial); var _LandClass = pqs.transform.FindChild("_LandClass").gameObject; //disable current colormap var noiseColor = pqs.GetPQSMod <PQSMod_VertexSimplexNoiseColor> (); noiseColor.modEnabled = false; var colorBlend = pqs.GetPQSMod <PQSMod_VertexColorMapBlend> (); colorBlend.modEnabled = false; var land = pqs.GetPQSMod <PQSLandControl> (); land.modEnabled = false; //add new colorRamp var colorRamp = _LandClass.AddComponent <PQSMod_HeightColorRamp> (); colorRamp.modEnabled = true; colorRamp.order = 9999990; colorRamp.sphere = pqs; var ramp = new PQSMod_HeightColorRamp.ColorRamp(); ramp.Add(Utils.Color(235, 171, 74), Utils.Color(235, 171, 74), -5000f); //oceans ramp.Add(Utils.Color(235, 171, 74), Utils.Color(235, 171, 74), -50f); //end of oceans ramp.Add(Utils.Color(155, 135, 88), Utils.Color(175, 149, 87), -10f); //start of beaches ramp.Add(Utils.Color(155, 135, 88), Utils.Color(175, 149, 87), 100f); //end of beaches ramp.Add(Utils.Color(212, 171, 75), Utils.Color(189, 158, 86), 200f); //start of lowlands ramp.Add(Utils.Color(189, 158, 86), Utils.Color(155, 120, 60), 2000f); //fade into midlands ramp.Add(Utils.Color(155, 120, 60), Utils.Color(172, 139, 78), 5000f); //fade into highlands ramp.Add(Utils.Color(223, 189, 129), Utils.Color(220, 194, 149), 5500f); //quickly fade out to mountain tops ramp.Add(Utils.Color(220, 194, 149), Utils.Color(186, 184, 180), 20000f); //top of the curve colorRamp.Ramp = ramp; colorRamp.BaseColorBias = 0.5f; colorRamp.simplex = new Simplex(654, 6, 0.35, 4); colorRamp.OnSetup(); //new heightmap var height = pqs.GetPQSMod <PQSMod_VertexHeightMap> (); height.scaleDeformityByRadius = false; height.heightMapOffset = -500.0; height.heightMapDeformity = 7000.0; height.heightMap = MapSO.CreateInstance <MapSO> (); var heightMap = Utils.LoadTexture("Height/Eve_height.png"); height.heightMap.CreateMap(MapSO.MapDepth.Greyscale, heightMap); GameObject.Destroy(heightMap); //setup ocean PQS ocean = null; foreach (var child in pqs.ChildSpheres) { Log(child.gameObject.name); if (child.gameObject.name == "EveOcean") { ocean = child; } } if (ocean != null) { Log("EveOcean found!"); var OceanFX = ocean.transform.FindChild("OceanFX").gameObject; ocean.surfaceMaterial.color = Utils.Color(235, 171, 74); ocean.surfaceMaterial.SetColor("_ColorFromSpace", Utils.Color(235, 171, 74)); } }