public void SetData(DirectionalLight light) { this.light = null; textBox1.Text = String.Format("{0}, {1}, {2}", light.Direction.X, light.Direction.Y, light.Direction.Z); this.light = light; }
public static DirectionalLight FromXml(XmlElement lightNode) { DirectionalLight light = new DirectionalLight(); light.FromXmlNode(lightNode); XmlNode direction = lightNode.SelectSingleNode("direction"); if (direction != null) { float x = float.Parse(direction.Attributes["x"].InnerText); float y = float.Parse(direction.Attributes["y"].InnerText); float z = float.Parse(direction.Attributes["z"].InnerText); light.direction = new Vector3(x, y, z); } return light; }
public void SetEffect(RenderingEffect effect) { this.effect = effect; effect.LoadResources(); LightingSetup setup = new LightingSetup(); DirectionalLight light = new DirectionalLight(); light.Clr = Color.White; light.Direction = new Vector3(1, 1, -1); light.Enabled = true; setup.lights.Add(light); effect.SetupWithLights(setup); effect.SetupForDevice(outSettings); }
public MoleculeSceneManager(Device device, OutputSettings outSettings) : base(device) { screenEntities = new List<IScreenSpaceEntity>(); postSceneWorldEntities = new List<IEntity>(); postSceneViewEntities = new List<ViewSpaceEntity>(); zCompareViewEntities = new SortedList<float, ViewSpaceEntity>(); //effect = new ShadowMappingEffect(device, HashTableSettings.Instance, 1);//PPixelLightEffect(device, HashTableSettings.Instance, 1); effect = new PPixelLightEffect(device, HashTableSettings.Instance, 1); effect.LoadResources(); LightingSetup setup = new LightingSetup(); DirectionalLight light = new DirectionalLight(); light.Clr = Color.White; light.Direction = new Vector3(1, -1, -1); light.Enabled = true; setup.lights.Add(light); effect.SetupWithLights(setup); effect.SetupForDevice(this.outSettings = outSettings); /*ppEffect = new BloomEffect(device, HashTableSettings.Instance); ppEffect.LoadResources(); ppEffect.SetupWithLights(setup);*/ effect.SetupForDevice(this.outSettings); }
public override void SetupWithLights(LightingSetup setup) { if (setup == null) { setup = new LightingSetup(); DirectionalLight light = new DirectionalLight(); light.Clr = Color.White; light.Direction = new Vector3(1, -1, -1); light.Enabled = true; light.Name = "light0"; setup.lights.Add(light); } this.setup = setup; }