[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"github-stars":3,"guide-nav":5,"doc-\u002Fdocs\u002Fprimitives\u002Fnoise\u002Fdrapedfolds":155},{"stars":4},3547,[6,12,18,22,26,30,34,38,42,46,50,54,58,62,66,71,75,79,83,88,92,96,100,104,108,112,116,120,124,127,130,134,137,141,144,148,151],{"path":7,"title":8,"description":9,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide","Getting started","Shaders is a library of GPU effect components for Vue, React, Svelte, Solid, JavaScript and Framer, with a design editor for building with them.","code",null,{"path":13,"title":14,"description":15,"category":10,"exclude":16,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",[17],"js",{"path":19,"title":20,"description":21,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":23,"title":24,"description":25,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fblending-masking","Blending and masking","Control how a layer mixes with the layers below it, and reveal one layer through another.",{"path":27,"title":28,"description":29,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fprops-reactivity","Props and reactivity","Bind props to your framework's state so effects update when it changes, and animate props with an animation library.",{"path":31,"title":32,"description":33,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fdynamic-props","Dynamic props","Drive any numeric or position prop from time, the cursor, or another layer, without writing animation code.",{"path":35,"title":36,"description":37,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Flayout-positioning","Layout and positioning","Size and place a shader in your page with CSS, as a background, a fill, or an inline block.",{"path":39,"title":40,"description":41,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in % or px units.",{"path":43,"title":44,"description":45,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fshape-effects","Shape effects","Pick the 2D, 3D or custom SVG shape that Glass, Neon, Emboss and other shape effects draw inside.",{"path":47,"title":48,"description":49,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fcolor-space","Color space","Match colors to your design tool with the output color space, and keep bright layers from clipping with tone mapping.",{"path":51,"title":52,"description":53,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fhooks-events","Hooks and events","Run code when an effect is ready to show, and show a fallback when the GPU can't run it.",{"path":55,"title":56,"description":57,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fperformance","Performance","Learn what makes an effect expensive on the GPU and how to keep it inside the frame budget.",{"path":59,"title":60,"description":61,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fcustom-shaders","Custom components","Write your own component in TypeScript, use it like any component in the library, and write WGSL by hand when you need to.",{"path":63,"title":64,"description":65,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":67,"title":68,"description":69,"category":70,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fmcp","Shaders MCP","Connect your AI coding agent to Shaders so it can find, install and edit effects in your codebase.","workflows",{"path":72,"title":73,"description":74,"category":70,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fcli","Shaders CLI","Install shaders and presets into your codebase as component files, and keep them in sync with the design editor.",{"path":76,"title":77,"description":78,"category":70,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fagent-skill","Agent skill","Give your coding agent a skill that teaches it to build with Shaders components, the CLI and presets.",{"path":80,"title":81,"description":82,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fvideo-rendering","Rendering to video","Turn a shader effect into a video file, from the design editor or from a frame-by-frame pipeline such as Remotion, Hyperframes or Puppeteer.",{"path":84,"title":85,"description":86,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fquick-tour-of-the-design-editor","Quick tour of the design editor","A short walkthrough of the full Shaders workflow, from designing on the infinite canvas to exporting code.","editor",{"path":89,"title":90,"description":91,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fintro-to-the-interface","Intro to the interface","A tour of the design editor interface: the canvas, layers, the Properties panel, and the ways to share and export.",{"path":93,"title":94,"description":95,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fcomposing-your-first-shader-effect","Composing your first shader effect","Building a first shader effect in the design editor by stacking and nesting components as layers.",{"path":97,"title":98,"description":99,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fmasking-and-blending","Masking and blending","How blend modes and masks combine components in the design editor.",{"path":101,"title":102,"description":103,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fdynamic-prop-mapping","Dynamic prop mapping","Turning static props into dynamic ones in the design editor: mapping one layer's output into another's prop, following the cursor, or animating automatically.",{"path":105,"title":106,"description":107,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fcustom-media-and-transformations","Custom media and transformations","Uploading images, videos, and SVG files to the media gallery, adding them to a composition, and placing them with transformations.",{"path":109,"title":110,"description":111,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Finstalling-a-shader-via-mcp","Installing a shader via MCP","Installing a shader from the design editor into a hero section with the Shaders MCP.",{"path":113,"title":114,"description":115,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fexploring-shape-effects","Exploring shape effects","Applying shape effects such as liquid glass, liquid metal, and glowing edges to built-in shapes and your own SVG.",{"path":117,"title":118,"description":119,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fglass-component-spotlight","Component spotlight: Glass","A short look at the Glass component and the liquid-glass look it creates.",{"path":121,"title":122,"description":123,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fdigital-looks-component-spotlight","Component spotlight: Digital looks","A look at the digital stylization components for glitchy, futuristic, or technical effects.",{"path":125,"title":14,"description":126,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fjs\u002Fquickstart","Install Shaders without a framework, render your first effect on a canvas, and update props at runtime.",{"path":128,"title":14,"description":129,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Freact\u002Fquickstart","Install Shaders in a React app, render your first effect, and drive a prop from state.",{"path":131,"title":132,"description":133,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Freact\u002Fssr","Next.js and SSR","Render Shaders in Next.js and other React SSR apps by keeping each shader on the client.",{"path":135,"title":14,"description":136,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fsolid\u002Fquickstart","Install Shaders in a Solid app, render your first effect, and drive a prop from a signal.",{"path":138,"title":139,"description":140,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fsolid\u002Fssr","SolidStart and SSR","Render Shaders in SolidStart and other Solid SSR apps by keeping each shader on the client.",{"path":142,"title":14,"description":143,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fsvelte\u002Fquickstart","Install Shaders in a Svelte app, render your first effect, and drive a prop from state.",{"path":145,"title":146,"description":147,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fsvelte\u002Fssr","SvelteKit and SSR","Render Shaders in SvelteKit and other Svelte SSR apps, where each shader already waits for the browser.",{"path":149,"title":14,"description":150,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fvue\u002Fquickstart","Install Shaders in a Vue app, render your first effect, and drive a prop from a ref.",{"path":152,"title":153,"description":154,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fvue\u002Fssr","Nuxt and SSR","Render Shaders in Nuxt and other Vue SSR apps by keeping each shader on the client.",{"id":156,"title":157,"body":158,"categoryId":231,"categorySlug":231,"categoryTitle":537,"curated":538,"description":168,"editUrl":11,"extension":539,"group":540,"groupTitle":541,"kind":542,"meta":543,"navigation":544,"path":545,"seo":546,"sourceUrl":547,"stem":548,"wordCount":11,"__hash__":549},"primitives\u002Fdocs\u002Fprimitives\u002F12.noise\u002F34.drapedfolds.md","drapedFolds",{"type":159,"value":160,"toc":531},"minimark",[161,165,169,226,241,307,312,376,380,455,465,469,517,521,527],[162,163,157],"h1",{"id":164},"drapedfolds",[166,167,168],"p",{},"The height of a draped cloth at a point: rounded ridges running along one direction, each rippling and swaying along its length, gathered where the cloth is pinned.",[170,171,176],"pre",{"className":172,"code":173,"language":174,"meta":175,"style":175},"language-ts shiki shiki-themes github-dark","drapedFolds(\n  coords: {along: Expr | number; across: Expr | number},\n  folds: Fold[],\n  opts: DrapeOptions,\n): Expr\n","ts","",[10,177,178,190,208,214,220],{"__ignoreMap":175},[179,180,183,186],"span",{"class":181,"line":182},"line",1,[179,184,157],{"class":185},"svObZ",[179,187,189],{"class":188},"s95oV","(\n",[179,191,193,196,200,203,205],{"class":181,"line":192},2,[179,194,195],{"class":188},"  coords: {along: Expr ",[179,197,199],{"class":198},"snl16","|",[179,201,202],{"class":188}," number; across: Expr ",[179,204,199],{"class":198},[179,206,207],{"class":188}," number},\n",[179,209,211],{"class":181,"line":210},3,[179,212,213],{"class":188},"  folds: Fold[],\n",[179,215,217],{"class":181,"line":216},4,[179,218,219],{"class":188},"  opts: DrapeOptions,\n",[179,221,223],{"class":181,"line":222},5,[179,224,225],{"class":188},"): Expr\n",[166,227,228,229,232,233,236,237,240],{},"Import ",[10,230,231],{},"noise"," from ",[10,234,235],{},"shaders\u002Fstd"," and use ",[10,238,239],{},"noise.drapedFolds",".",[166,242,243,246,247,250,251,254,255,258,259,262,263,266,267,270,271,274,275,278,279,282,283,286,287,290,291,294,295,298,299,302,303,306],{},[10,244,245],{},"coords"," come from a ",[10,248,249],{},"directionFrame",": ",[10,252,253],{},"along"," runs 0 at the pinned edge to 1 at the free edge, ",[10,256,257],{},"across"," is the distance across the drape in the units ",[10,260,261],{},"foldSet"," laid the folds out in. ",[10,264,265],{},"ripple.waves"," is a ",[10,268,269],{},"wavyLine"," wave list each spine wanders by (every fold starts at its own phase) and ",[10,272,273],{},"ripple.gain"," scales it. ",[10,276,277],{},"sway"," moves all the folds together on the clock, like a breeze. ",[10,280,281],{},"swell"," makes each ridge rise and fall along its length so neighbours merge and part. ",[10,284,285],{},"pinning"," (0–1) gathers the folds at the pinned edge: narrow and still there, wide and free at the far edge. ",[10,288,289],{},"sharpness"," (default 2) is how tightly the ridge falls away and ",[10,292,293],{},"crease"," (0–1, default 0) flattens its crest into a plateau that meets the next fold in a tight valley: 0 is a round bell, 1 a flat face with a sharp crease. The result is a height in the units of each fold's ",[10,296,297],{},"height",". Take its slope with ",[10,300,301],{},"fdSlope"," or ",[10,304,305],{},"fdCurvature"," for relief.",[308,309,311],"h2",{"id":310},"parameters","Parameters",[313,314,315,331],"table",{},[316,317,318],"thead",{},[319,320,321,325,328],"tr",{},[322,323,324],"th",{},"Name",[322,326,327],{},"Type",[322,329,330],{},"Notes",[332,333,334,348,362],"tbody",{},[319,335,336,341,346],{},[337,338,339],"td",{},[10,340,245],{},[337,342,343],{},[10,344,345],{},"{along: Expr | number; across: Expr | number}",[337,347],{},[319,349,350,355,360],{},[337,351,352],{},[10,353,354],{},"folds",[337,356,357],{},[10,358,359],{},"Fold[]",[337,361],{},[319,363,364,369,374],{},[337,365,366],{},[10,367,368],{},"opts",[337,370,371],{},[10,372,373],{},"DrapeOptions",[337,375],{},[308,377,379],{"id":378},"example","Example",[170,381,383],{"className":172,"code":382,"language":174,"meta":175,"style":175},"const cloth = (at: Expr) => drapedFolds(drape.coordsOf(at), folds, {time: t, ripple: {waves: RIPPLE}, sway: {amount: breeze}, pinning: u.pinning})\nconst relief = fdCurvature(cloth, q, 0.004)\n",[10,384,385,434],{"__ignoreMap":175},[179,386,387,390,393,396,399,403,406,409,412,415,418,421,424,427,431],{"class":181,"line":182},[179,388,389],{"class":198},"const",[179,391,392],{"class":185}," cloth",[179,394,395],{"class":198}," =",[179,397,398],{"class":188}," (",[179,400,402],{"class":401},"s9osk","at",[179,404,405],{"class":198},":",[179,407,408],{"class":185}," Expr",[179,410,411],{"class":188},") ",[179,413,414],{"class":198},"=>",[179,416,417],{"class":185}," drapedFolds",[179,419,420],{"class":188},"(drape.",[179,422,423],{"class":185},"coordsOf",[179,425,426],{"class":188},"(at), folds, {time: t, ripple: {waves: ",[179,428,430],{"class":429},"sDLfK","RIPPLE",[179,432,433],{"class":188},"}, sway: {amount: breeze}, pinning: u.pinning})\n",[179,435,436,438,441,443,446,449,452],{"class":181,"line":192},[179,437,389],{"class":198},[179,439,440],{"class":429}," relief",[179,442,395],{"class":198},[179,444,445],{"class":185}," fdCurvature",[179,447,448],{"class":188},"(cloth, q, ",[179,450,451],{"class":429},"0.004",[179,453,454],{"class":188},")\n",[456,457,458],"blockquote",{},[166,459,460,464],{},[461,462,463],"strong",{},"Tip."," Keep the wave list and swell as constants next to the definition. They are the look.",[308,466,468],{"id":467},"see-also","See also",[470,471,472,490,498],"ul",{},[473,474,475,481,482,485,486,489],"li",{},[476,477,479],"a",{"href":478},"\u002Fdocs\u002Fprimitives\u002Fnoise\u002Ffoldset",[10,480,261],{}," — Lays out the ridges of a draped cloth: ",[10,483,484],{},"count"," folds spread evenly across ",[10,487,488],{},"spread",", each nudged sideways, widened and raised by a seeded amount so no two are alike.",[473,491,492,497],{},[476,493,495],{"href":494},"\u002Fdocs\u002Fprimitives\u002Fnoise\u002Fwavyline",[10,496,269],{}," — The height of an animated wavy line at a point along it: a stack of traveling sines.",[473,499,500,505,506,509,510,513,514,240],{},[476,501,503],{"href":502},"\u002Fdocs\u002Fprimitives\u002Fmaterials\u002Ffdslope",[10,504,301],{}," — The value and slope of any field at a point: ",[10,507,508],{},"value",", ",[10,511,512],{},"dx"," and ",[10,515,516],{},"dy",[308,518,520],{"id":519},"used-by","Used by",[166,522,523],{},[476,524,526],{"href":525},"\u002Fdocs\u002Fcomponents\u002Fsatin","Satin",[528,529,530],"style",{},"html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .s9osk, html code.shiki .s9osk{--shiki-default:#FFAB70}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}",{"title":175,"searchDepth":192,"depth":192,"links":532},[533,534,535,536],{"id":310,"depth":192,"text":311},{"id":378,"depth":192,"text":379},{"id":467,"depth":192,"text":468},{"id":519,"depth":192,"text":520},"Noise",false,"md","light","Noise, light & materials","function",{},true,"\u002Fdocs\u002Fprimitives\u002Fnoise\u002Fdrapedfolds",{"title":157,"description":168},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Fpaint\u002Fnoise.ts#L271","docs\u002Fprimitives\u002F12.noise\u002F34.drapedfolds","-K1q3lglczn2_9J0ItseHs9QCNp6as8qXt1F5Mb0nAc"]