Ejemplo n.º 1
0
        public override void OnAdd(Scene scene)
        {
            base.OnAdd(scene);

            renderView = new MainRenderView(scene, Matrix.Identity, Matrix.Identity, Vector3.Zero, 1.0f, 1000);

            scene.MainCamera = renderView;
            scene.AddRenderView(renderView);

            fieldOfView = MathHelper.ToRadians(60);
            aspectRatio = GFX.Inst.DisplayRes.X / GFX.Inst.DisplayRes.Y;
        }
        public PostProcessElementManager(MainRenderView renderView)
            : base(renderView)
        {
            mainRenderView = renderView;
            waterShader = ResourceManager.Inst.GetShader("WaterShader");
            basicImageShader = ResourceManager.Inst.GetShader("Generic2D");
            debugNormalsShader = ResourceManager.Inst.GetShader("DebugNormals");
            motionBlurShader = ResourceManager.Inst.GetShader("MotionBlur");
            compositeShader = ResourceManager.Inst.GetShader("Composite");
            fogShader = ResourceManager.Inst.GetShader("Fog");
            colorCorrectShader = ResourceManager.Inst.GetShader("ColorCorrect");
            colorCorrectTexture = ResourceManager.Inst.GetTexture("Textures/Color Correction/colorRamp0.dds");
            godRayShader = ResourceManager.Inst.GetShader("GodRay");
            bloomShader = ResourceManager.Inst.GetShader("Bloom");
            gaussBlurHShader = ResourceManager.Inst.GetShader("GaussH");
            gaussBlurVShader = ResourceManager.Inst.GetShader("GaussV");
            boxBlurHShader = ResourceManager.Inst.GetShader("BoxH");
            boxBlurVShader = ResourceManager.Inst.GetShader("BoxV");

            underwaterRamp = ResourceManager.Inst.GetTexture("Textures/Water/underwater_color.dds");
            underwaterShader = ResourceManager.Inst.GetShader("UnderwaterShader");

            oceanShader = ResourceManager.Inst.GetShader("Ocean");
            oceanScreenSpaceShader = ResourceManager.Inst.GetShader("OceanPP");
            oceanTexture = ResourceManager.Inst.GetTexture("Textures/Water/noise02.dds");
            oceanGeometry = new ProjectiveOcean(64);
            bumpCoords = new Vector4[]
            {
                new Vector4(0.264000f,0.178000f, 0.2f, 0.1f),
                new Vector4(-2.06840f, -1.52640f, -1.0f, 0.23f),
                new Vector4(1.87920f, 1.9232f, 0.2f, 0.15f),
                new Vector4(0.096000f, 0.04f, -0.3f, 0.1f),
            };
            waveDirs = new Vector4[]
            {
                new Vector4(-0.66f, -0.208f, 0.2f, MathHelper.TwoPi/0.4f),
                new Vector4(-1.62f, 0.1708f, 0.38f, MathHelper.TwoPi/2.2f),
                new Vector4(-2.16f, 1.338f, 0.28f, MathHelper.TwoPi/1.0f),
                new Vector4(-2.72f, 8.6108f, 0.15f, MathHelper.TwoPi/4.8f),
            };
            float ratio = waveScale / waterScale;
            waveAmplitudes = new Vector4[]
            {
                ratio*Vector4.One*0.8f,
                ratio*Vector4.One*0.4f,
                ratio*Vector4.One*0.4f,
                ratio*Vector4.One*0.8f,
            };
        }
        public TerrainSceneElementManager(MainRenderView renderView)
            : base(renderView)
        {
            mainRenderView = renderView;
            terrainShader = ResourceManager.Inst.GetShader("TerrainHMShader");
            /*
            BlendAlbedo = new RenderTarget2D(GFX.Device, renderView.ColorMap.Width/2, renderView.ColorMap.Height/2, 1, SurfaceFormat.Color);
            BlendNormal = new RenderTarget2D(GFX.Device, renderView.ColorMap.Width/2, renderView.ColorMap.Height/2, 1, SurfaceFormat.Color);
            DepthStencil = new DepthStencilBuffer(GFX.Device, renderView.ColorMap.Width, renderView.ColorMap.Height, GFX.Device.DepthStencilBuffer.Format);

            Color[] whiteColor = new Color[1] { Color.White };
            Color[] normalColor = new Color[1] { Color.Blue };
            nullAlbedo = new Texture2D(GFX.Device, 1, 1, 1, TextureUsage.None, SurfaceFormat.Color);
            nullAlbedo.SetData<Color>(whiteColor);
            nullNormal = new Texture2D(GFX.Device, 1, 1, 1, TextureUsage.None, SurfaceFormat.Color);
            nullNormal.SetData<Color>(normalColor);
            */
        }
Ejemplo n.º 4
0
        public override void OnAdd(Scene scene)
        {
            base.OnAdd(scene);

            this.team = 0;
            this.lives = DEFAULT_PLAYER_LIVES;
            renderView = new MainRenderView(scene, Matrix.Identity, Matrix.Identity, Vector3.Zero, 1.0f, 1000);

            ResetStates();
            scene.MainCamera = renderView;
            scene.AddRenderView(renderView);

            fieldOfView = MathHelper.ToRadians(70);
            aspectRatio = GFX.Inst.DisplayRes.X / GFX.Inst.DisplayRes.Y;

            ResetStates();
        }