{"id":20778026,"url":"https://github.com/stackgl/gl-post","last_synced_at":"2025-04-30T18:40:47.541Z","repository":{"id":23591557,"uuid":"26960097","full_name":"stackgl/gl-post","owner":"stackgl","description":"Simple WebGL post-processing using some pieces from stack.gl","archived":false,"fork":false,"pushed_at":"2014-11-21T13:06:07.000Z","size":211,"stargazers_count":14,"open_issues_count":3,"forks_count":2,"subscribers_count":11,"default_branch":"gh-pages","last_synced_at":"2025-04-16T11:26:40.140Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://stack.gl/gl-post","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-21T12:57:19.000Z","updated_at":"2022-02-26T17:30:33.000Z","dependencies_parsed_at":"2022-08-22T02:50:29.854Z","dependency_job_id":null,"html_url":"https://github.com/stackgl/gl-post","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-post","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-post/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-post/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-post/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackgl","download_url":"https://codeload.github.com/stackgl/gl-post/tar.gz/refs/heads/gh-pages","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251764388,"owners_count":21640053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T13:18:42.036Z","updated_at":"2025-04-30T18:40:47.504Z","avatar_url":"https://github.com/stackgl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gl-post\n![](http://img.shields.io/badge/stability-experimental-orange.svg?style=flat)\n![](http://img.shields.io/npm/v/gl-post.svg?style=flat)\n![](http://img.shields.io/npm/dm/gl-post.svg?style=flat)\n![](http://img.shields.io/npm/l/gl-post.svg?style=flat)\n\nSimple WebGL post-processing using some pieces from [stackgl](http://stack.gl/).\n\n**[check out the demo](http://stack.gl/gl-post)**.\n\n## Usage\n\n[![NPM](https://nodei.co/npm/gl-post.png)](https://nodei.co/npm/gl-post/)\n\nSee the [example](example) code for a full usage example.\n\n### `post = glPost(gl, shader, opts={})`\n\nCreates a new post-processing instance, where `gl` is a `WebGLContext` instance\nand `shader` is a shader instance from either\n[gl-shader-core](http://github.com/mikolalysenko/gl-shader-core) or\n[glslify](http://github.com/stackgl/glslify).\n\nThe vertex shader is supplied for you, and available at `gl-post/post.vert`.\nThe shader you pass in may also be a function that takes a `WebGLContext` and\nreturns a shader instance too, so the following is valid:\n\n``` javascript\nvar glslify = require('glslify')\nvar glPost  = require('gl-post')\n\npost = glPost(gl, glslify({\n    vert: 'gl-post'\n  , frag: './src/my-shader.frag'\n}))\n```\n\nThere are also a few options you can include too:\n\n* `minFilter`: the texture minification filter to use. Defaults to `gl.LINEAR`.\n* `magFilter`: the texture magnification filter to use. Defaults to `gl.LINEAR`.\n* `colorBufferName`: the name of your color buffer uniform to use in your\n  shader. Defaults to `colorBuffer`.\n\nIn simple cases, you'll want to do something like this:\n\n``` javascript\nvar glslify = require('glslify')\nvar glPost  = require('gl-post')\n\npost = glPost(gl, glslify({\n    vert: 'gl-post'\n  , frag: './src/my-shader.frag'\n}))\n\nfunction render() {\n  post.bind()\n\n  // Note that it's important you clear your\n  // depth/color buffers for this to work properly :)\n  gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)\n  gl.viewport(0, 0, canvas.width, canvas.height)\n\n  // ...draw your scene to the framebuffer here...\n\n  post.draw()\n}\n```\n\n### `post.shader`\n\nThe shader you gave `gl-post` will also be exposed here, for quickly changing\nuniform variable values.\n\n### `post.bind()`\n\nStarts drawing to the post-processing buffer. Anything you do now will not be\nimmediately drawn to the screen, but instead drawn to an off-screen\n[framebuffer](http://github.com/stackgl/gl-fbo) for you to draw later using\nthe post-processing shader.\n\nYou should this when you're ready to start drawing your scene.\n\n### `post.draw()`\n\nDraws the framebuffer to the screen using your shader, returning your drawing\npower to the screen in the process.\n\n### `post.unbind()`\n\nCall this if you want to explicitly disable rendering to the framebuffer before\ndrawing to the screen.\n\n## License\n\nMIT. See [LICENSE.md](http://github.com/stackgl/gl-post/blob/master/LICENSE.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fgl-post","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackgl%2Fgl-post","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fgl-post/lists"}