{"id":20778128,"url":"https://github.com/stackgl/gl-texture2d-pip","last_synced_at":"2025-04-30T18:41:30.255Z","repository":{"id":57251360,"uuid":"43344701","full_name":"stackgl/gl-texture2d-pip","owner":"stackgl","description":":black_square_button: Preview the contents of a set of gl-texture instances alongside your main render pass.","archived":false,"fork":false,"pushed_at":"2015-09-29T04:38:23.000Z","size":272,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-08-08T20:56:17.757Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://stack.gl/gl-texture2d-pip/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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":"2015-09-29T04:26:24.000Z","updated_at":"2022-02-26T17:29:39.000Z","dependencies_parsed_at":"2022-08-24T17:01:29.048Z","dependency_job_id":null,"html_url":"https://github.com/stackgl/gl-texture2d-pip","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-texture2d-pip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-texture2d-pip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-texture2d-pip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-texture2d-pip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackgl","download_url":"https://codeload.github.com/stackgl/gl-texture2d-pip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225041085,"owners_count":17411590,"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:19:24.041Z","updated_at":"2024-11-17T13:19:24.725Z","avatar_url":"https://github.com/stackgl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gl-texture2d-pip\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nPreview the contents of a set of gl-texture instances alongside your main render pass. Useful for debugging framebuffer operations, especially in the case of deferred rendering.\n\n[![gl-texture2d-pip](http://i.imgur.com/xCNJDQe.gif)](http://stack.gl/gl-texture2d-pip/)\n\n[**view demo**](http://stack.gl/gl-texture2d-pip/)\n\n## Usage\n\n[![NPM](https://nodei.co/npm/gl-texture2d-pip.png)](https://www.npmjs.com/package/gl-texture2d-pip)\n\n### `glTexture2dPIP(textures)`\n\nTakes an array of `textures`, where each element is an instance of [gl-texture2d](http://github.com/stackgl/gl-texture2d), and draws them to the canvas.\n\nNote that this will update your context's GL state, namely:\n\n* Disabling `gl.CULL_FACE` and `gl.DEPTH_TEST`.\n* Changing the viewport.\n* Disabling the currently bound framebuffer.\n\nYou'll generally want to run this as the very last operation in your render loop.\n\n``` javascript\nconst pip = require('gl-texture2d-pip')\n\nconst fbo1 = FBO(gl, [512, 512])\nconst fbo2 = FBO(gl, [512, 512])\nconst fbo3 = FBO(gl, [512, 512])\n\nfunction render () {\n  // ...update your fbo instances here...\n\n  pip([\n    fbo1.color[0],\n    fbo2.color[0],\n    fbo3.color[0]\n  ])\n}\n```\n\nFor a full usage example, see the demo code available in [demo/index.js](http://github.com/stackgl/gl-texture2d-pip/blob/master/demo/index.js)\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/stackgl/gl-texture2d-pip/blob/master/LICENSE.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fgl-texture2d-pip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackgl%2Fgl-texture2d-pip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fgl-texture2d-pip/lists"}