Example #1
0
        public override void Init()
        {
            base.Init();
            glEnable(GL_DEPTH_TEST);
            glClearColor(0.2f, 0.2f, 0.2f, 0.0f);
            shaders.Init();
            //progTeapot = new OglProgram("./teapot.vert", "./teapot.frag");
            teapotModel        = Parser.CreateDefault().Run("/data/teapot.obj");
            teapotVertexArrays = new List <Mesh>(teapotModel.meshDict.Values).ConvertAll(mesh => create(mesh));

            texRemilia = Texture.Create("/data/remilia.jpg");

            gBuffer = new GBuffer();
            gBuffer.Init(1920, 1080);
            gBuffer.clearOption.color.Set(0.0f, 0.0f, 0.0f, 0.0f);

            viewRects.Add(CreateRect(-1, -0.02f, 0.02f, 1));
            viewRects.Add(CreateRect(0.02f, 1, 0.02f, 1));
            viewRects.Add(CreateRect(-1, -0.02f, -1, -0.02f));
            viewRects.Add(CreateRect(0.02f, 1, -1, -0.02f));
            //progRect = new OglProgram("./rect.vert", "rect.frag");
            //progDeferred = new OglProgram("./deferred.vert", "./deferred.frag");
            Input.RegisterHandler(new CameraFirstPersonInputController(camera, true)); //new CameraFirstPersonController.InputHandler(controller: fpController, camera: camera, mouseLookEnable: true));
        }