CSharpGL.Demos.SimpleComputeRenderer.DoRender C# (CSharp) Метод

DoRender() защищенный Метод

protected DoRender ( RenderEventArgs arg ) : void
arg RenderEventArgs
Результат void
        protected override void DoRender(RenderEventArgs arg)
        {
            // reset image
            computeResetProgram.Bind();
            OpenGL.BindImageTexture(0, outputImage.Id, 0, false, 0, OpenGL.GL_WRITE_ONLY, OpenGL.GL_RGBA32F);
            OpenGL.GetDelegateFor<OpenGL.glDispatchCompute>()(maxX, maxY, maxZ);
            computeResetProgram.Unbind();

            // Activate the compute program and bind the output texture image
            computeProgram.Bind();
            OpenGL.BindImageTexture(0, outputImage.Id, 0, false, 0, OpenGL.GL_WRITE_ONLY, OpenGL.GL_RGBA32F);
            OpenGL.GetDelegateFor<OpenGL.glDispatchCompute>()(GroupX, GroupY, GroupZ);
            computeProgram.Unbind();

            mat4 model = mat4.identity();
            mat4 view = arg.Camera.GetViewMatrix();
            mat4 projection = arg.Camera.GetProjectionMatrix();
            this.SetUniform("modelMatrix", model);
            this.SetUniform("viewMatrix", view);
            this.SetUniform("projectionMatrix", projection);

            base.DoRender(arg);
        }