Ejemplo n.º 1
0
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            CurrentProject.GraphicsDevice = GraphicsDevice;
            CurrentProject.SkyboxShader.LoadShader(Content, GraphicsDevice);
            CurrentProject.TexturedMeshShader.LoadShader(Content, GraphicsDevice);
            CurrentProject.BasicColorShader.LoadShader(Content, GraphicsDevice);
            CurrentProject.Resolution = new Vector2(800, 600);

            CurrentProject.BasicColorShader.LoadShader(Content, GraphicsDevice);
            Skybox.Load(Content);

            Space = new BEPUphysics.Space();
            Space.ForceUpdater.Gravity = new BEPUutilities.Vector3(0, -9f, 0);
            Space.ForceUpdater.Enabled = true;

            Map.Load(Content);
            MapVisible.Load(Content);
            SetDefaultSkinmeshLightning(MapVisible.Model);
            Map.PhysicsInitialize(Space);

            StairsVisible.Load(Content);
            SetDefaultSkinmeshLightning(StairsVisible.Model);
            Stairs.Load(Content);
            Stairs.PhysicsInitialize(Space);

            Teapot.Load(Content);
            Cup.Load(Content);

            Camera.PhysicsInitialize(Space);
            Skybox.LinkCamera(Camera);

            DefaultFont = Content.Load <SpriteFont>("Font");

            RenderTargetMap = new RenderTarget2D(GraphicsDevice, 800, 480, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8, 0, RenderTargetUsage.DiscardContents);

            NonEuclideanRenders = new RenderTarget2D[10];
            for (int i = 0; i < 10; i++)
            {
                NonEuclideanRenders[i] = new RenderTarget2D(GraphicsDevice, 800, 480, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8, 0, RenderTargetUsage.DiscardContents);
            }

            StairsCol2.Load(Content);

            illusion2plane = new VertexBuffer(GraphicsDevice, typeof(VertexPositionColor), 6, BufferUsage.None);
            illusion2plane.SetData(new VertexPositionColor[]
            {
                new VertexPositionColor(new Vector3(-8.60f, 1.4f, -13.46f), Color.Red),
                new VertexPositionColor(new Vector3(-8.60f, 1.4f, -15.73f), Color.Red),
                new VertexPositionColor(new Vector3(-8.60f, 0f, -13.46f), Color.Red),

                new VertexPositionColor(new Vector3(-8.60f, 1.4f, -15.73f), Color.Red),
                new VertexPositionColor(new Vector3(-8.60f, 0f, -15.73f), Color.Red),
                new VertexPositionColor(new Vector3(-8.60f, 0f, -13.46f), Color.Red),
            });

            illusion3plane = new VertexBuffer(GraphicsDevice, typeof(VertexPositionColor), 6, BufferUsage.None);
            illusion3plane.SetData(new VertexPositionColor[]
            {
                new VertexPositionColor(new Vector3(-8.60f, 1.4f, -18.73f), Color.Red),
                new VertexPositionColor(new Vector3(-8.60f, 1.4f, -21.00f), Color.Red),
                new VertexPositionColor(new Vector3(-8.60f, 0f, -18.73f), Color.Red),

                new VertexPositionColor(new Vector3(-8.60f, 1.4f, -21.00f), Color.Red),
                new VertexPositionColor(new Vector3(-8.60f, 0f, -21.00f), Color.Red),
                new VertexPositionColor(new Vector3(-8.60f, 0f, -18.73f), Color.Red),
            });

            RoomIllusion1.Load(Content);
            SetDefaultSkinmeshLightning(RoomIllusion1.Model);

            NonEuclideanRenderFunctions.LoadSepShader(Content);

            pblack = new Texture2D(GraphicsDevice, 1, 1);
            pblack.SetData(new Color[] { Color.Black });
        }