Пример #1
0
        private void Glview_Load(object sender, EventArgs e)
        {
            ViewContext.VerifyContext(glview);
            ViewContext.Context.MakeCurrent(glview.WindowInfo);

            Log.Info("GL Version: " + OpenTK.Graphics.OpenGL.GL.GetString(OpenTK.Graphics.OpenGL.StringName.Version));
            IGL.Primary.PatchParameter((int)PatchParameterInt.PatchVertices, 3);
            IGL.Primary.Enable((int)EnableCap.DepthTest);
            IGL.Primary.Enable((int)EnableCap.Blend);
            IGL.Primary.DepthFunc((int)DepthFunction.Lequal);
            IGL.Primary.BlendFunc((int)BlendingFactor.SrcAlpha, (int)BlendingFactor.OneMinusSrcAlpha);
            IGL.Primary.Enable((int)EnableCap.CullFace);
            IGL.Primary.CullFace((int)CullFaceMode.Back);

            renderStack = new RenderStack();
            basePass    = new BasePass(null, glview.Width, glview.Height);
            bloomPass   = new BloomPass(glview.Width, glview.Height);
            renderStack.Add(basePass);
            renderStack.Add(bloomPass);

            LoadMeshes();

            Task.Run(async() =>
            {
                //initial hdri load
                await HdriManager.Load();
            });
        }
Пример #2
0
        private void Glview_Load(object sender, EventArgs e)
        {
            ViewContext.VerifyContext(glview);
            ViewContext.Context.MakeCurrent(glview.WindowInfo);

            GL.Enable(EnableCap.DepthTest);
            GL.Enable(EnableCap.Blend);
            GL.DepthFunc(DepthFunction.Lequal);
            GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);
            GL.Enable(EnableCap.CullFace);
            GL.CullFace(CullFaceMode.Back);

            LoadMeshes();

            lightColor    = new TK.Vector3(1, 1, 1);
            lightPosition = new TK.Vector3(0, 4, 4);

            Task.Run(async() =>
            {
                //initial hdri load
                await HdriManager.Load();
            });
        }