{"id":18438904,"url":"https://github.com/alfa256/aframe-mirror-component","last_synced_at":"2026-03-17T13:49:17.304Z","repository":{"id":23380403,"uuid":"98822720","full_name":"alfa256/aframe-mirror-component","owner":"alfa256","description":"Mirror effect material that works with snapshots of the scene for A-Frame","archived":false,"fork":false,"pushed_at":"2022-06-02T02:16:13.000Z","size":274,"stargazers_count":31,"open_issues_count":4,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T00:51:19.561Z","etag":null,"topics":["aframevr","threejs","vr","webvr"],"latest_commit_sha":null,"homepage":null,"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/alfa256.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-30T20:23:20.000Z","updated_at":"2023-10-24T11:00:09.000Z","dependencies_parsed_at":"2022-08-20T15:10:21.179Z","dependency_job_id":null,"html_url":"https://github.com/alfa256/aframe-mirror-component","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/alfa256%2Faframe-mirror-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfa256%2Faframe-mirror-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfa256%2Faframe-mirror-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfa256%2Faframe-mirror-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alfa256","download_url":"https://codeload.github.com/alfa256/aframe-mirror-component/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247732588,"owners_count":20986892,"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":["aframevr","threejs","vr","webvr"],"created_at":"2024-11-06T06:22:27.561Z","updated_at":"2026-03-17T13:49:17.252Z","avatar_url":"https://github.com/alfa256.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## aframe-mirror-component\n\n[![Version](http://img.shields.io/npm/v/aframe-mirror-component.svg?style=flat-square)](https://npmjs.org/package/aframe-mirror-component)\n[![License](http://img.shields.io/npm/l/aframe-mirror-component.svg?style=flat-square)](https://npmjs.org/package/aframe-mirror-component)\n\nMirror effect material that works with THREE.CubeCamera snapshots of the scene.\n\nAdd it to a mesh and it will change its material for a mirror like effect.\n\nIf you use it let me know, I'm @alfredofrlp on twitter.\n\nFor [A-Frame](https://aframe.io).\n\n[LIVE DEMO](https://alfa256.github.io/aframe-mirror-component/examples/basic/)\n : WASD + mouse to look around.\n\n![Screenshot](./mirror.png \"Multiple instances of the component.\")\n\n### API\n\n| Property   | Description                  | Default Value |\n| ---------- | ---------------------------- | ------------- |\n| color      | material color               | #ffffff       |\n| resolution | CubeCamera resolution        | 128           |\n| refraction | material refractionRatio     | 0.95          |\n| distance   | CubeCamera render distance   | 3000          |\n| interval   | snapshot interval            | 1000 ms       |\n| repeat     | take snapshot every interval | false         |\n\nFor a realtime mirror effect I suggest a low resolution ( 32 or 64 ) and an interval of 150 to 300, low distance also helps.\nResolution needs to be a power of 2: 8, 16, 32, 64, 128 ...\n\n#### Browser\n\nInstall and use by directly including the [browser files](dist):\n\n```html\n\u003chead\u003e\n  \u003ctitle\u003eMy A-Frame Scene\u003c/title\u003e\n  \u003cscript src=\"https://aframe.io/releases/0.6.0/aframe.min.js\"\u003e\u003c/script\u003e\n  \u003cscript src=\"https://unpkg.com/aframe-mirror-component/dist/aframe-mirror-component.min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n  \u003ca-scene\u003e\n    \u003ca-sphere mirror\u003e\u003c/a-sphere\u003e\n  \u003c/a-scene\u003e\n\u003c/body\u003e\n```\n\n\u003c!-- If component is accepted to the Registry, uncomment this. --\u003e\n\u003c!--\nOr with [angle](https://npmjs.com/package/angle/), you can install the proper\nversion of the component straight into your HTML file, respective to your\nversion of A-Frame:\n\n```sh\nangle install aframe-mirror-component\n```\n--\u003e\n\n#### npm\n\nInstall via npm:\n\n```bash\nnpm install aframe-mirror-component\n```\n\nThen require and use.\n\n```js\nrequire('aframe');\nrequire('aframe-mirror-component');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfa256%2Faframe-mirror-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falfa256%2Faframe-mirror-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfa256%2Faframe-mirror-component/lists"}