public void OnLoad()
        {
            arialFont                 = new FontData("Arial", "./Game/Fonts/Arial.fnt", 1024);
            arialFontMaterial         = new Material(new UIShader(arialFont.TextureId), false, false, false);
            invertColorPostProcessing = new InvertedColorPostProcessing();
            engineStartTime           = DateTime.UtcNow;

            light        = new Light(new Vector3d(10000000, 10000000, 10000000), new Vector3d(0, 1, 0), 100000000, 3f);
            mainLight    = new Light(new Vector3d(-10000000, 10000000, 10000000), new Vector3d(1, 0, 0), 100000000, 3f);
            anotherLight = new Light(new Vector3d(0, -10000000, 10000000), new Vector3d(0, 0, 1), 100000000, 3f);
            camera       = new Camera(RenderDataLoader.GenerateFrameBuffer(), RenderDataLoader.GenerateTexture(), RenderDataLoader.GenerateRenderBuffer())
            {
                Position       = new Vector3d(0, 0, 5),
                Rotation       = new Vector3d(0, 0, 0),
                FarPlane       = 1000f,
                NearPlane      = 0.01f,
                FOV            = 60,
                IsPerspective  = true,
                ViewPortOffset = Vector2.Zero,
                ViewPortSize   = Vector2.One,
                ClearColor     = new Vector4(0.2f, 0.2f, 0.2f, 1f)
            };

            secondCamera = new Camera(RenderDataLoader.GenerateFrameBuffer(), RenderDataLoader.GenerateTexture(), RenderDataLoader.GenerateRenderBuffer())
            {
                Position       = new Vector3d(0, 0, 0),
                Rotation       = new Vector3d(0, 0, 0),
                FarPlane       = 1000f,
                NearPlane      = 0.01f,
                FOV            = 60,
                IsPerspective  = true,
                ViewPortOffset = Vector2.One * -0.5f,
                ViewPortSize   = Vector2.One * 0.5f,
                ClearColor     = new Vector4(0, 0, 0, 0),
                PostProcessing = new Material(invertColorPostProcessing, false, false, false)
            };

            treeMesh = OBJLoader.LoadObjModel("Tree");

            treeTexture      = RenderDataLoader.LoadTexture("Tree");
            standardMaterial = new Material(new StaticShader(treeTexture), true, true, false);
            uiMaterial       = new Material(new UIShader(treeTexture), false, false, false);
        }
Пример #2
0
        public FontData(string textureLocation, string fontLocation, int resolution)
        {
            TextureId = RenderDataLoader.LoadTexture(textureLocation);

            ParseFontFile(fontLocation, resolution);
        }