Пример #1
0
        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);
        }
Пример #2
0
        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);
        }