[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-111153":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":24,"topics":25,"createdAt":10,"pushedAt":34,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":15,"starSnapshotCount":15,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},111153,"noxe-pixel-engine","danieljan-design\u002Fnoxe-pixel-engine","danieljan-design","Real-time 3D dioramas rendered as pixel art in the browser, with time of day, weather, procedural sound and 60 fps MP4 export. three.js, no build step.","https:\u002F\u002Fpixel.noxestudio.com\u002F",null,"JavaScript",69,9,53,0,4,8,13,14,56.3,"MIT License",false,"main",true,[26,27,28,29,30,31,32,33],"isometric","javascript","pixel-art","procedural-generation","threejs","webaudio","webcodecs","webgl","2026-11-08 20:03:07","2026-11-23 09:27:30","# Noxe Pixel Engine\n\nReal-time 3D dioramas rendered as pixel art in the browser. Change the time of day and the weather, press a scene's own buttons, and export the result as a 60 fps MP4 with sound.\n\n**[Try the live demo](https:\u002F\u002Fpixel.noxestudio.com\u002F)**. Best in Chrome or Edge on a computer. Link straight to a scene with `?scene=Name`, for example [Streetcar](https:\u002F\u002Fpixel.noxestudio.com\u002F?scene=Streetcar).\n\n![The Alpine scene on a clear afternoon](docs\u002Fmedia\u002Fhero.png)\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd>\u003Cimg src=\"docs\u002Fmedia\u002Falpine.png\" alt=\"Alpine\">\u003C\u002Ftd>\n    \u003Ctd>\u003Cimg src=\"docs\u002Fmedia\u002Fstreetcar.png\" alt=\"Streetcar\">\u003C\u002Ftd>\n    \u003Ctd>\u003Cimg src=\"docs\u002Fmedia\u002Fstudio.png\" alt=\"Studio\">\u003C\u002Ftd>\n    \u003Ctd>\u003Cimg src=\"docs\u002Fmedia\u002Fferry.png\" alt=\"Ferry\">\u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd>\u003Cimg src=\"docs\u002Fmedia\u002Fcampsite.png\" alt=\"Campsite\">\u003C\u002Ftd>\n    \u003Ctd>\u003Cimg src=\"docs\u002Fmedia\u002Flookout.png\" alt=\"Lookout\">\u003C\u002Ftd>\n    \u003Ctd>\u003Cimg src=\"docs\u002Fmedia\u002Fmotel.png\" alt=\"Motel\">\u003C\u002Ftd>\n    \u003Ctd>\u003Cimg src=\"docs\u002Fmedia\u002Fcove.png\" alt=\"Cove\">\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\nEverything is code. The scenes are modelled procedurally with three.js and every sound is synthesised in the browser, so there are no image, model or audio files to load, and no build step.\n\n## Features\n\n- **Pixel art renderer.** Each frame renders at low resolution with toon lighting and hard shadows, then gets depth outlines, edge highlights, glow, fog, colour grading and colour quantising with an ordered dither before a nearest-neighbour blow-up. The orthographic camera snaps to whole pixels, so still scenes never shimmer.\n- **Time of day.** Dawn, day, dusk and night with a moving sun and moon, stars, the Milky Way and aurora. Lamps and windows switch on as it gets dark.\n- **Weather.** Clear, cloudy, rain, storm with lightning, snow that settles on everything, and fog, all blending into each other over a few seconds.\n- **Reflections.** Planar mirror reflections on lakes, harbours and wet streets.\n- **Sound.** Wind, rain (outdoors, or on the roof for indoor scenes), water, birds, crickets and thunder, plus each scene's own sounds: a streetcar bell, a ferry horn, a loon, a bear's roar.\n- **Clip export.** Renders offline at a locked 60 fps with the sound in sync and writes a standard MP4 (H.264 + AAC) that X and other platforms accept as is. 16:9, square and portrait, at twice the output size (4K for 16:9).\n\n## Run it\n\nYou need Python 3 and a recent Chrome or Edge (the MP4 export uses WebCodecs).\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fdanieljan-design\u002Fnoxe-pixel-engine.git\ncd noxe-pixel-engine\npython3 tools\u002Fserve.py\n```\n\nThen open http:\u002F\u002Flocalhost:5184. Any static file server works. `tools\u002Fserve.py` just turns off browser caching, so your edits always show up on reload.\n\n## Controls\n\n| Key | Action |\n|---|---|\n| 1 to 4 | Dawn, day, dusk, night |\n| 5 to 0 | Clear, cloudy, rain, storm, snow, fog |\n| Q W E | The scene's own buttons |\n| [ and ] | Previous and next scene |\n| C | Let the day run |\n| Space | Pause |\n| G | Render the scene's demo clip |\n| T | Start or stop a take (your own sequence, re-rendered offline) |\n| R | Live recording |\n| P | Save a PNG |\n| H \u002F U | Hide the settings panel \u002F the on-stage controls |\n\nDrag to turn the camera, scroll to zoom. Open a scene directly with `?scene=Name`, and add `&clean=1` to ignore saved settings.\n\nOn a phone held upright the scene fills the screen. Tabs at the bottom switch between time, sky and the scene's own buttons, the round buttons play the day and turn on sound, and the button in the top corner opens the settings.\n\n## Scenes\n\n| Scene | Opens on | Buttons (Q W E) |\n|---|---|---|\n| Alpine | Rockies valley on a clear afternoon: banded peaks, glacier and waterfall, a turquoise lake that mirrors the peaks, log cabin, campfire, a grizzly that wanders and fishes | Bear (rears, roars, catches a fish), Fire, Alpenglow |\n| Streetcar | Toronto intersection on a rainy night: streetcar on the wire, traffic lights, neon, wet reflections, cutaway subway station | Streetcar, Subway, Neon |\n| Studio | Noxe Studio loft, evening rain: desk and monitor, cat on the sill, posters, turntable, clock that follows the hour | Vinyl (lofi + crackle), Lamp, Screen |\n| Ferry | Toronto harbour at sunset: island ferry, skyline that lights up window by window, needle tower | Fireworks, Horn, Skyline |\n| Campsite | Algonquin lake point at night: tent, campfire, canoe, white pines, loon, Milky Way | Stoke, Aurora, Loon |\n| Lookout | Fire lookout above a sea of clouds at golden hour, far peaks, eagle | Clouds, Lantern |\n| Motel | Desert motel at dusk with the sign off: highway, pool, buttes | Neon (sign ignites), Truck |\n| Cove | The first test scene: lighthouse, cottage, pier | Lighthouse, Horn |\n\n## Recording\n\nAll clips are standard MP4 files (H.264 + AAC, index first) and land in your Downloads folder.\n\n- **Demo clip (G)** renders the scene's storyboard, its signature moment, offline at 60 fps with sound. No dropped frames, however slow the machine.\n- **Take (T)**: press T, play the scene with the buttons and keys, press T again. The take is re-rendered exactly, offline.\n- **Live record (R)** records the canvas in real time. **Record with panel** captures the stage with the on-stage controls and tab audio. Chrome asks which tab to share: pick this one.\n- **Output size** is under Scene > output: 16:9 (1920×1080), 4:5 (1080×1350), 1:1 (1080×1080) and 9:16. Clips render at twice that size with twice the pixel size (16:9 comes out 3840×2160): the same art pixel for pixel, and X's 1080p copy of the file is an exact half, so every art pixel still lands on whole pixels there.\n- **Social kit.** With the save endpoint running (`python3 tools\u002Fsave-endpoint.py`), `await __pixel.kit()` in the browser console renders every scene's demo clip as 16:9 and 1:1 MP4 (3840×2160, 2160×2160) and a hero photo as 4:5 and 1:1 PNG (2160×2700, 2160×2160) into `exports\u002F`. Square and portrait frames use pixel size 3 (6 in the 2× files) with the camera fitted to the diorama.\n- `tools\u002Ffmp4-to-mp4.py` rewrites a fragmented MP4 (from Chrome's MediaRecorder or a screen recorder) as a standard one without re-encoding.\n\n## How it works\n\n1. The scene renders at low resolution (output size ÷ pixel size, e.g. 480×270) into an HDR colour buffer, view normals and depth.\n2. Glow: anything brighter than \"glow from\" (lamps, fireflies, the lighthouse) is blurred at half and quarter resolution.\n3. Composite at low resolution: sky gradient and stars, outlines where depth jumps, edge highlights on convex creases, glow, fog, tone and grade, then colour quantising (levels or a palette) with a 4×4 ordered dither.\n4. Nearest-neighbour blow-up to the output size. The orthographic camera snaps to whole pixels so still scenes never shimmer. Camera elevation 30° gives clean 2:1 pixel lines.\n\nMaterials are three.js toon materials patched by the engine: stepped light ramps, surface texture noise, wind sway, snow that settles on upward faces, wet darkening in rain, drifting cloud shadows, lamps that switch on at dusk, and water with depth colour, foam, rain rings and glints.\n\nThe environment runs time-of-day keyframes (sun or moon key light, ambient, sky, grade) and weather presets (clear, cloudy, rain, storm, snow, fog) that blend over a few seconds: rain streaks and splashes, snow, clouds, fireflies, lightning with thunder.\n\n## Making a scene\n\n`scenes\u002F\u003Cfile>.js` default-exports a definition. Register it in `SCENES` in `app.js`, and add a storyboard to `CLIPS` for its demo clip. `scenes\u002Fplaceholder.js` is a plain grass block to start from.\n\n```js\nexport default {\n  name: 'Ferry',                       \u002F\u002F label on the control bar\n  view: { target: [x, y, z], size, azimuth: 45, elevation: 30 },   \u002F\u002F orthographic iso camera\n  look: { pixelSize: 4, quantize: 'levels', levels: 14, saturation: 1.1, bloom: 1.0, ... },  \u002F\u002F see defaultLook()\n  env: { hour: 19.5, weather: 'clear' },   \u002F\u002F starting state\n  audio: { water: 0.6, birds: 1, crickets: 1, foghorn: 0 },   \u002F\u002F ambience levels 0..1\n  mirror: { y: 0 },                    \u002F\u002F optional planar reflection plane (water, wet streets)\n  sky: { moon: 1, milky: 0.6, aurora: 0, moonPos: [0.82, 0.8] },  \u002F\u002F night sky extras\n  wind: [0.85, 0.53],                  \u002F\u002F optional wind direction (x, z)\n  actionsLabel: 'Ferry',               \u002F\u002F optional label for the scene button group\n  create({ engine, env, audio }) {\n    return {\n      root,                             \u002F\u002F THREE.Group with everything\n      info: { size, top, bottom, surfaceAt(x, z), isLand(x, z), weather? },  \u002F\u002F where weather lands\n      update(t, dt, env) {},            \u002F\u002F every frame, t = env.time\n      actions: [{ id, label, icon: [9 strings of 9 chars, '#' = pixel], run(env, audio), active?() }],  \u002F\u002F 1 to 3 on-stage buttons (keys Q W E)\n      onClick(raycaster, env) {},       \u002F\u002F optional\n    };\n  },\n};\n```\n\n`info.weather = { cx, cz, w, d, top, bottom, snowScale, splash }` limits rain, splashes and snow to a box.\n`audio.rain: 'roof'` plays rain as heard from inside (muffled bed, taps on the roof, gutter drip, ticks on the glass, quieter wind), and `audio.rainLevel` (default 1) scales all rain sound for the scene.\nFor square and portrait exports the camera is fitted to the scene's silhouette. If a backdrop runs off the 16:9 frame (like the Lookout's cloud sea), add a `FIT` override in `app.js`.\n\n### Materials (`engine\u002Fmaterials.js`)\nBuild solid things with `toon(color, options)`: `vertexColors`, `ramp` ('soft', 'hard', 'foliage', 'flat'),\n`noise`\u002F`noiseScale` (surface texture), `snow`\u002F`wet` (0..1 how much weather shows), `wind` (sway, scales with local height above y = 0),\n`emissive` + `emissiveIntensity` (HDR above ~2.4 glows), `lamp: true` (emissive only at dusk, night and in storms), `glow` (multiplier, animate with `setGlow(mat, v)`),\n`water: true` (+ shallow, deep, foam, deepAt; needs an `aDepth` attribute, use `kit.water()`),\n`mirror: true` (+ reflect, reflectWet, puddles; needs the scene `mirror` plane; the surface must sit on that plane),\n`windows: { size: [w, h], frac: [x, y], base, top, lit, warm, cool, glass, power }` (procedural lit window grid on vertical faces, windows switch on one by one as lamps come up).\n`fxMaterial({ vertexShader, fragmentShader, uniforms, blending })` for particles and beams; they never get outlines.\nShared uniforms (`shared.uTime`, `uWind`, `uWindStrength`, `uLamps`, `uDaylight`...) can be passed to effect shaders.\n\n### Kits\n- `scenes\u002Fkit.js`: `rng`, `noise2`, `smoothstep`, `paint`, `merge`, `mergeGroup` (one mesh per material for a static group or a vehicle, big draw-call saver), `jitter`, `mesh`, `lampLight` + `updateLamps` (point lights that follow env.lamps), `terrain` (stepped diorama block, strata, `cutouts` for cutaway holes), `water`, `pineGeometry`, `bushGeometry`, `rockGeometry`, `grass`, `flowers`, `glass` (lamp glass), `cottage`, `lighthouse`, `pier`, `boat`, `lampPost`, `fence`, `crate`, `barrel`, `smoke`, `disposeTree`.\n- `scenes\u002Fkit-people.js`: `person(rand, { coat, pants, skin, hair, umbrella, hat, scale, pose })`, `walker(obj, points, { speed, mode, heightAt, dwell })` (also moves vehicles and boats).\n- `scenes\u002Fkit-city.js`: `building` (window grid, shopfront, awning), `car`, `neon` + `neonFlicker`, `trafficLight`, `hydrant`, `bench`, `bin`.\n- The `*-parts.js` files next to each scene hold its builders (trees, boulders, fire, canoe, bear...), and other scenes can import them.\n\n### Sound (`engine\u002Faudio.js`)\nOne-shots: `audio.play(name, opts)` with bell, horn, loon, boom, whoosh, typing, tick, eagle, coyote, gull, rumble, spark, owl, chord, thunder.\nLoops: `audio.setLoop(name, level)` with traffic, hum, fire, vinyl, lofi, howl, cicadas, buzz. Everything is silent until Sound is on.\n\n### Scale and readability\nAt 1920×1080 with pixel size 4 and frame size ~17, one world unit is about 15 pixels. Anything thinner than ~0.07 units disappears.\nKeep silhouettes bold, and keep text and real logos out of scenes.\n\n### Review tools (browser console)\n`__pixel.advance(seconds)` steps the world and renders (background tabs barely animate on their own).\n`await __pixel.sheet(name, [[hour, weather, seconds, fn?], ...])` renders a grid of states to `exports\u002F\u003Cname>.png`, and\n`await __pixel.still(name, hour, weather)` saves one full frame. Both need the save endpoint: `python3 tools\u002Fsave-endpoint.py` (port 5185).\n`__pixel.load(name)` switches scene, and `__pixel.def` is the current scene definition.\n\n### Performance\nAim for under 16 ms a frame. Every mesh costs a draw call in up to three passes (shadow, reflection, main), so merge static\nclusters and vehicles with `mergeGroup`, share materials, and use InstancedMesh for repeats. The engine already skips tiny,\nnon-glowing details in the reflection and shadow passes, and `userData.noMirror` keeps anything out of reflections.\n\n## Project structure\n\n- `index.html`, `app.js`: the page, scene switching, the on-stage controls, the settings panel and the export tools\n- `engine\u002Fpixel-engine.js`: render pipeline and camera\n- `engine\u002Fshaders.js`: post-process GLSL\n- `engine\u002Fmaterials.js`: toon material patch, shared uniforms, effects material\n- `engine\u002Fenvironment.js`: time of day, weather and effects\n- `engine\u002Faudio.js`: procedural ambience and sound effects\n- `engine\u002Fexporter.js`: offline 60 fps export (WebCodecs) and the MP4 writer\n- `engine\u002Frecorder.js`: live recording and the fragmented-to-standard MP4 rewrite\n- `engine\u002Fpalettes.js`: palette generation for the palette colour mode\n- `scenes\u002F`: the scenes, their parts and the shared kits\n- `tools\u002F`: the no-cache dev server, the save endpoint for review images, the MP4 rewriter\n- `exports\u002F`: renders and review images (ignored by git)\n\n## Credits\n\n- [three.js](https:\u002F\u002Fthreejs.org) and [lil-gui](https:\u002F\u002Flil-gui.georgealways.com), both MIT licensed, loaded from the jsDelivr CDN.\n- Nunito, Outfit and IBM Plex Mono from Google Fonts, under the SIL Open Font License.\n\n## License\n\nMIT, see [LICENSE](LICENSE). Made by Daniel Jankulovski at [Noxe Studio](https:\u002F\u002Fnoxestudio.com).\n","Noxe Pixel Engine 是一个在浏览器中实时渲染像素风3D微缩场景（diorama）的Web图形引擎。它基于three.js实现无构建步骤的纯前端运行，支持动态昼夜循环、多种天气系统（雨\u002F雪\u002F雷暴\u002F雾）、程序化生成音效（Web Audio API）、平面镜面反射，并可导出60fps同步音画的MP4视频（通过WebCodecs）。所有视觉与音频内容均实时合成，无需加载外部资源。适用于像素艺术创作、交互式数字叙事、游戏原型演示及教育类3D可视化等轻量级Web端创意场景。",2,"2026-11-24 04:40:15","CREATED_QUERY"]