コード例 #1
0
ファイル: Shaders.cs プロジェクト: ebrucucen/MonoAGS
        private static void setVignetteResolution()
        {
            var resolution = AGSGame.Game.Settings.WindowSize;

            _vignetteShader.Compile();
            _vignetteShader.Bind();
            _vignetteShader.SetVariable("resolution", resolution.Width, resolution.Height);
        }
コード例 #2
0
        protected override void OnLoad(EventArgs e)
        {
            //Create the shader
            Shader = new Shaders.PlaneShader();
            //Compile it
            Shader.Compile();

            //Set light direction
            Shader.SetParameter("LightDir", new Vector3(0, 0.5f, 0.5f));

            //Create buffers
            CreateBuffers();
            //Create vertex array object
            CreateVAO();

            GL.Enable(EnableCap.DepthTest);
            GL.ClearColor(0.0f, 0.0f, 0.0f, 1f);
            //GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Line);
            //GL.Enable(EnableCap.CullFace);
            GL.FrontFace(FrontFaceDirection.Cw);
        }