private void LoadLightingPresets(Stream presetsStream) { if (presetsStream != null) { string base_path = (string)settings["Base.Path"]; LightingSetup[] setups = LightingSetup.FromXml(presetsStream); availablePresets = new LightingPreset[setups.Length]; for (int i = 0; i < setups.Length; i++) { availablePresets[i] = new LightingPreset(); availablePresets[i].setup = setups[i]; availablePresets[i].available = true; string previewImgPath = base_path + @"Media\UI\previews\lp-" + setups[i].name + ".jpg"; if (File.Exists(previewImgPath)) { availablePresets[i].previewImage = WriteNameText(ApplyBorder(Image.FromFile(previewImgPath), true), availablePresets[i].setup.name, false); } else { availablePresets[i].previewImage = WriteNameText(previewNotAvailableAvailable, availablePresets[i].setup.name, true); } // add to list ButtonBarItem button = new ButtonBarItem(); button.Image = availablePresets[i].previewImage; button.ToolTipText = availablePresets[i].setup.name; button.Tag = availablePresets[i]; uiLightingList.Groups[0].Items.Add(button); } } }
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; }
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 override void SetupWithLights(LightingSetup setup) { }
public abstract void SetupWithLights(LightingSetup setup);