{"id":"recursive-portal","version":"1.0.0","title":"Recursive Portal","summary":"Doorways inside doorways spiral away into a glowing depth, falling in at a steady rate. Loops perfectly.","kind":"background","target":"three","collections":["backgrounds","hypnotic-loops"],"tags":["portal","doorway","droste effect","recursion","infinite","fractal","tunnel","spiral","glow","loop"],"loopable":true,"motion":"procedural","durationSeconds":10,"status":"published","media":{"poster":"https://aipixelwizard.com/media/recursive-portal/1.0.0/poster.webp","preview":"https://aipixelwizard.com/media/recursive-portal/1.0.0/preview.mp4","sample":"https://aipixelwizard.com/media/recursive-portal/1.0.0/sample.mp4","sampleBytes":1476465,"sampleNote":"Pre-rendered with the default settings. Customised settings must be exported locally (npm run render)."},"urls":{"page":"https://aipixelwizard.com/visuals/recursive-portal","manifest":"https://aipixelwizard.com/api/v1/visuals/recursive-portal/versions/1.0.0","agentMd":"https://aipixelwizard.com/registry/recursive-portal/1.0.0/agent.md","files":"https://aipixelwizard.com/registry/recursive-portal/1.0.0/","demo":"https://aipixelwizard.com/registry/recursive-portal/1.0.0/index.html"},"description":"A doorway with a smaller copy of itself in its opening, and another in that, receding into an endless glowing depth. The whole picture falls in towards the middle at a steady rate, one copy of the doorway passing into the next every loop, and each level turns a little more than the one before, so the corridor spirals as it goes. Doorways can be arches, rectangles or circles. Choose the shape, the colours (ember, ocean, violet or mono), how much smaller each doorway is than the last, the twist per level, the frame thickness and the brightness.","role":"Shader background (three.js): an infinite-depth Droste corridor for fantasy, portal and transition content.","useCases":["A fantasy, gateway or \"enter the next chapter\" transition","A title backdrop with infinite depth","A hypnotic self-similar loop"],"synonyms":["recursive door","infinite doorway","droste","infinity corridor","door within a door","fractal portal"],"digest":"3bc799e0ae1c6d2420f8018aa73aaf690260cdf90ccfa4ad20d83304a50deddc","implementation":{"target":"three","runtime":"browser","language":"javascript","module":"esm","entry":"src/recursive-portal.js","exports":[{"name":"createRecursivePortal","signature":"createRecursivePortal({ shape?, palette?, ratio?, twist?, frame?, brightness? }) => { scene, camera, setSize(width, height), update(time, loopSeconds), dispose() }","description":"The corridor as one full-screen shader; render its scene with its camera, ideally through createBloomPass."},{"name":"createBloomPass","signature":"createBloomPass(renderer, { width, height, glow?, exposure?, grain? }) => { render(scene, camera, output?), dispose() }","description":"A small bloom with tone mapping and a fixed grain."},{"name":"PALETTES","signature":"PALETTES: { ember, ocean, violet, mono }","description":"Wall, depth, frame and glow colours."}],"reusable":["src/recursive-portal.js"],"demo":"demo.js","harness":"index.html"},"dependencies":[{"id":"three","version":"0.185.1","scope":"source","reason":"Renderer and a full-screen shader material."},{"id":"apw-runtime","version":"1.0.0","scope":"demo","reason":"Demo harness."}],"uses":[],"usedBy":[],"params":[{"key":"shape","label":"Doorway","type":"select","default":"arch","options":[{"value":"arch","label":"Arch"},{"value":"rect","label":"Rectangle"},{"value":"round","label":"Circle"}]},{"key":"palette","label":"Colours","type":"select","default":"ember","options":[{"value":"ember","label":"Ember"},{"value":"ocean","label":"Ocean"},{"value":"violet","label":"Violet"},{"value":"mono","label":"Mono"}]},{"key":"ratio","label":"Shrink per level","type":"number","min":0.4,"max":0.8,"step":0.05,"default":0.6},{"key":"twist","label":"Twist","help":"Turn per level, in radians; negative spirals the other way.","type":"number","min":-0.8,"max":0.8,"step":0.05,"default":0.25},{"key":"frame","label":"Frame thickness","type":"number","min":0.4,"max":2,"step":0.1,"default":1},{"key":"brightness","label":"Brightness","type":"number","min":0.6,"max":1.6,"step":0.1,"default":1}],"presets":[{"id":"default","label":"Ember arch","params":{}},{"id":"ocean","label":"Ocean, round, strong twist","params":{"palette":"ocean","shape":"round","twist":0.6}},{"id":"violet","label":"Violet rectangle","params":{"palette":"violet","shape":"rect","twist":0.1,"ratio":0.7}},{"id":"mono","label":"Mono, reverse twist","params":{"palette":"mono","twist":-0.4,"frame":1.6}}],"output":{"width":1080,"height":1080,"fps":30,"durationSeconds":10,"posterSeconds":2,"alpha":false,"motion":"procedural","loop":{"seamless":true,"cycleSeconds":10,"method":"The picture is the same after one step of shrinking by the ratio and turning by the twist; over the loop it shrinks and turns by exactly one step, and the number of levels is set from the ratio so the same set of levels is always drawn, so the last frame meets the first."},"seed":null},"composition":{"inputs":"Time within the loop; the doorway shape, colours, ratio, twist, frame thickness and brightness.","outputs":"A full-frame shader image through a bloom pass.","coordinates":"Screen-centred, ±1 vertically; every doorway is centred on the origin; level n has scale ratio^n and turns n × twist.","lighting":"Self-lit: walls shade towards the frame, frames are bevelled, and a glow sits at the far end; the bloom adds to it.","timing":"update(time, loopSeconds) sets the loop phase; frames render in any order.","compatibleWith":["kinetic-title","number-reveal"],"notes":["Colour depends only on a level's scale, never on its index, which is what makes the loop exact."]},"reuse":["Fantasy transition: Ember arch.","Sci-fi: Ocean, round, strong twist.","Clean: Violet rectangle."],"integration":{"newProject":"Create a WebGLRenderer, createRecursivePortal() and createBloomPass(renderer, { width, height }); call portal.setSize(w, h) and each frame portal.update(time, loopSeconds) then bloom.render(portal.scene, portal.camera).","existingProject":"Copy src/recursive-portal.js and render portal.scene with portal.camera into your own target."},"performance":{"notes":"One full-screen fragment shader with up to 33 levels per pixel (13 at the default ratio), plus the bloom: a couple of milliseconds a frame at 1080² on an integrated Intel GPU.","limits":"Software WebGL renders in about two seconds a frame."},"limitations":["It is a flat self-similar picture, not a 3D corridor: there is no parallax.","Very high ratios (0.75 and above) draw many levels and are slower."],"license":{"spdx":"MIT","notice":"Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder.","thirdParty":[]},"rights":{"approvedForPublicRelease":true},"provenance":"Adapted from the owner's threejs-sketches/abstract-artistic/recursive-portal (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original shader: a Droste-style self-similar corridor whose colour depends only on scale, falling in by exactly one step per loop, on an exact loop.","changelog":[{"version":"1.0.0","date":"2026-10-05","notes":"Initial release."}],"verification":{"testedOn":"2026-10-06","inputs":{"recursive-portal@1.0.0":"3bc799e0ae1c6d2420f8018aa73aaf690260cdf90ccfa4ad20d83304a50deddc","three@0.185.1":"664ca387e5fab46ff2daaa6895e1d015426850891af5ea5082cbbcc3985b068c","apw-runtime@1.0.0":"5be859cdac74823ba0bcc32c6daf06688a871104d24db5d4ceaffffd84d7c40d"},"environment":"Chrome 154.0.8037.97 headless on Linux 7.0.0-38-generic (x64), Node 22.14.0","renderer":"WebGL 2 via SwiftShader (software)","width":1080,"height":1080,"fps":30,"frames":300,"renderSeconds":963.7,"loopCheck":{"checked":true,"seamless":true,"maxDifference":0,"note":"Frame 0 vs end state (progress 1): mean |Δ| 0.0000, max |Δ| 0 of 255."},"determinism":{"checked":true,"identical":true},"errors":[],"media":{"poster":"/media/recursive-portal/1.0.0/poster.webp","preview":"/media/recursive-portal/1.0.0/preview.mp4","sample":"/media/recursive-portal/1.0.0/sample.mp4","sampleBytes":1476465}},"files":[{"path":"LICENSE","size":1072,"sha256":"8a5f3a96f07e11522ec4bdd0a583356f99bad1245920f9709cee09b995a45153","contentType":"text/plain; charset=utf-8","url":"https://aipixelwizard.com/registry/recursive-portal/1.0.0/LICENSE"},{"path":"asset.json","size":8073,"sha256":"7c842a6dd47d6bd08bf873d53b8f32f39eedd1e7f8cd2ed01f84ecb9cca4d796","contentType":"application/json; charset=utf-8","url":"https://aipixelwizard.com/registry/recursive-portal/1.0.0/asset.json"},{"path":"demo.js","size":1051,"sha256":"5a8baf1865b0147a4dae2b17f1227bad5e54f544d2a62c132c60e23c63178eed","contentType":"text/javascript; charset=utf-8","url":"https://aipixelwizard.com/registry/recursive-portal/1.0.0/demo.js"},{"path":"index.html","size":530,"sha256":"a0e9bef8a176ce5c4da796a9fc23639e34a2af6d2392b689ad36399af61639a7","contentType":"text/html; charset=utf-8","url":"https://aipixelwizard.com/registry/recursive-portal/1.0.0/index.html"},{"path":"src/recursive-portal.js","size":11650,"sha256":"543df529cc864feb02cd41bdf43c894aaf9e02681ae95c703b92695445bd8ffc","contentType":"text/javascript; charset=utf-8","url":"https://aipixelwizard.com/registry/recursive-portal/1.0.0/src/recursive-portal.js"}],"warnings":[]}