コード例 #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)
        {
            label2.Text = effect.Name;
            label3.Text = effect.EfxType.ToString();
            label1.Text = effect.Description;

            // load image
            string base_path = (string)HashTableSettings.Instance["Base.Path"];

            pictureBox1.Image = Image.FromFile(string.Format(@"{0}Media\UI\previews\effects\{1}-big.jpg", base_path, effect.Name));
        }
コード例 #3
0
        public void SetEffect(RenderingEffectSettings settings)
        {
            lock (this)
            {
                this.effect   = settings.GetEffect(device);
                this.settings = settings;

                sceneManger.SetEffect(this.effect);
                status = Status.Rendering;
                Invalidate();
            }
        }
コード例 #4
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);
        }
コード例 #5
0
 public RenderingInformation(Matrix transformation, Color color, RenderingEffect effect = RenderingEffect.None)
 {
     Transformation = transformation;
     Color          = color;
     Effect         = effect;
 }