public void BuildWorld() { if (TheSun != null) { TheSun.Destroy(); MainWorldView.Lights.Remove(TheSun); ThePlanet.Destroy(); MainWorldView.Lights.Remove(ThePlanet); TheSunClouds.Destroy(); MainWorldView.Lights.Remove(TheSunClouds); } // TODO: DESTROY OLD REGION! // TODO: Radius -> max view rad * 2 // TODO: Size -> max view rad * 2 + 30 * 2 TheSun = new SkyLight(Location.Zero, Chunk.CHUNK_SIZE * 30, SunLightDef, new Location(0, 0, -1), Chunk.CHUNK_SIZE * 35, false); MainWorldView.Lights.Add(TheSun); // TODO: Separate cloud quality CVar? TheSunClouds = new SkyLight(Location.Zero, Chunk.CHUNK_SIZE * 30, CloudSunLightDef, new Location(0, 0, -1), Chunk.CHUNK_SIZE * 35, true); MainWorldView.Lights.Add(TheSunClouds); // TODO: Separate planet quality CVar? ThePlanet = new SkyLight(Location.Zero, Chunk.CHUNK_SIZE * 30, PlanetLightDef, new Location(0, 0, -1), Chunk.CHUNK_SIZE * 35, false); MainWorldView.Lights.Add(ThePlanet); TheRegion = new Region(); TheRegion.TheClient = this; TheRegion.BuildWorld(); Player = new PlayerEntity(TheRegion); TheRegion.SpawnEntity(Player); onCloudShadowChanged(null, null); }
public void FixInvRender() { MainItemView.Render3D = RenderMainItem; foreach (LightObject light in MainItemView.Lights) { foreach (Light li in light.InternalLights) { li.Destroy(); } } MainItemView.Lights.Clear(); MainItemView.RenderClearAlpha = 0f; SkyLight tlight = new SkyLight(new Location(0, 0, 10), 64, Location.One, new Location(0, -1, -1).Normalize(), 64, false); MainItemView.Lights.Add(tlight); MainItemView.GenerateFBO(); MainItemView.Generate(this, Window.Width, Window.Height); }