[{"data":1,"prerenderedAt":1721},["ShallowReactive",2],{"navigation":3,"\u002Fapi\u002Fwebgpu":213,"\u002Fapi\u002Fwebgpu-surround":1716},[4,14,203],{"title":5,"path":6,"stem":7,"children":8},"Introduction","\u002Fgetting-started","1.getting-started\u002F1.index",[9,10],{"title":5,"path":6,"stem":7},{"title":11,"path":12,"stem":13},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation",{"title":15,"path":16,"stem":17,"children":18},"Api","\u002Fapi","2.api",[19,22,148,178],{"title":20,"path":16,"stem":21},"API Reference","2.api\u002Findex",{"title":23,"path":24,"stem":25,"children":26},"Pmndrs Effects","\u002Fapi\u002Fpmndrs","2.api\u002F1.pmndrs\u002Findex",[27,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144],{"title":23,"path":24,"stem":25},{"title":29,"path":30,"stem":31},"ASCII","\u002Fapi\u002Fpmndrs\u002Fascii","2.api\u002F1.pmndrs\u002Fascii",{"title":33,"path":34,"stem":35},"Barrel Blur","\u002Fapi\u002Fpmndrs\u002Fbarrel-blur","2.api\u002F1.pmndrs\u002Fbarrel-blur",{"title":37,"path":38,"stem":39},"Bloom","\u002Fapi\u002Fpmndrs\u002Fbloom","2.api\u002F1.pmndrs\u002Fbloom",{"title":41,"path":42,"stem":43},"Brightness & Contrast","\u002Fapi\u002Fpmndrs\u002Fbrightness-contrast","2.api\u002F1.pmndrs\u002Fbrightness-contrast",{"title":45,"path":46,"stem":47},"Chromatic Aberration","\u002Fapi\u002Fpmndrs\u002Fchromatic-aberration","2.api\u002F1.pmndrs\u002Fchromatic-aberration",{"title":49,"path":50,"stem":51},"Color Average","\u002Fapi\u002Fpmndrs\u002Fcolor-average","2.api\u002F1.pmndrs\u002Fcolor-average",{"title":53,"path":54,"stem":55},"Color Depth","\u002Fapi\u002Fpmndrs\u002Fcolor-depth","2.api\u002F1.pmndrs\u002Fcolor-depth",{"title":57,"path":58,"stem":59},"Depth of Field","\u002Fapi\u002Fpmndrs\u002Fdepth-of-field","2.api\u002F1.pmndrs\u002Fdepth-of-field",{"title":61,"path":62,"stem":63},"Dot Screen","\u002Fapi\u002Fpmndrs\u002Fdot-screen","2.api\u002F1.pmndrs\u002Fdot-screen",{"title":65,"path":66,"stem":67},"Fish Eye","\u002Fapi\u002Fpmndrs\u002Ffish-eye","2.api\u002F1.pmndrs\u002Ffish-eye",{"title":69,"path":70,"stem":71},"FXAA","\u002Fapi\u002Fpmndrs\u002Ffxaa","2.api\u002F1.pmndrs\u002Ffxaa",{"title":73,"path":74,"stem":75},"Glitch","\u002Fapi\u002Fpmndrs\u002Fglitch","2.api\u002F1.pmndrs\u002Fglitch",{"title":77,"path":78,"stem":79},"God Rays","\u002Fapi\u002Fpmndrs\u002Fgod-rays","2.api\u002F1.pmndrs\u002Fgod-rays",{"title":81,"path":82,"stem":83},"Grid","\u002Fapi\u002Fpmndrs\u002Fgrid","2.api\u002F1.pmndrs\u002Fgrid",{"title":85,"path":86,"stem":87},"Hue & Saturation","\u002Fapi\u002Fpmndrs\u002Fhue-saturation","2.api\u002F1.pmndrs\u002Fhue-saturation",{"title":89,"path":90,"stem":91},"Kuwahara","\u002Fapi\u002Fpmndrs\u002Fkuwahara","2.api\u002F1.pmndrs\u002Fkuwahara",{"title":93,"path":94,"stem":95},"Lens Distortion","\u002Fapi\u002Fpmndrs\u002Flens-distortion","2.api\u002F1.pmndrs\u002Flens-distortion",{"title":97,"path":98,"stem":99},"Linocut","\u002Fapi\u002Fpmndrs\u002Flinocut","2.api\u002F1.pmndrs\u002Flinocut",{"title":101,"path":102,"stem":103},"N8AO","\u002Fapi\u002Fpmndrs\u002Fn8ao","2.api\u002F1.pmndrs\u002Fn8ao",{"title":105,"path":106,"stem":107},"Noise","\u002Fapi\u002Fpmndrs\u002Fnoise","2.api\u002F1.pmndrs\u002Fnoise",{"title":109,"path":110,"stem":111},"Outline","\u002Fapi\u002Fpmndrs\u002Foutline","2.api\u002F1.pmndrs\u002Foutline",{"title":113,"path":114,"stem":115},"Pixelation","\u002Fapi\u002Fpmndrs\u002Fpixelation","2.api\u002F1.pmndrs\u002Fpixelation",{"title":117,"path":118,"stem":119},"Scanline","\u002Fapi\u002Fpmndrs\u002Fscanline","2.api\u002F1.pmndrs\u002Fscanline",{"title":121,"path":122,"stem":123},"Sepia","\u002Fapi\u002Fpmndrs\u002Fsepia","2.api\u002F1.pmndrs\u002Fsepia",{"title":125,"path":126,"stem":127},"Shock Wave","\u002Fapi\u002Fpmndrs\u002Fshock-wave","2.api\u002F1.pmndrs\u002Fshock-wave",{"title":129,"path":130,"stem":131},"SMAA","\u002Fapi\u002Fpmndrs\u002Fsmaa","2.api\u002F1.pmndrs\u002Fsmaa",{"title":133,"path":134,"stem":135},"Texture","\u002Fapi\u002Fpmndrs\u002Ftexture","2.api\u002F1.pmndrs\u002Ftexture",{"title":137,"path":138,"stem":139},"Tilt Shift","\u002Fapi\u002Fpmndrs\u002Ftilt-shift","2.api\u002F1.pmndrs\u002Ftilt-shift",{"title":141,"path":142,"stem":143},"ToneMapping","\u002Fapi\u002Fpmndrs\u002Ftone-mapping","2.api\u002F1.pmndrs\u002Ftone-mapping",{"title":145,"path":146,"stem":147},"Vignette","\u002Fapi\u002Fpmndrs\u002Fvignette","2.api\u002F1.pmndrs\u002Fvignette",{"title":149,"path":150,"stem":151,"children":152},"Three Native Effects","\u002Fapi\u002Fthree","2.api\u002F2.three\u002Findex",[153,154,157,161,164,168,171,174],{"title":149,"path":150,"stem":151},{"title":73,"path":155,"stem":156},"\u002Fapi\u002Fthree\u002Fglitch","2.api\u002F2.three\u002Fglitch",{"title":158,"path":159,"stem":160},"Halftone","\u002Fapi\u002Fthree\u002Fhalftone","2.api\u002F2.three\u002Fhalftone",{"title":101,"path":162,"stem":163},"\u002Fapi\u002Fthree\u002Fn8ao","2.api\u002F2.three\u002Fn8ao",{"title":165,"path":166,"stem":167},"Output","\u002Fapi\u002Fthree\u002Foutput","2.api\u002F2.three\u002Foutput",{"title":113,"path":169,"stem":170},"\u002Fapi\u002Fthree\u002Fpixelation","2.api\u002F2.three\u002Fpixelation",{"title":129,"path":172,"stem":173},"\u002Fapi\u002Fthree\u002Fsmaa","2.api\u002F2.three\u002Fsmaa",{"title":175,"path":176,"stem":177},"Unreal Bloom","\u002Fapi\u002Fthree\u002Funreal-bloom","2.api\u002F2.three\u002Funreal-bloom",{"title":179,"path":180,"stem":181,"children":182},"WebGPU","\u002Fapi\u002Fwebgpu","2.api\u002F3.webgpu\u002Findex",[183,184,187,190,193,197,200],{"title":179,"path":180,"stem":181},{"title":37,"path":185,"stem":186},"\u002Fapi\u002Fwebgpu\u002Fbloom","2.api\u002F3.webgpu\u002Fbloom",{"title":45,"path":188,"stem":189},"\u002Fapi\u002Fwebgpu\u002Fchromatic-aberration","2.api\u002F3.webgpu\u002Fchromatic-aberration",{"title":57,"path":191,"stem":192},"\u002Fapi\u002Fwebgpu\u002Fdepth-of-field","2.api\u002F3.webgpu\u002Fdepth-of-field",{"title":194,"path":195,"stem":196},"Film","\u002Fapi\u002Fwebgpu\u002Ffilm","2.api\u002F3.webgpu\u002Ffilm",{"title":69,"path":198,"stem":199},"\u002Fapi\u002Fwebgpu\u002Ffxaa","2.api\u002F3.webgpu\u002Ffxaa",{"title":129,"path":201,"stem":202},"\u002Fapi\u002Fwebgpu\u002Fsmaa","2.api\u002F3.webgpu\u002Fsmaa",{"title":204,"path":205,"stem":206,"children":207},"Advanced","\u002Fadvanced","3.advanced\u002Findex",[208,209],{"title":204,"path":205,"stem":206},{"title":210,"path":211,"stem":212},"You might not need post-processing","\u002Fadvanced\u002Fyou-might-not-need-post-processing","3.advanced\u002Fyou-might-not-need-post-processing",{"id":214,"title":179,"body":215,"description":1710,"extension":1711,"links":1712,"meta":1713,"navigation":385,"path":180,"seo":1714,"stem":181,"__hash__":1715},"docs\u002F2.api\u002F3.webgpu\u002Findex.md",{"type":216,"value":217,"toc":1702},"minimark",[218,238,262,267,524,528,634,637,646,649,652,655,678,692,707,741,748,761,764,768,779,980,983,990,1055,1072,1096,1109,1116,1131,1339,1343,1349,1356,1688,1698],[219,220,221,225,226,229,230,233,234,237],"p",{},[222,223,224],"code",{},"@tresjs\u002Fpost-processing\u002Fwebgpu"," composes TSL effects with three's ",[222,227,228],{},"RenderPipeline",". Use it with the ",[222,231,232],{},"TresCanvas"," from ",[222,235,236],{},"@tresjs\u002Fcore\u002Fwebgpu",".",[239,240,241],"note",{},[219,242,243,246,247,250,251,254,255,258,259,261],{},[222,244,245],{},"\u002Fwebgpu"," needs ",[222,248,249],{},"three"," r183 or newer and ",[222,252,253],{},"@tresjs\u002Fcore"," v5.11 or newer (for ",[222,256,257],{},"useRenderPipeline","). The root entry still supports ",[222,260,249],{}," r169 and newer.",[263,264,266],"h2",{"id":265},"usage","Usage",[268,269,274],"pre",{"className":270,"code":271,"language":272,"meta":273,"style":273},"language-vue shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Cscript setup lang=\"ts\">\nimport { TresCanvas } from '@tresjs\u002Fcore\u002Fwebgpu'\nimport { Bloom, EffectComposer, SMAA } from '@tresjs\u002Fpost-processing\u002Fwebgpu'\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003CTresCanvas :antialias=\"false\">\n    \u003C!-- Your scene -->\n\n    \u003CEffectComposer>\n      \u003CBloom :strength=\"1\" :threshold=\"0.8\" \u002F>\n      \u003CSMAA \u002F>\n    \u003C\u002FEffectComposer>\n  \u003C\u002FTresCanvas>\n\u003C\u002Ftemplate>\n","vue","",[222,275,276,311,339,370,380,387,397,423,430,435,446,486,495,505,515],{"__ignoreMap":273},[277,278,281,285,289,293,296,299,302,306,308],"span",{"class":279,"line":280},"line",1,[277,282,284],{"class":283},"sMK4o","\u003C",[277,286,288],{"class":287},"swJcz","script",[277,290,292],{"class":291},"spNyl"," setup",[277,294,295],{"class":291}," lang",[277,297,298],{"class":283},"=",[277,300,301],{"class":283},"\"",[277,303,305],{"class":304},"sfazB","ts",[277,307,301],{"class":283},[277,309,310],{"class":283},">\n",[277,312,314,318,321,325,328,331,334,336],{"class":279,"line":313},2,[277,315,317],{"class":316},"s7zQu","import",[277,319,320],{"class":283}," {",[277,322,324],{"class":323},"sTEyZ"," TresCanvas",[277,326,327],{"class":283}," }",[277,329,330],{"class":316}," from",[277,332,333],{"class":283}," '",[277,335,236],{"class":304},[277,337,338],{"class":283},"'\n",[277,340,342,344,346,349,352,355,357,360,362,364,366,368],{"class":279,"line":341},3,[277,343,317],{"class":316},[277,345,320],{"class":283},[277,347,348],{"class":323}," Bloom",[277,350,351],{"class":283},",",[277,353,354],{"class":323}," EffectComposer",[277,356,351],{"class":283},[277,358,359],{"class":323}," SMAA",[277,361,327],{"class":283},[277,363,330],{"class":316},[277,365,333],{"class":283},[277,367,224],{"class":304},[277,369,338],{"class":283},[277,371,373,376,378],{"class":279,"line":372},4,[277,374,375],{"class":283},"\u003C\u002F",[277,377,288],{"class":287},[277,379,310],{"class":283},[277,381,383],{"class":279,"line":382},5,[277,384,386],{"emptyLinePlaceholder":385},true,"\n",[277,388,390,392,395],{"class":279,"line":389},6,[277,391,284],{"class":283},[277,393,394],{"class":287},"template",[277,396,310],{"class":283},[277,398,400,403,405,408,411,413,415,419,421],{"class":279,"line":399},7,[277,401,402],{"class":283},"  \u003C",[277,404,232],{"class":287},[277,406,407],{"class":283}," :",[277,409,410],{"class":291},"antialias",[277,412,298],{"class":283},[277,414,301],{"class":283},[277,416,418],{"class":417},"sfNiH","false",[277,420,301],{"class":283},[277,422,310],{"class":283},[277,424,426],{"class":279,"line":425},8,[277,427,429],{"class":428},"sHwdD","    \u003C!-- Your scene -->\n",[277,431,433],{"class":279,"line":432},9,[277,434,386],{"emptyLinePlaceholder":385},[277,436,438,441,444],{"class":279,"line":437},10,[277,439,440],{"class":283},"    \u003C",[277,442,443],{"class":287},"EffectComposer",[277,445,310],{"class":283},[277,447,449,452,454,456,459,461,463,467,469,471,474,476,478,481,483],{"class":279,"line":448},11,[277,450,451],{"class":283},"      \u003C",[277,453,37],{"class":287},[277,455,407],{"class":283},[277,457,458],{"class":291},"strength",[277,460,298],{"class":283},[277,462,301],{"class":283},[277,464,466],{"class":465},"sbssI","1",[277,468,301],{"class":283},[277,470,407],{"class":283},[277,472,473],{"class":291},"threshold",[277,475,298],{"class":283},[277,477,301],{"class":283},[277,479,480],{"class":465},"0.8",[277,482,301],{"class":283},[277,484,485],{"class":283}," \u002F>\n",[277,487,489,491,493],{"class":279,"line":488},12,[277,490,451],{"class":283},[277,492,129],{"class":287},[277,494,485],{"class":283},[277,496,498,501,503],{"class":279,"line":497},13,[277,499,500],{"class":283},"    \u003C\u002F",[277,502,443],{"class":287},[277,504,310],{"class":283},[277,506,508,511,513],{"class":279,"line":507},14,[277,509,510],{"class":283},"  \u003C\u002F",[277,512,232],{"class":287},[277,514,310],{"class":283},[277,516,518,520,522],{"class":279,"line":517},15,[277,519,375],{"class":283},[277,521,394],{"class":287},[277,523,310],{"class":283},[263,525,527],{"id":526},"effects","Effects",[529,530,531,547],"table",{},[532,533,534],"thead",{},[535,536,537,541,544],"tr",{},[538,539,540],"th",{},"Effect",[538,542,543],{},"Stage",[538,545,546],{},"Wraps",[548,549,550,566,580,594,608,621],"tbody",{},[535,551,552,558,561],{},[553,554,555],"td",{},[556,557,37],"a",{"href":185},[553,559,560],{},"HDR",[553,562,563],{},[222,564,565],{},"BloomNode",[535,567,568,573,575],{},[553,569,570],{},[556,571,572],{"href":188},"ChromaticAberration",[553,574,560],{},[553,576,577],{},[222,578,579],{},"ChromaticAberrationNode",[535,581,582,587,589],{},[553,583,584],{},[556,585,586],{"href":191},"DepthOfField",[553,588,560],{},[553,590,591],{},[222,592,593],{},"DepthOfFieldNode",[535,595,596,600,603],{},[553,597,598],{},[556,599,194],{"href":195},[553,601,602],{},"LDR",[553,604,605],{},[222,606,607],{},"FilmNode",[535,609,610,614,616],{},[553,611,612],{},[556,613,69],{"href":198},[553,615,602],{},[553,617,618],{},[222,619,620],{},"FXAANode",[535,622,623,627,629],{},[553,624,625],{},[556,626,129],{"href":201},[553,628,602],{},[553,630,631],{},[222,632,633],{},"SMAANode",[219,635,636],{},"The prop names and defaults follow the three TSL node, not the WebGL components. A WebGL prop is missing when the TSL node has no parameter for it. Each effect page lists the differences and the reason for each.",[219,638,639,640,237],{},"For an effect that is not in the list, write your own with ",[556,641,643],{"href":642},"#defineeffect",[222,644,645],{},"defineEffect",[263,647,443],{"id":648},"effectcomposer",[219,650,651],{},"The composer renders the scene into a scene pass, then runs its effects on it. Each effect gets the output of the effect before it.",[219,653,654],{},"The chain runs in this order:",[656,657,658,666,673],"ol",{},[659,660,661,662,665],"li",{},"The ",[663,664,560],"strong",{}," effects, in slot order, on the linear scene colors. Bloom and depth of field go here.",[659,667,668,669,672],{},"Tone mapping and the output color space (three's ",[222,670,671],{},"renderOutput()",").",[659,674,661,675,677],{},[663,676,602],{}," effects, in slot order, on display colors. FXAA, SMAA and film grain go here.",[219,679,680,681,684,685,688,689,691],{},"The tone mapping and the color space come from the renderer, so set them with the ",[222,682,683],{},"tone-mapping"," and ",[222,686,687],{},"output-color-space"," props of ",[222,690,232],{},". Without LDR effects, three applies them at the end of the chain as usual.",[219,693,694,695,698,699,702,703,706],{},"The stage wins over the slot order: ",[222,696,697],{},"\u003CFXAA \u002F>"," before ",[222,700,701],{},"\u003CBloom \u002F>"," still runs bloom first. An effect without a ",[222,704,705],{},"stage"," is an HDR effect. In development, the composer warns once when an LDR effect comes before an HDR effect in the slot.",[529,708,709,722],{},[532,710,711],{},[535,712,713,716,719],{},[538,714,715],{},"Prop",[538,717,718],{},"Description",[538,720,721],{},"Default",[548,723,724],{},[535,725,726,731,736],{},[553,727,728],{},[222,729,730],{},"enabled",[553,732,733,735],{},[222,734,418],{}," renders the scene without the effects.",[553,737,738],{},[222,739,740],{},"true",[219,742,743,744,747],{},"When an effect is added, removed (",[222,745,746],{},"v-if",") or reordered, the composer builds the graph again. A prop change does not.",[219,749,750,751,754,755,758,759,237],{},"A new graph compiles a new shader and creates a new scene pass. To switch an effect on and off often, give it a prop that turns it off, such as an ",[222,752,753],{},"amount"," of ",[222,756,757],{},"0",", instead of ",[222,760,746],{},[219,762,763],{},"When the composer unmounts, the canvas renders normally again.",[263,765,767],{"id":766},"blending","Blending",[219,769,770,771,774,775,778],{},"The WebGPU family has no ",[222,772,773],{},"blendFunction"," or ",[222,776,777],{},"opacity"," props. Each effect returns a new color node, and the next effect reads it. To blend an effect with its input, mix the two in your own effect:",[268,780,783],{"className":781,"code":782,"language":305,"meta":273,"style":273},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineEffect } from '@tresjs\u002Fpost-processing\u002Fwebgpu'\nimport { fxaa } from 'three\u002Faddons\u002Ftsl\u002Fdisplay\u002FFXAANode.js'\nimport { mix } from 'three\u002Ftsl'\n\nconst FXAAWithOpacity = defineEffect({\n  name: 'FXAAWithOpacity',\n  stage: 'ldr',\n  props: { opacity: 1 },\n  create: (input, { uniforms }) => mix(input, fxaa(input), uniforms.opacity),\n})\n",[222,784,785,804,824,844,848,867,886,902,922,972],{"__ignoreMap":273},[277,786,787,789,791,794,796,798,800,802],{"class":279,"line":280},[277,788,317],{"class":316},[277,790,320],{"class":283},[277,792,793],{"class":323}," defineEffect",[277,795,327],{"class":283},[277,797,330],{"class":316},[277,799,333],{"class":283},[277,801,224],{"class":304},[277,803,338],{"class":283},[277,805,806,808,810,813,815,817,819,822],{"class":279,"line":313},[277,807,317],{"class":316},[277,809,320],{"class":283},[277,811,812],{"class":323}," fxaa",[277,814,327],{"class":283},[277,816,330],{"class":316},[277,818,333],{"class":283},[277,820,821],{"class":304},"three\u002Faddons\u002Ftsl\u002Fdisplay\u002FFXAANode.js",[277,823,338],{"class":283},[277,825,826,828,830,833,835,837,839,842],{"class":279,"line":341},[277,827,317],{"class":316},[277,829,320],{"class":283},[277,831,832],{"class":323}," mix",[277,834,327],{"class":283},[277,836,330],{"class":316},[277,838,333],{"class":283},[277,840,841],{"class":304},"three\u002Ftsl",[277,843,338],{"class":283},[277,845,846],{"class":279,"line":372},[277,847,386],{"emptyLinePlaceholder":385},[277,849,850,853,856,858,861,864],{"class":279,"line":382},[277,851,852],{"class":291},"const",[277,854,855],{"class":323}," FXAAWithOpacity ",[277,857,298],{"class":283},[277,859,793],{"class":860},"s2Zo4",[277,862,863],{"class":323},"(",[277,865,866],{"class":283},"{\n",[277,868,869,872,875,877,880,883],{"class":279,"line":389},[277,870,871],{"class":287},"  name",[277,873,874],{"class":283},":",[277,876,333],{"class":283},[277,878,879],{"class":304},"FXAAWithOpacity",[277,881,882],{"class":283},"'",[277,884,885],{"class":283},",\n",[277,887,888,891,893,895,898,900],{"class":279,"line":399},[277,889,890],{"class":287},"  stage",[277,892,874],{"class":283},[277,894,333],{"class":283},[277,896,897],{"class":304},"ldr",[277,899,882],{"class":283},[277,901,885],{"class":283},[277,903,904,907,909,911,914,916,919],{"class":279,"line":425},[277,905,906],{"class":287},"  props",[277,908,874],{"class":283},[277,910,320],{"class":283},[277,912,913],{"class":287}," opacity",[277,915,874],{"class":283},[277,917,918],{"class":465}," 1",[277,920,921],{"class":283}," },\n",[277,923,924,927,929,932,936,938,940,943,946,949,951,954,956,958,961,963,965,967,970],{"class":279,"line":432},[277,925,926],{"class":860},"  create",[277,928,874],{"class":283},[277,930,931],{"class":283}," (",[277,933,935],{"class":934},"sHdIc","input",[277,937,351],{"class":283},[277,939,320],{"class":283},[277,941,942],{"class":934}," uniforms",[277,944,945],{"class":283}," })",[277,947,948],{"class":291}," =>",[277,950,832],{"class":860},[277,952,953],{"class":323},"(input",[277,955,351],{"class":283},[277,957,812],{"class":860},[277,959,960],{"class":323},"(input)",[277,962,351],{"class":283},[277,964,942],{"class":323},[277,966,237],{"class":283},[277,968,969],{"class":323},"opacity)",[277,971,885],{"class":283},[277,973,974,977],{"class":279,"line":437},[277,975,976],{"class":283},"}",[277,978,979],{"class":323},")\n",[263,981,645],{"id":982},"defineeffect",[219,984,985,987,988,237],{},[222,986,645],{}," returns a Vue component. Put it inside an ",[222,989,443],{},[529,991,992,1001],{},[532,993,994],{},[535,995,996,999],{},[538,997,998],{},"Option",[538,1000,718],{},[548,1002,1003,1013,1023,1039],{},[535,1004,1005,1010],{},[553,1006,1007],{},[222,1008,1009],{},"name",[553,1011,1012],{},"The component name, also used in warnings.",[535,1014,1015,1020],{},[553,1016,1017],{},[222,1018,1019],{},"props",[553,1021,1022],{},"Prop defaults. Each prop becomes a uniform with the same name.",[535,1024,1025,1029],{},[553,1026,1027],{},[222,1028,705],{},[553,1030,1031,1034,1035,1038],{},[222,1032,1033],{},"'hdr'"," (default) runs before tone mapping. ",[222,1036,1037],{},"'ldr'"," runs after tone mapping and the output color space.",[535,1040,1041,1046],{},[553,1042,1043],{},[222,1044,1045],{},"create",[553,1047,1048,1051,1052,1054],{},[222,1049,1050],{},"(input, { uniforms, passes, scene, camera, renderer }) => Node",". Returns the output node for the ",[222,1053,935],{}," node.",[219,1056,1057,1058,1061,1062,1065,1066,1065,1069,874],{},"A prop default can be a number, a boolean, a color string, a ",[222,1059,1060],{},"Color"," or a ",[222,1063,1064],{},"Vector2","\u002F",[222,1067,1068],{},"3",[222,1070,1071],{},"4",[1073,1074,1075,1087,1090],"ul",{},[659,1076,1077,1078,1065,1080,1082,1083,1086],{},"A boolean prop becomes a ",[222,1079,757],{},[222,1081,466],{}," float uniform, because WGSL does not allow ",[222,1084,1085],{},"bool"," in a uniform buffer.",[659,1088,1089],{},"A color prop also takes a CSS color or a hex number.",[659,1091,1092,1093,237],{},"A vector prop also takes a tuple, such as ",[222,1094,1095],{},"[1, 0]",[219,1097,1098,1099,1102,1103,1105,1106,1108],{},"A prop change writes the ",[222,1100,1101],{},".value"," of its uniform, so it does not call ",[222,1104,1045],{}," again. Put each value that changes in a prop. ",[222,1107,1045],{}," runs again only when the composer builds the graph again, or the scene or the camera changes.",[219,1110,1111,1112,1115],{},"Each component instance has its own uniforms. Two ",[222,1113,1114],{},"\u003CChromaticAberration>"," components with different props do not share them.",[219,1117,1118,1119,1122,1123,1126,1127,1130],{},"An effect that expects display colors, in the range ",[277,1120,1121],{},"0, 1",", needs ",[222,1124,1125],{},"stage: 'ldr'",". This posterize effect rounds each channel to ",[222,1128,1129],{},"levels"," values (2 or more), so it must run after tone mapping:",[268,1132,1134],{"className":781,"code":1133,"language":305,"meta":273,"style":273},"import { defineEffect } from '@tresjs\u002Fpost-processing\u002Fwebgpu'\nimport { vec4 } from 'three\u002Ftsl'\n\nconst Posterize = defineEffect({\n  name: 'Posterize',\n  stage: 'ldr',\n  props: { levels: 4 },\n  create: (input, { uniforms }) => vec4(input.rgb.mul(uniforms.levels.sub(1)).round().div(uniforms.levels.sub(1)), input.a),\n})\n",[222,1135,1136,1154,1173,1177,1192,1207,1221,1239,1333],{"__ignoreMap":273},[277,1137,1138,1140,1142,1144,1146,1148,1150,1152],{"class":279,"line":280},[277,1139,317],{"class":316},[277,1141,320],{"class":283},[277,1143,793],{"class":323},[277,1145,327],{"class":283},[277,1147,330],{"class":316},[277,1149,333],{"class":283},[277,1151,224],{"class":304},[277,1153,338],{"class":283},[277,1155,1156,1158,1160,1163,1165,1167,1169,1171],{"class":279,"line":313},[277,1157,317],{"class":316},[277,1159,320],{"class":283},[277,1161,1162],{"class":323}," vec4",[277,1164,327],{"class":283},[277,1166,330],{"class":316},[277,1168,333],{"class":283},[277,1170,841],{"class":304},[277,1172,338],{"class":283},[277,1174,1175],{"class":279,"line":341},[277,1176,386],{"emptyLinePlaceholder":385},[277,1178,1179,1181,1184,1186,1188,1190],{"class":279,"line":372},[277,1180,852],{"class":291},[277,1182,1183],{"class":323}," Posterize ",[277,1185,298],{"class":283},[277,1187,793],{"class":860},[277,1189,863],{"class":323},[277,1191,866],{"class":283},[277,1193,1194,1196,1198,1200,1203,1205],{"class":279,"line":382},[277,1195,871],{"class":287},[277,1197,874],{"class":283},[277,1199,333],{"class":283},[277,1201,1202],{"class":304},"Posterize",[277,1204,882],{"class":283},[277,1206,885],{"class":283},[277,1208,1209,1211,1213,1215,1217,1219],{"class":279,"line":389},[277,1210,890],{"class":287},[277,1212,874],{"class":283},[277,1214,333],{"class":283},[277,1216,897],{"class":304},[277,1218,882],{"class":283},[277,1220,885],{"class":283},[277,1222,1223,1225,1227,1229,1232,1234,1237],{"class":279,"line":399},[277,1224,906],{"class":287},[277,1226,874],{"class":283},[277,1228,320],{"class":283},[277,1230,1231],{"class":287}," levels",[277,1233,874],{"class":283},[277,1235,1236],{"class":465}," 4",[277,1238,921],{"class":283},[277,1240,1241,1243,1245,1247,1249,1251,1253,1255,1257,1259,1261,1263,1265,1268,1270,1273,1276,1278,1280,1282,1285,1287,1289,1292,1294,1297,1300,1302,1305,1307,1309,1311,1313,1315,1317,1319,1321,1323,1326,1328,1331],{"class":279,"line":425},[277,1242,926],{"class":860},[277,1244,874],{"class":283},[277,1246,931],{"class":283},[277,1248,935],{"class":934},[277,1250,351],{"class":283},[277,1252,320],{"class":283},[277,1254,942],{"class":934},[277,1256,945],{"class":283},[277,1258,948],{"class":291},[277,1260,1162],{"class":860},[277,1262,953],{"class":323},[277,1264,237],{"class":283},[277,1266,1267],{"class":323},"rgb",[277,1269,237],{"class":283},[277,1271,1272],{"class":860},"mul",[277,1274,1275],{"class":323},"(uniforms",[277,1277,237],{"class":283},[277,1279,1129],{"class":323},[277,1281,237],{"class":283},[277,1283,1284],{"class":860},"sub",[277,1286,863],{"class":323},[277,1288,466],{"class":465},[277,1290,1291],{"class":323},"))",[277,1293,237],{"class":283},[277,1295,1296],{"class":860},"round",[277,1298,1299],{"class":323},"()",[277,1301,237],{"class":283},[277,1303,1304],{"class":860},"div",[277,1306,1275],{"class":323},[277,1308,237],{"class":283},[277,1310,1129],{"class":323},[277,1312,237],{"class":283},[277,1314,1284],{"class":860},[277,1316,863],{"class":323},[277,1318,466],{"class":465},[277,1320,1291],{"class":323},[277,1322,351],{"class":283},[277,1324,1325],{"class":323}," input",[277,1327,237],{"class":283},[277,1329,1330],{"class":323},"a)",[277,1332,885],{"class":283},[277,1334,1335,1337],{"class":279,"line":432},[277,1336,976],{"class":283},[277,1338,979],{"class":323},[263,1340,1342],{"id":1341},"example-pixelation","Example: pixelation",[1344,1345,1346],"docs-demo",{},[1347,1348],"webgpu-pixelation",{},[219,1350,1351,1352,1355],{},"This custom effect wraps the ",[222,1353,1354],{},"pixelationPass"," node from three. Its uniforms go directly to the node, so the sliders change the effect and do not build the graph again.",[268,1357,1359],{"className":270,"code":1358,"language":272,"meta":273,"style":273},"\u003Cscript setup lang=\"ts\">\nimport { TresCanvas } from '@tresjs\u002Fcore\u002Fwebgpu'\nimport { defineEffect, EffectComposer } from '@tresjs\u002Fpost-processing\u002Fwebgpu'\nimport { pixelationPass } from 'three\u002Faddons\u002Ftsl\u002Fdisplay\u002FPixelationPassNode.js'\n\nconst Pixelation = defineEffect({\n  name: 'Pixelation',\n  props: { pixelSize: 6, normalEdgeStrength: 0.3, depthEdgeStrength: 0.4 },\n  create: (_input, { scene, camera, uniforms }) =>\n    pixelationPass(scene, camera, uniforms.pixelSize, uniforms.normalEdgeStrength, uniforms.depthEdgeStrength),\n})\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003CTresCanvas>\n    \u003C!-- Your scene -->\n\n    \u003CEffectComposer>\n      \u003CPixelation :pixel-size=\"8\" \u002F>\n    \u003C\u002FEffectComposer>\n  \u003C\u002FTresCanvas>\n\u003C\u002Ftemplate>\n",[222,1360,1361,1381,1399,1421,1441,1445,1460,1474,1512,1544,1585,1591,1599,1603,1611,1619,1624,1629,1638,1661,1670,1679],{"__ignoreMap":273},[277,1362,1363,1365,1367,1369,1371,1373,1375,1377,1379],{"class":279,"line":280},[277,1364,284],{"class":283},[277,1366,288],{"class":287},[277,1368,292],{"class":291},[277,1370,295],{"class":291},[277,1372,298],{"class":283},[277,1374,301],{"class":283},[277,1376,305],{"class":304},[277,1378,301],{"class":283},[277,1380,310],{"class":283},[277,1382,1383,1385,1387,1389,1391,1393,1395,1397],{"class":279,"line":313},[277,1384,317],{"class":316},[277,1386,320],{"class":283},[277,1388,324],{"class":323},[277,1390,327],{"class":283},[277,1392,330],{"class":316},[277,1394,333],{"class":283},[277,1396,236],{"class":304},[277,1398,338],{"class":283},[277,1400,1401,1403,1405,1407,1409,1411,1413,1415,1417,1419],{"class":279,"line":341},[277,1402,317],{"class":316},[277,1404,320],{"class":283},[277,1406,793],{"class":323},[277,1408,351],{"class":283},[277,1410,354],{"class":323},[277,1412,327],{"class":283},[277,1414,330],{"class":316},[277,1416,333],{"class":283},[277,1418,224],{"class":304},[277,1420,338],{"class":283},[277,1422,1423,1425,1427,1430,1432,1434,1436,1439],{"class":279,"line":372},[277,1424,317],{"class":316},[277,1426,320],{"class":283},[277,1428,1429],{"class":323}," pixelationPass",[277,1431,327],{"class":283},[277,1433,330],{"class":316},[277,1435,333],{"class":283},[277,1437,1438],{"class":304},"three\u002Faddons\u002Ftsl\u002Fdisplay\u002FPixelationPassNode.js",[277,1440,338],{"class":283},[277,1442,1443],{"class":279,"line":382},[277,1444,386],{"emptyLinePlaceholder":385},[277,1446,1447,1449,1452,1454,1456,1458],{"class":279,"line":389},[277,1448,852],{"class":291},[277,1450,1451],{"class":323}," Pixelation ",[277,1453,298],{"class":283},[277,1455,793],{"class":860},[277,1457,863],{"class":323},[277,1459,866],{"class":283},[277,1461,1462,1464,1466,1468,1470,1472],{"class":279,"line":399},[277,1463,871],{"class":287},[277,1465,874],{"class":283},[277,1467,333],{"class":283},[277,1469,113],{"class":304},[277,1471,882],{"class":283},[277,1473,885],{"class":283},[277,1475,1476,1478,1480,1482,1485,1487,1490,1492,1495,1497,1500,1502,1505,1507,1510],{"class":279,"line":425},[277,1477,906],{"class":287},[277,1479,874],{"class":283},[277,1481,320],{"class":283},[277,1483,1484],{"class":287}," pixelSize",[277,1486,874],{"class":283},[277,1488,1489],{"class":465}," 6",[277,1491,351],{"class":283},[277,1493,1494],{"class":287}," normalEdgeStrength",[277,1496,874],{"class":283},[277,1498,1499],{"class":465}," 0.3",[277,1501,351],{"class":283},[277,1503,1504],{"class":287}," depthEdgeStrength",[277,1506,874],{"class":283},[277,1508,1509],{"class":465}," 0.4",[277,1511,921],{"class":283},[277,1513,1514,1516,1518,1520,1523,1525,1527,1530,1532,1535,1537,1539,1541],{"class":279,"line":432},[277,1515,926],{"class":860},[277,1517,874],{"class":283},[277,1519,931],{"class":283},[277,1521,1522],{"class":934},"_input",[277,1524,351],{"class":283},[277,1526,320],{"class":283},[277,1528,1529],{"class":934}," scene",[277,1531,351],{"class":283},[277,1533,1534],{"class":934}," camera",[277,1536,351],{"class":283},[277,1538,942],{"class":934},[277,1540,945],{"class":283},[277,1542,1543],{"class":291}," =>\n",[277,1545,1546,1549,1552,1554,1556,1558,1560,1562,1565,1567,1569,1571,1574,1576,1578,1580,1583],{"class":279,"line":437},[277,1547,1548],{"class":860},"    pixelationPass",[277,1550,1551],{"class":323},"(scene",[277,1553,351],{"class":283},[277,1555,1534],{"class":323},[277,1557,351],{"class":283},[277,1559,942],{"class":323},[277,1561,237],{"class":283},[277,1563,1564],{"class":323},"pixelSize",[277,1566,351],{"class":283},[277,1568,942],{"class":323},[277,1570,237],{"class":283},[277,1572,1573],{"class":323},"normalEdgeStrength",[277,1575,351],{"class":283},[277,1577,942],{"class":323},[277,1579,237],{"class":283},[277,1581,1582],{"class":323},"depthEdgeStrength)",[277,1584,885],{"class":283},[277,1586,1587,1589],{"class":279,"line":448},[277,1588,976],{"class":283},[277,1590,979],{"class":323},[277,1592,1593,1595,1597],{"class":279,"line":488},[277,1594,375],{"class":283},[277,1596,288],{"class":287},[277,1598,310],{"class":283},[277,1600,1601],{"class":279,"line":497},[277,1602,386],{"emptyLinePlaceholder":385},[277,1604,1605,1607,1609],{"class":279,"line":507},[277,1606,284],{"class":283},[277,1608,394],{"class":287},[277,1610,310],{"class":283},[277,1612,1613,1615,1617],{"class":279,"line":517},[277,1614,402],{"class":283},[277,1616,232],{"class":287},[277,1618,310],{"class":283},[277,1620,1622],{"class":279,"line":1621},16,[277,1623,429],{"class":428},[277,1625,1627],{"class":279,"line":1626},17,[277,1628,386],{"emptyLinePlaceholder":385},[277,1630,1632,1634,1636],{"class":279,"line":1631},18,[277,1633,440],{"class":283},[277,1635,443],{"class":287},[277,1637,310],{"class":283},[277,1639,1641,1643,1645,1647,1650,1652,1654,1657,1659],{"class":279,"line":1640},19,[277,1642,451],{"class":283},[277,1644,113],{"class":287},[277,1646,407],{"class":283},[277,1648,1649],{"class":291},"pixel-size",[277,1651,298],{"class":283},[277,1653,301],{"class":283},[277,1655,1656],{"class":465},"8",[277,1658,301],{"class":283},[277,1660,485],{"class":283},[277,1662,1664,1666,1668],{"class":279,"line":1663},20,[277,1665,500],{"class":283},[277,1667,443],{"class":287},[277,1669,310],{"class":283},[277,1671,1673,1675,1677],{"class":279,"line":1672},21,[277,1674,510],{"class":283},[277,1676,232],{"class":287},[277,1678,310],{"class":283},[277,1680,1682,1684,1686],{"class":279,"line":1681},22,[277,1683,375],{"class":283},[277,1685,394],{"class":287},[277,1687,310],{"class":283},[239,1689,1690],{},[219,1691,1692,1694,1695,1697],{},[222,1693,1354],{}," renders the scene again and does not read ",[222,1696,935],{},". Put it first in the composer. An effect before it has no effect on the output. Effects after it get the pixelated image.",[1699,1700,1701],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}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 .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}",{"title":273,"searchDepth":280,"depth":313,"links":1703},[1704,1705,1706,1707,1708,1709],{"id":265,"depth":313,"text":266},{"id":526,"depth":313,"text":527},{"id":648,"depth":313,"text":443},{"id":766,"depth":313,"text":767},{"id":982,"depth":313,"text":645},{"id":1341,"depth":313,"text":1342},"EffectComposer, defineEffect and the built-in effects for the WebGPU TresCanvas.","md",null,{},{"title":179,"description":1710},"GGRPb6zgkuEaLiJfZQJB2UKI7JHhELEJBtcirx3SgkE",[1717,1719],{"title":175,"path":176,"stem":177,"description":1718,"children":-1},"Bloom effect with glow around bright areas, similar to Unreal Engine.",{"title":37,"path":185,"stem":186,"description":1720,"children":-1},"Add a glow around the bright areas of the scene.",1795084225165]