{"id":48913930,"url":"https://github.com/jannchie/shader-gradient","last_synced_at":"2026-04-21T05:01:21.980Z","repository":{"id":351855562,"uuid":"1210666509","full_name":"Jannchie/shader-gradient","owner":"Jannchie","description":"Animated shader gradients inspired by ruucm/shadergradient, rebuilt around a framework-agnostic core.","archived":false,"fork":false,"pushed_at":"2026-04-19T08:48:25.000Z","size":223,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-20T04:02:54.975Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://jannchie.github.io/shader-gradient","language":"TypeScript","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/Jannchie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-14T16:31:38.000Z","updated_at":"2026-04-19T08:48:29.000Z","dependencies_parsed_at":"2026-04-20T04:01:10.527Z","dependency_job_id":null,"html_url":"https://github.com/Jannchie/shader-gradient","commit_stats":null,"previous_names":["jannchie/shader-gradient"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Jannchie/shader-gradient","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jannchie%2Fshader-gradient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jannchie%2Fshader-gradient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jannchie%2Fshader-gradient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jannchie%2Fshader-gradient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jannchie","download_url":"https://codeload.github.com/Jannchie/shader-gradient/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jannchie%2Fshader-gradient/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32077837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T02:38:07.213Z","status":"ssl_error","status_checked_at":"2026-04-21T02:38:06.559Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-04-17T01:04:28.216Z","updated_at":"2026-04-21T05:01:21.821Z","avatar_url":"https://github.com/Jannchie.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shader-gradient\n\nAnimated shader gradients inspired by [`ruucm/shadergradient`](https://github.com/ruucm/shadergradient), rebuilt around a framework-agnostic core.\n\nThis project keeps the visual direction and much of the public API shape that made the original project great, but moves the rendering engine into a plain TypeScript package so you can use it without React.\n\n## Why This Project\n\n- `@shader-gradient/core` works directly with DOM + Three.js, so React is not required.\n- `@shader-gradient/react` and `@shader-gradient/vue` are thin bindings on top of the same renderer.\n- Presets, query-string serialization, camera controls, HDR environments, and shader families are shared across packages.\n- A playground is included for tuning, sharing, and exporting configurations.\n\n## Credit\n\nThis project would not exist without the excellent work in [`ruucm/shadergradient`](https://github.com/ruucm/shadergradient).\n\n- Visual direction and overall API inspiration come from that repository.\n- Several behaviors in this project intentionally follow the original package closely so migration and comparison are easier.\n- If you want the original React-first implementation, please support and explore the upstream project directly.\n\nThis repository is an independent reimplementation and is not an official fork or affiliated package.\n\n## Packages\n\n- `@shader-gradient/core`\n  Framework-agnostic renderer.\n- `@shader-gradient/react`\n  React bindings with `\u003cShaderGradientCanvas /\u003e` and `\u003cShaderGradient /\u003e`.\n- `@shader-gradient/vue`\n  Vue bindings with the same nested canvas API.\n- `@shader-gradient/playground`\n  Local playground used for tuning and export.\n\n## Install\n\n### Core\n\n```bash\nnpm install @shader-gradient/core\n```\n\n### React\n\n```bash\nnpm install @shader-gradient/react react react-dom\n```\n\n### Vue\n\n```bash\nnpm install @shader-gradient/vue vue\n```\n\n## Core Usage\n\n```ts\nimport { ShaderGradient } from '@shader-gradient/core'\n\nconst container = document.querySelector('#shader-gradient')\n\nif (!container) {\n  throw new Error('Missing #shader-gradient container.')\n}\n\nconst gradient = new ShaderGradient(container, {\n  preset: 'pensive',\n  type: 'sphere',\n  shader: 'defaults',\n  lightType: 'env',\n  envPreset: 'city',\n})\n\ngradient.update({\n  grain: true,\n  grainBlending: 0.3,\n})\n\n// Later\ngradient.dispose()\n```\n\n## React Usage\n\n```tsx\nimport { ShaderGradient, ShaderGradientCanvas } from '@shader-gradient/react'\n\nexport function HeroGradient() {\n  return (\n    \u003cShaderGradientCanvas\n      style={{ width: '100%', height: '100%' }}\n      pixelDensity={1.5}\n      fov={45}\n    \u003e\n      \u003cShaderGradient\n        preset=\"halo\"\n        type=\"plane\"\n        shader=\"defaults\"\n        grain=\"on\"\n      /\u003e\n    \u003c/ShaderGradientCanvas\u003e\n  )\n}\n```\n\n## Vue Usage\n\n```vue\n\u003cscript setup lang=\"ts\"\u003e\nimport { ShaderGradient, ShaderGradientCanvas } from '@shader-gradient/vue'\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cShaderGradientCanvas\n    :pixel-density=\"1.5\"\n    :fov=\"45\"\n    style=\"width: 100%; height: 100%;\"\n  \u003e\n    \u003cShaderGradient\n      preset=\"mint\"\n      type=\"waterPlane\"\n      shader=\"defaults\"\n    /\u003e\n  \u003c/ShaderGradientCanvas\u003e\n\u003c/template\u003e\n```\n\n## Features\n\n- Presets such as `halo`, `pensive`, `mint`, `interstella`, and more\n- Shader families: `defaults`, `positionMix`, `cosmic`, `glass`, `lava`, `aurora`, `marble`, `pulse`\n- Mesh types: `plane`, `sphere`, `waterPlane`\n- Query-string import/export\n- Camera controls and camera parameter serialization\n- HDR environment presets: `city`, `dawn`, `lobby`\n- Grain post-processing\n- Shared configuration model across core, React, and Vue\n\n## Query String Support\n\nYou can serialize the current configuration and restore it later:\n\n```ts\nimport {\n  parseShaderGradientQuery,\n  serializeShaderGradientOptions,\n} from '@shader-gradient/core'\n\nconst query = serializeShaderGradientOptions({\n  preset: 'halo',\n  grain: true,\n  grainBlending: 0.25,\n})\n\nconst parsed = parseShaderGradientQuery(query)\n```\n\n## Original Shaders \u0026 Presets\n\nIn addition to the shaders ported from the upstream project, this repository includes several original shader families and presets:\n\n### Original Shaders\n\n| Shader | Description |\n|--------|-------------|\n| `lava` | Molten lava with domain-warped FBM flow, Voronoi crust cracks, and subsurface glow |\n| `aurora` | Northern-lights curtains built from layered FBM bands, vertical fade, and shimmer |\n| `marble` | Organic stone / fluid-art veining via double domain warping and polished surface sheen |\n| `pulse` | Cyberpunk energy rings with multi-center wave interference, scanlines, and beat pulses |\n\n#### Design Notes\n\n- **Aurora** draws on the natural shape of real aurora borealis — light curtains that hang vertically and ripple horizontally. Technically it stretches multi-layer FBM noise along the horizontal axis to form \"curtains\", applies a vertical gradient fade to simulate light draping down from the sky, and overlays a high-frequency noise layer for fine shimmer.\n- **Marble** leverages the well-known observation that double domain warping (warping already-warped coordinates) naturally produces organic, marble-like veining — a technique widely discussed in Inigo Quilez's articles on domain distortion. Sharp vein edges are carved out with `smoothstep`, and a subtle rim sheen mimics the look of polished stone.\n- **Pulse** starts from a simple physics idea: what if ripples on water were made of light? Multiple moving wave centers create an interference pattern; `smoothstep` sharpens the rings, and additive scanlines plus a `pow`-driven beat pulse push the result toward a cyberpunk aesthetic.\n- **Lava** combines domain-warped FBM for molten flow with Voronoi distance fields for cooling crust cracks. Hot magma glows through the cracks via an inverted Voronoi edge mask, and a pulsing heat term keeps the surface alive.\n\n### Original Presets\n\n| Preset | Shader | Mesh | Palette |\n|--------|--------|------|---------|\n| `lavaFlow` | lava | waterPlane | Deep purple / crimson |\n| `borealis` | aurora | waterPlane | Green / cyan / purple |\n| `deepOcean` | aurora | sphere | Navy / teal / seafoam |\n| `silkRoad` | marble | plane | Ivory / gold / dark walnut |\n| `jade` | marble | sphere | Emerald / mint / forest green |\n| `neonGrid` | pulse | waterPlane | Magenta / cyan / midnight blue |\n| `heartbeat` | pulse | sphere | Red / pink / dark crimson |\n\n## Local Development\n\n```bash\npnpm install\npnpm dev\n```\n\n## Build\n\n```bash\npnpm build\npnpm typecheck\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjannchie%2Fshader-gradient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjannchie%2Fshader-gradient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjannchie%2Fshader-gradient/lists"}