{"id":20778069,"url":"https://github.com/stackgl/gl-compare","last_synced_at":"2026-03-16T17:36:18.622Z","repository":{"id":66140274,"uuid":"20805625","full_name":"stackgl/gl-compare","owner":"stackgl","description":"Visually compare two webgl render loops on the fly","archived":false,"fork":false,"pushed_at":"2015-12-23T15:40:45.000Z","size":88,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-06-19T19:57:05.043Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://stack.gl/gl-compare","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-06-13T13:48:24.000Z","updated_at":"2022-02-26T17:29:24.000Z","dependencies_parsed_at":"2023-02-20T00:00:39.797Z","dependency_job_id":null,"html_url":"https://github.com/stackgl/gl-compare","commit_stats":null,"previous_names":["gl-modules/gl-compare"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/stackgl/gl-compare","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-compare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-compare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-compare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-compare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackgl","download_url":"https://codeload.github.com/stackgl/gl-compare/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-compare/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264578048,"owners_count":23631475,"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:58.882Z","updated_at":"2026-03-16T17:36:18.574Z","avatar_url":"https://github.com/stackgl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gl-compare [![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)\n\nVisually compare two WebGL render loops on the fly by drawing them to an FBO\nand diffing them with shaders.\n\n[![gl-compare](http://imgur.com/zVtYFax.jpg)](http://gl-modules.github.io/gl-compare)\n\n## Usage\n\n[![NPM](https://nodei.co/npm/gl-compare.png)](https://nodei.co/npm/gl-compare/)\n\n### comparison = compare(gl, actual, expected)\nCreates a comparison renderer.\n\n* `gl` is the WebGL context.\n* `actual(fbo)` is the first render loop to run.\n* `expected(fbo)` is the second render loop to run.\n\nNote that these are both running within the same context – generally, this won't\nbe a problem if you're cleaning up after yourself, but keep that in mind. Also\nnote that instead of using:\n\n``` javascript\ngl.bindFramebuffer(gl.FRAMEBUFFER, null)\n```\n\nYou should use:\n\n``` javascript\nfbo.bind()\n```\n\nWhere `fbo` is the first argument passed to the render loop. If you'd like to\nresize your FBOs to match the size of the canvas:\n\n``` javascript\nfunction actual(fbo) {\n  fbo.shape = [canvas.height, canvas.width]\n}\n\nfunction expected(fbo) {\n  fbo.shape = [canvas.height, canvas.width]\n}\n```\n\n### comparison.run()\nRenders the `actual` and `expected` loops to their respective FBOs. Should be\ncalled before you call `comparison.render`.\n\n### comparison.render()\nRenders the comparison to your screen.\n\n### comparison.mode\nThe mode of comparison – may be set to one of the following:\n\n* `diff`: RGB color difference.\n* `onion`: blending between `actual` and `expected`.\n* `slide`: a slider that divides `actual` and `expected`.\n\n### comparison.amount\nUsed to vary the amount of diffing to do for each mode, and can be any value\nbetween 0 and 1. Has the following effects:\n\n* `diff`: 0 will amplify *any* difference considerably, whereas 1 will dull the\n  difference to only show the most significant changes.\n* `onion`: 0 will display `expected`, 1 will display `actual`, and any values\n  in between will be a mixture of both.\n* `slide`: 0 will display `expected`, 1 will display `actual`, and any values\n  in between will move the slider from the left of the buffer to the right.\n\n## License\n\nMIT. See [LICENSE.md](http://github.com/gl-modules/gl-compare/blob/master/LICENSE.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fgl-compare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackgl%2Fgl-compare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fgl-compare/lists"}