protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
        {
            RasterizerState          = new Microsoft.Xna.Framework.Graphics.RasterizerState();
            RasterizerState.FillMode = FillMode.WireFrame;

            BloomPostEffect         = new BloomPostEffect();
            BloomPostEffect.Enabled = false;
            this.RenderTechnic.AddPostEffect(BloomPostEffect);


            base.LoadContent(GraphicInfo, factory, contentManager);

            {
                SimpleModel        simpleModel = new SimpleModel(factory, "Model//cena");
                TriangleMeshObject tmesh       = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());

                ForwardXNABasicShaderDescription ForwardXNABasicShaderDescription = ForwardXNABasicShaderDescription.Default();
                ForwardXNABasicShaderDescription.EnableTexture    = true;
                ForwardXNABasicShaderDescription.EnableLightning  = true;
                ForwardXNABasicShaderDescription.DefaultLightning = true;

                shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription);
                ForwardMaterial fmaterial = new ForwardMaterial(shader);
                IObject         obj       = new IObject(fmaterial, simpleModel, tmesh);

                shader.Initialize(GraphicInfo, factory, obj);
                this.World.AddObject(obj);
            }


            {
                SimpleModel simpleModel = new SimpleModel(factory, "Model//cilos");
                ///tem mais de um cilo neste mesh, tem q setar as texturas de todo mundo ....
                Texture2D tex = factory.CreateTexture2DColor(1, 1, Color.White);
                for (int i = 0; i < simpleModel.MeshNumber; i++)
                {
                    simpleModel.SetTexture(tex, TextureType.DIFFUSE, i, 0);
                }

                TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
                shader2 = new ForwardEnvironmentShader(factory.GetTextureCube("Textures//cubeMap"), 1, false);
                ForwardMaterial fmaterial = new ForwardMaterial(shader2);

                IObject obj = new IObject(fmaterial, simpleModel, tmesh);
                this.World.AddObject(obj);
            }

            shader.BasicEffect.FogEnabled = true;
            shader.BasicEffect.FogColor   = new Vector3(0.1f, 0.1f, 0.1f); // Dark grey
            shader.BasicEffect.FogStart   = 30;
            shader.BasicEffect.FogEnd     = 1000;

            shader2.EnvironmentMapEffect.FogEnabled = true;
            shader2.EnvironmentMapEffect.FogColor   = new Vector3(0.1f, 0.1f, 0.1f); // Dark grey
            shader2.EnvironmentMapEffect.FogStart   = 30;
            shader2.EnvironmentMapEffect.FogEnd     = 1000;

            cam = new RotatingCamera(this);
            this.World.CameraManager.AddCamera(cam);
        }
Example #2
0
        protected override void OnEnable()
        {
            ClientComponentLightingRenderer.AdditionalAmbientLight += AdditionalAmbientLight;
            ClientComponentLightingRenderer.AdditionalAmbightLightAdditiveFraction +=
                AdditionalAmbientLightAdditiveFraction;

            this.postEffectNightVision       = ClientPostEffectsManager.Add <NightVisionPostEffect>();
            this.postEffectNightVision.Order = PostEffectsOrder.Devices;

            this.postEffectBloom = ClientPostEffectsManager.Add <BloomPostEffect>();
            this.postEffectBloom.Setup(BloomSettings);
            this.postEffectBloom.Order = this.postEffectNightVision.Order - 1;
        }
        protected override void OnEnable()
        {
            this.postEffectNightVision                = ClientPostEffectsManager.Add <NightVisionPostEffect>();
            this.postEffectNightVision.Order          = PostEffectsOrder.Devices;
            this.postEffectNightVision.EffectResource = this.EffectResource;

            this.postEffectBloom = ClientPostEffectsManager.Add <BloomPostEffect>();
            this.postEffectBloom.Setup(BloomSettings);
            this.postEffectBloom.Order = this.postEffectNightVision.Order - 1;

            this.postEffectNightVision.IsSuppressed = true;
            this.postEffectBloom.IsSuppressed       = true;
        }