| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>NodeBuilder - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <h1 translate="no">NodeBuilder</h1>
- <section>
- <header>
- <div class="class-description"><p>Base class for builders which generate a shader program based
- on a 3D object and its node material definition.</p></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="NodeBuilder" translate="no">new <a href="#NodeBuilder">NodeBuilder</a><span class="signature">( object : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, renderer : <span class="param-type"><a href="Renderer.html">Renderer</a></span>, parser : <span class="param-type"><a href="NodeParser.html">NodeParser</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new node builder.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>object</strong>
- </td>
- <td class="description last">
- <p>The 3D object.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>renderer</strong>
- </td>
- <td class="description last">
- <p>The current renderer.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>parser</strong>
- </td>
- <td class="description last">
- <p>A reference to a node parser.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="activeStacks" translate="no">.<a href="#activeStacks">activeStacks</a><span class="type-signature"> : Array.<<a href="StackNode.html">StackNode</a>></span> </h3>
- <div class="description">
- <p>The active stack nodes.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="attributes" translate="no">.<a href="#attributes">attributes</a><span class="type-signature"> : Array.<<a href="NodeAttribute.html">NodeAttribute</a>></span> </h3>
- <div class="description">
- <p>This array holds the node attributes of this builder
- created via <a href="AttributeNode.html">AttributeNode</a>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="bindGroups" translate="no">.<a href="#bindGroups">bindGroups</a><span class="type-signature"> : Array.<<a href="BindGroup.html">BindGroup</a>></span> </h3>
- <div class="description">
- <p>Reference to the array of bind groups.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="bindings" translate="no">.<a href="#bindings">bindings</a><span class="type-signature"> : Object</span> </h3>
- <div class="description">
- <p>This dictionary holds the bindings for each shader stage.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="bindingsIndexes" translate="no">.<a href="#bindingsIndexes">bindingsIndexes</a><span class="type-signature"> : Object</span> </h3>
- <div class="description">
- <p>This dictionary maintains the binding indices per bind group.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="bufferAttributes" translate="no">.<a href="#bufferAttributes">bufferAttributes</a><span class="type-signature"> : Array.<<a href="NodeAttribute.html">NodeAttribute</a>></span> </h3>
- <div class="description">
- <p>This array holds the node attributes of this builder
- created via <a href="BufferAttributeNode.html">BufferAttributeNode</a>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="buildStage" translate="no">.<a href="#buildStage">buildStage</a><span class="type-signature"> : 'setup' | 'analyze' | 'generate'</span> </h3>
- <div class="description">
- <p>The current build stage.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="cache" translate="no">.<a href="#cache">cache</a><span class="type-signature"> : <a href="NodeCache.html">NodeCache</a></span> </h3>
- <div class="description">
- <p>The builder's cache.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="camera" translate="no">.<a href="#camera">camera</a><span class="type-signature"> : <a href="Camera.html">Camera</a></span> </h3>
- <div class="description">
- <p>The camera the 3D object is rendered with.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="chaining" translate="no">.<a href="#chaining">chaining</a><span class="type-signature"> : Array.<<a href="Node.html">Node</a>></span> </h3>
- <div class="description">
- <p>A chain of nodes.
- Used to check recursive calls in node-graph.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="clippingContext" translate="no">.<a href="#clippingContext">clippingContext</a><span class="type-signature"> : <a href="ClippingContext.html">ClippingContext</a></span> </h3>
- <div class="description">
- <p>The current clipping context.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="codes" translate="no">.<a href="#codes">codes</a><span class="type-signature"> : Object.<string, Array.<<a href="NodeCode.html">NodeCode</a>>></span> </h3>
- <div class="description">
- <p>This dictionary holds the (native) node codes of this builder.
- The codes are maintained in an array for each shader stage.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="computeShader" translate="no">.<a href="#computeShader">computeShader</a><span class="type-signature"> : string</span> </h3>
- <div class="description">
- <p>The generated compute shader.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="context" translate="no">.<a href="#context">context</a><span class="type-signature"> : Object</span> </h3>
- <div class="description">
- <p>The builder's context.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="currentFunctionNode" translate="no">.<a href="#currentFunctionNode">currentFunctionNode</a><span class="type-signature"> : <a href="FunctionNode.html">FunctionNode</a></span> </h3>
- <div class="description">
- <p>Reference to the current function node.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="currentNode" translate="no">.<a href="#currentNode">currentNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
- <div class="description">
- <p>A reference the current node which is the
- last node in the chain of nodes.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="declarations" translate="no">.<a href="#declarations">declarations</a><span class="type-signature"> : Object</span> </h3>
- <div class="description">
- <p>This dictionary holds the declarations for each shader stage.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="environmentNode" translate="no">.<a href="#environmentNode">environmentNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
- <div class="description">
- <p>A reference to the current environment node.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="flow" translate="no">.<a href="#flow">flow</a><span class="type-signature"> : Object</span> </h3>
- <div class="description">
- <p>Current code flow.
- All code generated in this stack will be stored in <code>.flow</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="flowCode" translate="no">.<a href="#flowCode">flowCode</a><span class="type-signature"> : Object.<string, string></span> </h3>
- <div class="description">
- <p>Nodes code from <code>.flowNodes</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="flowNodes" translate="no">.<a href="#flowNodes">flowNodes</a><span class="type-signature"> : Object.<string, Array.<<a href="Node.html">Node</a>>></span> </h3>
- <div class="description">
- <p>Nodes used in the primary flow of code generation.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="fnCall" translate="no">.<a href="#fnCall">fnCall</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
- <div class="description">
- <p>The current TSL function(Fn) call node.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="fogNode" translate="no">.<a href="#fogNode">fogNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
- <div class="description">
- <p>A reference to the current fog node.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="fragmentShader" translate="no">.<a href="#fragmentShader">fragmentShader</a><span class="type-signature"> : string</span> </h3>
- <div class="description">
- <p>The generated fragment shader.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="geometry" translate="no">.<a href="#geometry">geometry</a><span class="type-signature"> : <a href="BufferGeometry.html">BufferGeometry</a></span> </h3>
- <div class="description">
- <p>The geometry of the 3D object.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="globalCache" translate="no">.<a href="#globalCache">globalCache</a><span class="type-signature"> : <a href="NodeCache.html">NodeCache</a></span> </h3>
- <div class="description">
- <p>Since the <a href="NodeBuilder.html#cache">NodeBuilder#cache</a> might be temporarily
- overwritten by other caches, this member retains the reference
- to the builder's own cache.</p>
- <p>Default is <code>this.cache</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="hashNodes" translate="no">.<a href="#hashNodes">hashNodes</a><span class="type-signature"> : Object.<number, <a href="Node.html">Node</a>></span> </h3>
- <div class="description">
- <p>A dictionary that assigns each node to a unique hash.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="lightsNode" translate="no">.<a href="#lightsNode">lightsNode</a><span class="type-signature"> : <a href="LightsNode.html">LightsNode</a></span> </h3>
- <div class="description">
- <p>A reference to the current lights node.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="material" translate="no">.<a href="#material">material</a><span class="type-signature"> : <a href="Material.html">Material</a></span> </h3>
- <div class="description">
- <p>The material of the 3D object.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="nodes" translate="no">.<a href="#nodes">nodes</a><span class="type-signature"> : Array.<<a href="Node.html">Node</a>></span> </h3>
- <div class="description">
- <p>A list of all nodes the builder is processing
- for this 3D object.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="object" translate="no">.<a href="#object">object</a><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="description">
- <p>The 3D object.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="observer" translate="no">.<a href="#observer">observer</a><span class="type-signature"> : <a href="NodeMaterialObserver.html">NodeMaterialObserver</a></span> </h3>
- <div class="description">
- <p>A reference to a node material observer.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="parser" translate="no">.<a href="#parser">parser</a><span class="type-signature"> : <a href="NodeParser.html">NodeParser</a></span> </h3>
- <div class="description">
- <p>A reference to a node parser.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="renderer" translate="no">.<a href="#renderer">renderer</a><span class="type-signature"> : <a href="Renderer.html">Renderer</a></span> </h3>
- <div class="description">
- <p>The current renderer.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="scene" translate="no">.<a href="#scene">scene</a><span class="type-signature"> : <a href="Scene.html">Scene</a></span> </h3>
- <div class="description">
- <p>The scene the 3D object belongs to.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="sequentialNodes" translate="no">.<a href="#sequentialNodes">sequentialNodes</a><span class="type-signature"> : Array.<<a href="Node.html">Node</a>></span> </h3>
- <div class="description">
- <p>A list of all sequential nodes.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="shaderStage" translate="no">.<a href="#shaderStage">shaderStage</a><span class="type-signature"> : 'vertex' | 'fragment' | 'compute' | 'any'</span> </h3>
- <div class="description">
- <p>The current shader stage.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="stack" translate="no">.<a href="#stack">stack</a><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
- <div class="description">
- <p>The current stack.
- This reflects the current process in the code block hierarchy,
- it is useful to know if the current process is inside a conditional for example.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="stacks" translate="no">.<a href="#stacks">stacks</a><span class="type-signature"> : Array.<<a href="StackNode.html">StackNode</a>></span> </h3>
- <div class="description">
- <p>List of stack nodes.
- The current stack hierarchy is stored in an array.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="structs" translate="no">.<a href="#structs">structs</a><span class="type-signature"> : Object</span> </h3>
- <div class="description">
- <p>This dictionary holds the output structs of the builder.
- The structs are maintained in an array for each shader stage.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="subBuild" translate="no">.<a href="#subBuild">subBuild</a> </h3>
- <div class="description">
- <p>Returns the current sub-build layer.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="subBuildFn" translate="no">.<a href="#subBuildFn">subBuildFn</a><span class="type-signature"> : string</span> </h3>
- <div class="description">
- <p>The current sub-build TSL function(Fn).</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="subBuildLayers" translate="no">.<a href="#subBuildLayers">subBuildLayers</a><span class="type-signature"> : Array.<<a href="SubBuildNode.html">SubBuildNode</a>></span> </h3>
- <div class="description">
- <p>The sub-build layers.</p>
- <p>Default is <code>[]</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="tab" translate="no">.<a href="#tab">tab</a><span class="type-signature"> : string</span> </h3>
- <div class="description">
- <p>A tab value. Used for shader string generation.</p>
- <p>Default is <code>'\t'</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="types" translate="no">.<a href="#types">types</a><span class="type-signature"> : Object</span> </h3>
- <div class="description">
- <p>This dictionary holds the types of the builder.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="uniforms" translate="no">.<a href="#uniforms">uniforms</a><span class="type-signature"> : Object</span> </h3>
- <div class="description">
- <p>This dictionary holds the node uniforms of the builder.
- The uniforms are maintained in an array for each shader stage.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="updateAfterNodes" translate="no">.<a href="#updateAfterNodes">updateAfterNodes</a><span class="type-signature"> : Array.<<a href="Node.html">Node</a>></span> </h3>
- <div class="description">
- <p>A list of all nodes which <a href="Node.html#updateAfter">Node#updateAfter</a> method should be executed.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="updateBeforeNodes" translate="no">.<a href="#updateBeforeNodes">updateBeforeNodes</a><span class="type-signature"> : Array.<<a href="Node.html">Node</a>></span> </h3>
- <div class="description">
- <p>A list of all nodes which <a href="Node.html#updateBefore">Node#updateBefore</a> method should be executed.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="updateNodes" translate="no">.<a href="#updateNodes">updateNodes</a><span class="type-signature"> : Array.<<a href="Node.html">Node</a>></span> </h3>
- <div class="description">
- <p>A list of all nodes which <a href="Node.html#update">Node#update</a> method should be executed.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="vars" translate="no">.<a href="#vars">vars</a><span class="type-signature"> : Object.<string, (Array.<<a href="NodeVar.html">NodeVar</a>>|number)></span> </h3>
- <div class="description">
- <p>This dictionary holds the node variables of this builder.
- The variables are maintained in an array for each shader stage.
- This dictionary is also used to count the number of variables
- according to their type (const, vars).</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="varyings" translate="no">.<a href="#varyings">varyings</a><span class="type-signature"> : Array.<<a href="NodeVarying.html">NodeVarying</a>></span> </h3>
- <div class="description">
- <p>This array holds the node varyings of this builder.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="vertexShader" translate="no">.<a href="#vertexShader">vertexShader</a><span class="type-signature"> : string</span> </h3>
- <div class="description">
- <p>The generated vertex shader.</p>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="addChain" translate="no">.<a href="#addChain">addChain</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Adds the given node to the internal node chain.
- This is used to check recursive calls in node-graph.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to add.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="addContext" translate="no">.<a href="#addContext">addContext</a><span class="signature">( context : <span class="param-type">Object</span> )</span><span class="type-signature"> : Object</span> </h3>
- <div class="method">
- <div class="description">
- <p>Adds context data to the builder's current context.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>context</strong>
- </td>
- <td class="description last">
- <p>The context to add.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The previous context.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="addFlow" translate="no">.<a href="#addFlow">addFlow</a><span class="signature">( shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute'</span>, node : <span class="param-type"><a href="Node.html">Node</a></span> )</span><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Adds the Node to a target flow so that it can generate code in the 'generate' process.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to add.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The node.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="addFlowCode" translate="no">.<a href="#addFlowCode">addFlowCode</a><span class="signature">( code : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="NodeBuilder.html">NodeBuilder</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Adds a code to the current code flow.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>code</strong>
- </td>
- <td class="description last">
- <p>Shader code.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this node builder.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="addFlowCodeHierarchy" translate="no">.<a href="#addFlowCodeHierarchy">addFlowCodeHierarchy</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, nodeBlock : <span class="param-type"><a href="Node.html">Node</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Adds a code flow based on the code-block hierarchy.
- This is used so that code-blocks like If,Else create their variables locally if the Node
- is only used inside one of these conditionals in the current shader stage.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to add.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>nodeBlock</strong>
- </td>
- <td class="description last">
- <p>Node-based code-block. Usually 'ConditionalNode'.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="addFlowTab" translate="no">.<a href="#addFlowTab">addFlowTab</a><span class="signature">()</span><span class="type-signature"> : <a href="NodeBuilder.html">NodeBuilder</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Add tab in the code that will be generated so that other snippets respect the current tabulation.
- Typically used in codes with If,Else.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this node builder.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="addInclude" translate="no">.<a href="#addInclude">addInclude</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span> )</span><span class="type-signature"> : void</span> </h3>
- <div class="method">
- <div class="description">
- <p>Includes a node in the current function node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to include.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="addLineFlowCode" translate="no">.<a href="#addLineFlowCode">addLineFlowCode</a><span class="signature">( code : <span class="param-type">string</span>, node : <span class="param-type"><a href="Node.html">Node</a></span> )</span><span class="type-signature"> : <a href="NodeBuilder.html">NodeBuilder</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Add a inline-code to the current flow.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>code</strong>
- </td>
- <td class="description last">
- <p>The code to add.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>Optional Node, can help the system understand if the Node is part of a code-block.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this node builder.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="addLineFlowCodeBlock" translate="no">.<a href="#addLineFlowCodeBlock">addLineFlowCodeBlock</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, code : <span class="param-type">string</span>, nodeBlock : <span class="param-type"><a href="Node.html">Node</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Add a inline-code to the current flow code-block.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to add.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>code</strong>
- </td>
- <td class="description last">
- <p>The code to add.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>nodeBlock</strong>
- </td>
- <td class="description last">
- <p>Current ConditionalNode</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="addNode" translate="no">.<a href="#addNode">addNode</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Adds a node to this builder.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to add.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="addSequentialNode" translate="no">.<a href="#addSequentialNode">addSequentialNode</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>It is used to add Nodes that will be used as FRAME and RENDER events,
- and need to follow a certain sequence in the calls to work correctly.
- This function should be called after 'setup()' in the 'build()' process to ensure that the child nodes are processed first.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to add.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="addStack" translate="no">.<a href="#addStack">addStack</a><span class="signature">()</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Adds a stack node to the internal stack.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The added stack node.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="addSubBuild" translate="no">.<a href="#addSubBuild">addSubBuild</a><span class="signature">( subBuild : <span class="param-type"><a href="SubBuildNode.html">SubBuildNode</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Adds a sub-build layer to the node builder.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>subBuild</strong>
- </td>
- <td class="description last">
- <p>The sub-build layer to add.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="build" translate="no">.<a href="#build">build</a><span class="signature">()</span><span class="type-signature"> : <a href="NodeBuilder.html">NodeBuilder</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Central build method which controls the build for the given object.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this node builder.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="buildCode" translate="no">.<a href="#buildCode">buildCode</a><span class="signature">()</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Controls the code build of the shader stages.</p>
- </div>
- </div>
- <h3 class="name name-method" id="buildFunctionCode" translate="no">.<a href="#buildFunctionCode">buildFunctionCode</a><span class="signature">( shaderNode : <span class="param-type">ShaderNodeInternal</span> )</span><span class="type-signature"> : string</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Builds the given shader node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>shaderNode</strong>
- </td>
- <td class="description last">
- <p>The shader node.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The function code.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="buildFunctionNode" translate="no">.<a href="#buildFunctionNode">buildFunctionNode</a><span class="signature">( shaderNode : <span class="param-type">ShaderNodeInternal</span> )</span><span class="type-signature"> : <a href="FunctionNode.html">FunctionNode</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the native shader operator name for a given generic name.
- It is a similar type of method like <a href="NodeBuilder.html#getMethod">NodeBuilder#getMethod</a>.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>shaderNode</strong>
- </td>
- <td class="description last">
- <p>The shader node to build the function node with.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The build function node.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="buildUpdateNodes" translate="no">.<a href="#buildUpdateNodes">buildUpdateNodes</a><span class="signature">()</span> </h3>
- <div class="method">
- <div class="description">
- <p>Checks the update types of nodes</p>
- </div>
- </div>
- <h3 class="name name-method" id="changeComponentType" translate="no">.<a href="#changeComponentType">changeComponentType</a><span class="signature">( type : <span class="param-type">string</span>, newComponentType : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>For a given type this method changes the component type to the
- given value. E.g. <code>vec4</code> should be changed to the new component type
- <code>uint</code> which results in <code>uvec4</code>.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>newComponentType</strong>
- </td>
- <td class="description last">
- <p>The new component type.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The new type.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="createCubeRenderTarget" translate="no">.<a href="#createCubeRenderTarget">createCubeRenderTarget</a><span class="signature">( size : <span class="param-type">number</span>, options : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="CubeRenderTarget.html">CubeRenderTarget</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Factory method for creating an instance of <a href="CubeRenderTarget.html">CubeRenderTarget</a> with the given
- dimensions and options.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>size</strong>
- </td>
- <td class="description last">
- <p>The size of the cube render target.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>options</strong>
- </td>
- <td class="description last">
- <p>The options of the cube render target.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The cube render target.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="createRenderTarget" translate="no">.<a href="#createRenderTarget">createRenderTarget</a><span class="signature">( width : <span class="param-type">number</span>, height : <span class="param-type">number</span>, options : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="RenderTarget.html">RenderTarget</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Factory method for creating an instance of <a href="RenderTarget.html">RenderTarget</a> with the given
- dimensions and options.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>width</strong>
- </td>
- <td class="description last">
- <p>The width of the render target.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>height</strong>
- </td>
- <td class="description last">
- <p>The height of the render target.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>options</strong>
- </td>
- <td class="description last">
- <p>The options of the render target.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The render target.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="flowBuildStage" translate="no">.<a href="#flowBuildStage">flowBuildStage</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, buildStage : <span class="param-type">string</span>, output : <span class="param-type"><a href="Node.html">Node</a> | string</span> )</span><span class="type-signature"> : <a href="Node.html">Node</a> | string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Executes the node in a specific build stage.</p>
- <p>This function can be used to arbitrarily execute the specified build stage
- outside of the standard build process. For instance, if a node's type depends
- on properties created by the 'setup' stage, then flowBuildStage(node, 'setup')
- can be used to execute the setup build stage and access its generated nodes
- before the standard build process begins.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to execute.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>buildStage</strong>
- </td>
- <td class="description last">
- <p>The build stage to execute the node in.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>output</strong>
- </td>
- <td class="description last">
- <p>Expected output type. For example 'vec3'.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The result of the node build.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="flowChildNode" translate="no">.<a href="#flowChildNode">flowChildNode</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, output : <span class="param-type">string</span> )</span><span class="type-signature"> : Object</span> </h3>
- <div class="method">
- <div class="description">
- <p>Generates a code flow based on a child Node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to execute.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>output</strong>
- </td>
- <td class="description last">
- <p>Expected output type. For example 'vec3'.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The code flow.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="flowNode" translate="no">.<a href="#flowNode">flowNode</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span> )</span><span class="type-signature"> : Object</span> </h3>
- <div class="method">
- <div class="description">
- <p>Executes the node flow based on a root node to generate the final shader code.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to execute.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The code flow.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="flowNodeFromShaderStage" translate="no">.<a href="#flowNodeFromShaderStage">flowNodeFromShaderStage</a><span class="signature">( shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span>, node : <span class="param-type"><a href="Node.html">Node</a></span>, output : <span class="param-type">string</span>, propertyName : <span class="param-type">string</span> )</span><span class="type-signature"> : Object | <a href="Node.html">Node</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Executes a flow of code in a different stage.</p>
- <p>Some nodes like <code>varying()</code> have the ability to compute code in vertex-stage and
- return the value in fragment-stage even if it is being executed in an input fragment.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to execute.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>output</strong>
- </td>
- <td class="description last">
- <p>Expected output type. For example 'vec3'.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>propertyName</strong>
- </td>
- <td class="description last">
- <p>The property name to assign the result.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The code flow or node.build() result.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="flowShaderNode" translate="no">.<a href="#flowShaderNode">flowShaderNode</a><span class="signature">( shaderNode : <span class="param-type">ShaderNodeInternal</span> )</span><span class="type-signature"> : Object</span> </h3>
- <div class="method">
- <div class="description">
- <p>Generates a code flow based on a TSL function: Fn().</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>shaderNode</strong>
- </td>
- <td class="description last">
- <p>A function code will be generated based on the input.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="flowStagesNode" translate="no">.<a href="#flowStagesNode">flowStagesNode</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, output : <span class="param-type">string</span> )</span><span class="type-signature"> : Object</span> </h3>
- <div class="method">
- <div class="description">
- <p>Runs the node flow through all the steps of creation, 'setup', 'analyze', 'generate'.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to execute.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>output</strong>
- </td>
- <td class="description last">
- <p>Expected output type. For example 'vec3'.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="format" translate="no">.<a href="#format">format</a><span class="signature">( snippet : <span class="param-type">string</span>, fromType : <span class="param-type">string</span>, toType : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Formats the given shader snippet from a given type into another one. E.g.
- this method might be used to convert a simple float string <code>"1.0"</code> into a
- <code>vec3</code> representation: <code>"vec3<f32>( 1.0 )"</code>.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>snippet</strong>
- </td>
- <td class="description last">
- <p>The shader snippet.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>fromType</strong>
- </td>
- <td class="description last">
- <p>The source type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>toType</strong>
- </td>
- <td class="description last">
- <p>The target type.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The updated shader string.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="generateArray" translate="no">.<a href="#generateArray">generateArray</a><span class="signature">( type : <span class="param-type">string</span>, count : <span class="param-type">number</span>, values : <span class="param-type">Array.<<a href="Node.html">Node</a>></span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Generates the array shader string for the given type and value.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>count</strong>
- </td>
- <td class="description last">
- <p>The count.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>values</strong>
- </td>
- <td class="description last">
- <p>The default values.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The generated value as a shader string.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="generateArrayDeclaration" translate="no">.<a href="#generateArrayDeclaration">generateArrayDeclaration</a><span class="signature">( type : <span class="param-type">string</span>, count : <span class="param-type">number</span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Generates the array declaration string.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>count</strong>
- </td>
- <td class="description last">
- <p>The count.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The generated value as a shader string.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="generateConst" translate="no">.<a href="#generateConst">generateConst</a><span class="signature">( type : <span class="param-type">string</span>, value : <span class="param-type"><a href="global.html#any">any</a></span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Generates the shader string for the given type and value.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>value</strong>
- </td>
- <td class="description last">
- <p>The value.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The generated value as a shader string.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="generateStruct" translate="no">.<a href="#generateStruct">generateStruct</a><span class="signature">( type : <span class="param-type">string</span>, membersLayout : <span class="param-type">Array.<Object></span>, values : <span class="param-type">Array.<<a href="Node.html">Node</a>></span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Generates the struct shader string.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>membersLayout</strong>
- </td>
- <td class="description last">
- <p>The count.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>values</strong>
- </td>
- <td class="description last">
- <p>The default values.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The generated value as a shader string.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="generateTexture" translate="no">.<a href="#generateTexture">generateTexture</a><span class="signature">( texture : <span class="param-type"><a href="Texture.html">Texture</a></span>, textureProperty : <span class="param-type">string</span>, uvSnippet : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Generates a texture sample shader string for the given texture data.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>texture</strong>
- </td>
- <td class="description last">
- <p>The texture.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>textureProperty</strong>
- </td>
- <td class="description last">
- <p>The texture property name.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>uvSnippet</strong>
- </td>
- <td class="description last">
- <p>Snippet defining the texture coordinates.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The generated shader string.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="generateTextureLod" translate="no">.<a href="#generateTextureLod">generateTextureLod</a><span class="signature">( texture : <span class="param-type"><a href="Texture.html">Texture</a></span>, textureProperty : <span class="param-type">string</span>, uvSnippet : <span class="param-type">string</span>, depthSnippet : <span class="param-type">string</span>, levelSnippet : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Generates a texture LOD shader string for the given texture data.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>texture</strong>
- </td>
- <td class="description last">
- <p>The texture.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>textureProperty</strong>
- </td>
- <td class="description last">
- <p>The texture property name.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>uvSnippet</strong>
- </td>
- <td class="description last">
- <p>Snippet defining the texture coordinates.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>depthSnippet</strong>
- </td>
- <td class="description last">
- <p>Snippet defining the 0-based texture array index to sample.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>levelSnippet</strong>
- </td>
- <td class="description last">
- <p>Snippet defining the mip level.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The generated shader string.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getActiveStack" translate="no">.<a href="#getActiveStack">getActiveStack</a><span class="signature">()</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the active stack.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The active stack.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getAttribute" translate="no">.<a href="#getAttribute">getAttribute</a><span class="signature">( name : <span class="param-type">string</span>, type : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="NodeAttribute.html">NodeAttribute</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns a node attribute for the given name and type.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>name</strong>
- </td>
- <td class="description last">
- <p>The attribute's name.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The attribute's type.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The node attribute.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getAttributes" translate="no">.<a href="#getAttributes">getAttributes</a><span class="signature">( shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span> )</span><span class="type-signature"> : string</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Returns the attribute definitions as a shader string for the given shader stage.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The attribute code section.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getAttributesArray" translate="no">.<a href="#getAttributesArray">getAttributesArray</a><span class="signature">()</span><span class="type-signature"> : Array.<<a href="NodeAttribute.html">NodeAttribute</a>></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns an array holding all node attributes of this node builder.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The node attributes of this builder.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getBaseStack" translate="no">.<a href="#getBaseStack">getBaseStack</a><span class="signature">()</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the base stack.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The base stack.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getBindGroupArray" translate="no">.<a href="#getBindGroupArray">getBindGroupArray</a><span class="signature">( groupName : <span class="param-type">string</span>, shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span> )</span><span class="type-signature"> : Array.<<a href="NodeUniformsGroup.html">NodeUniformsGroup</a>></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns an array of node uniform groups for the given group name and shader stage.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>groupName</strong>
- </td>
- <td class="description last">
- <p>The group name.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The array of node uniform groups.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getBindGroupsCache" translate="no">.<a href="#getBindGroupsCache">getBindGroupsCache</a><span class="signature">()</span><span class="type-signature"> : <a href="ChainMap.html">ChainMap</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the bind groups of the current renderer.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The cache.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getBindings" translate="no">.<a href="#getBindings">getBindings</a><span class="signature">()</span><span class="type-signature"> : Array.<<a href="BindGroup.html">BindGroup</a>></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns a list bindings of all shader stages separated by groups.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The list of bindings.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getBufferAttributeFromNode" translate="no">.<a href="#getBufferAttributeFromNode">getBufferAttributeFromNode</a><span class="signature">( node : <span class="param-type"><a href="BufferAttributeNode.html">BufferAttributeNode</a></span>, type : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="NodeAttribute.html">NodeAttribute</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns an instance of <a href="NodeAttribute.html">NodeAttribute</a> for the given buffer attribute node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The buffer attribute node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The node type.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The node attribute.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getBuildStage" translate="no">.<a href="#getBuildStage">getBuildStage</a><span class="signature">()</span><span class="type-signature"> : 'setup' | 'analyze' | 'generate'</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the current build stage.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The current build stage.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getCache" translate="no">.<a href="#getCache">getCache</a><span class="signature">()</span><span class="type-signature"> : <a href="NodeCache.html">NodeCache</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the builder's current cache.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The builder's current cache.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getCacheFromNode" translate="no">.<a href="#getCacheFromNode">getCacheFromNode</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, parent : <span class="param-type">boolean</span> )</span><span class="type-signature"> : <a href="NodeCache.html">NodeCache</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns a cache for the given node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>parent</strong>
- </td>
- <td class="description last">
- <p>Whether this node refers to a shared parent cache or not.</p>
- <p>Default is <code>true</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The cache.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getClosestSubBuild" translate="no">.<a href="#getClosestSubBuild">getClosestSubBuild</a><span class="signature">( data : <span class="param-type"><a href="Node.html">Node</a> | Set.<string> | Array.<string></span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the closest sub-build layer for the given data.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>data</strong>
- </td>
- <td class="description last">
- <p>The data to get the closest sub-build layer from.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The closest sub-build name or null if none found.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getCodeFromNode" translate="no">.<a href="#getCodeFromNode">getCodeFromNode</a><span class="signature">( node : <span class="param-type"><a href="CodeNode.html">CodeNode</a></span>, type : <span class="param-type">string</span>, shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span> )</span><span class="type-signature"> : <a href="NodeCode.html">NodeCode</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns an instance of <a href="NodeCode.html">NodeCode</a> for the given code node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The code node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The node type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- <p>Default is <code>this.shaderStage</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The node code.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getCodes" translate="no">.<a href="#getCodes">getCodes</a><span class="signature">( shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the native code definitions as a shader string for the given shader stage.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The native code section.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getComponentType" translate="no">.<a href="#getComponentType">getComponentType</a><span class="signature">( type : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the component type for a given type.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The type.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The component type.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getComponentTypeFromTexture" translate="no">.<a href="#getComponentTypeFromTexture">getComponentTypeFromTexture</a><span class="signature">( texture : <span class="param-type"><a href="Texture.html">Texture</a></span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the component type of a given texture.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>texture</strong>
- </td>
- <td class="description last">
- <p>The texture.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The component type.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getContext" translate="no">.<a href="#getContext">getContext</a><span class="signature">()</span><span class="type-signature"> : Object</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the builder's current context.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The builder's current context.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getDataFromNode" translate="no">.<a href="#getDataFromNode">getDataFromNode</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span>, cache : <span class="param-type"><a href="NodeCache.html">NodeCache</a></span> )</span><span class="type-signature"> : Object</span> </h3>
- <div class="method">
- <div class="description">
- <p>The builder maintains (cached) data for each node during the building process. This method
- can be used to get these data for a specific shader stage and cache.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to get the data for.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- <p>Default is <code>this.shaderStage</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>cache</strong>
- </td>
- <td class="description last">
- <p>An optional cache.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The node data.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getDrawIndex" translate="no">.<a href="#getDrawIndex">getDrawIndex</a><span class="signature">()</span><span class="type-signature"> : string</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Returns the drawIndex input variable as a native shader string.
- Only relevant for WebGL and its <code>WEBGL_multi_draw</code> extension.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The drawIndex shader string.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getElementType" translate="no">.<a href="#getElementType">getElementType</a><span class="signature">( type : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the element type for a given type.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The type.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The element type.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getFlowData" translate="no">.<a href="#getFlowData">getFlowData</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span> )</span><span class="type-signature"> : Object</span> </h3>
- <div class="method">
- <div class="description">
- <p>Gets the current flow data based on a Node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>Node that the flow was started.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The flow data.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getFragCoord" translate="no">.<a href="#getFragCoord">getFragCoord</a><span class="signature">()</span><span class="type-signature"> : string</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Returns the fragCoord input variable as a native shader string.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The fragCoord shader string.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getFrontFacing" translate="no">.<a href="#getFrontFacing">getFrontFacing</a><span class="signature">()</span><span class="type-signature"> : string</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Returns the frontFacing input variable as a native shader string.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The frontFacing shader string.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getFunctionOperator" translate="no">.<a href="#getFunctionOperator">getFunctionOperator</a><span class="signature">( op : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Returns the native shader operator name for a given generic name.
- It is a similar type of method like <a href="NodeBuilder.html#getMethod">NodeBuilder#getMethod</a>.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>op</strong>
- </td>
- <td class="description last">
- <p>The operator name to resolve.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The resolved operator name.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getHash" translate="no">.<a href="#getHash">getHash</a><span class="signature">()</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the hash of this node builder.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The hash.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getInstanceIndex" translate="no">.<a href="#getInstanceIndex">getInstanceIndex</a><span class="signature">()</span><span class="type-signature"> : string</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Contextually returns either the vertex stage instance index builtin
- or the linearized index of an compute invocation within a grid of workgroups.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The instanceIndex shader string.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getIntegerType" translate="no">.<a href="#getIntegerType">getIntegerType</a><span class="signature">( type : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the integer type pendant for the given type.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The type.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The integer type.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getMethod" translate="no">.<a href="#getMethod">getMethod</a><span class="signature">( method : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Returns the native shader method name for a given generic name. E.g.
- the method name <code>textureDimensions</code> matches the WGSL name but must be
- resolved to <code>textureSize</code> in GLSL.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>method</strong>
- </td>
- <td class="description last">
- <p>The method name to resolve.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The resolved method name.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getNodeFromHash" translate="no">.<a href="#getNodeFromHash">getNodeFromHash</a><span class="signature">( hash : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns a node for the given hash, see <a href="NodeBuilder.html#setHashNode">NodeBuilder#setHashNode</a>.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>hash</strong>
- </td>
- <td class="description last">
- <p>The hash of the node.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The found node.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getNodeProperties" translate="no">.<a href="#getNodeProperties">getNodeProperties</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span> )</span><span class="type-signature"> : Object</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the properties for the given node and shader stage.</p>
- <p>Properties are typically used within a build stage to reference a node's
- child node or nodes manually assigned to the properties in a separate build stage.
- A typical usage pattern for defining nodes manually would be assigning dependency nodes
- to the current node's properties in the setup stage and building those properties in the generate stage.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to get the properties for.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- <p>Default is <code>'any'</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The node properties.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getNodeUniform" translate="no">.<a href="#getNodeUniform">getNodeUniform</a><span class="signature">( uniformNode : <span class="param-type"><a href="NodeUniform.html">NodeUniform</a></span>, type : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="Uniform.html">Uniform</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns a uniform representation which is later used for UBO generation and rendering.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>uniformNode</strong>
- </td>
- <td class="description last">
- <p>The uniform node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The requested type.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The uniform.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getOutputStructName" translate="no">.<a href="#getOutputStructName">getOutputStructName</a><span class="signature">()</span><span class="type-signature"> : string</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Returns the output struct name which is required by
- <a href="OutputStructNode.html">OutputStructNode</a>.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The name of the output struct.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getOutputStructTypeFromNode" translate="no">.<a href="#getOutputStructTypeFromNode">getOutputStructTypeFromNode</a><span class="signature">( node : <span class="param-type"><a href="OutputStructNode.html">OutputStructNode</a></span>, membersLayout : <span class="param-type">Array.<Object></span> )</span><span class="type-signature"> : StructType</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns an instance of StructType for the given output struct node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The output struct node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>membersLayout</strong>
- </td>
- <td class="description last">
- <p>The output struct types.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The struct type attribute.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getPropertyName" translate="no">.<a href="#getPropertyName">getPropertyName</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns for the given node and shader stage the property name for the shader.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The property name.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getShaderStage" translate="no">.<a href="#getShaderStage">getShaderStage</a><span class="signature">()</span><span class="type-signature"> : 'vertex' | 'fragment' | 'compute' | 'any'</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the current shader stage.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The current shader stage.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getSharedContext" translate="no">.<a href="#getSharedContext">getSharedContext</a><span class="signature">()</span><span class="type-signature"> : Object</span> </h3>
- <div class="method">
- <div class="description">
- <p>Gets a context used in shader construction that can be shared across different materials.
- This is necessary since the renderer cache can reuse shaders generated in one material and use them in another.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The builder's current context without material.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getSharedDataFromNode" translate="no">.<a href="#getSharedDataFromNode">getSharedDataFromNode</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span> )</span><span class="type-signature"> : Object</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns shared data object for the given node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to get shared data from.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The shared data.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getSignature" translate="no">.<a href="#getSignature">getSignature</a><span class="signature">()</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns a signature with the engine's current revision.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The signature.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getStructTypeFromNode" translate="no">.<a href="#getStructTypeFromNode">getStructTypeFromNode</a><span class="signature">( node : <span class="param-type"><a href="OutputStructNode.html">OutputStructNode</a></span>, membersLayout : <span class="param-type">Array.<Object></span>, name : <span class="param-type">string</span>, shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span> )</span><span class="type-signature"> : StructType</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns an instance of StructType for the given output struct node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The output struct node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>membersLayout</strong>
- </td>
- <td class="description last">
- <p>The output struct types.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>name</strong>
- </td>
- <td class="description last">
- <p>The name of the struct.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- <p>Default is <code>this.shaderStage</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The struct type attribute.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getStructTypeNode" translate="no">.<a href="#getStructTypeNode">getStructTypeNode</a><span class="signature">( name : <span class="param-type">string</span>, shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span> )</span><span class="type-signature"> : StructType</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns an instance of StructType for the given struct name and shader stage
- or null if not found.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>name</strong>
- </td>
- <td class="description last">
- <p>The name of the struct.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- <p>Default is <code>this.shaderStage</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The struct type or null if not found.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getSubBuildOutput" translate="no">.<a href="#getSubBuildOutput">getSubBuildOutput</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the output node of a sub-build layer.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to get the output from.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The output node name.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getSubBuildProperty" translate="no">.<a href="#getSubBuildProperty">getSubBuildProperty</a><span class="signature">( property : <span class="param-type">string</span>, node : <span class="param-type"><a href="Node.html">Node</a></span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the sub-build property name for the given property and node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>property</strong>
- </td>
- <td class="description last">
- <p>The property name.</p>
- <p>Default is <code>''</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to get the sub-build from.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The sub-build property name.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getTernary" translate="no">.<a href="#getTernary">getTernary</a><span class="signature">( condSnippet : <span class="param-type">string</span>, ifSnippet : <span class="param-type">string</span>, elseSnippet : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Returns the native snippet for a ternary operation. E.g. GLSL would output
- a ternary op as <code>cond ? x : y</code> whereas WGSL would output it as <code>select(y, x, cond)</code></p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>condSnippet</strong>
- </td>
- <td class="description last">
- <p>The condition determining which expression gets resolved.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>ifSnippet</strong>
- </td>
- <td class="description last">
- <p>The expression to resolve to if the condition is true.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>elseSnippet</strong>
- </td>
- <td class="description last">
- <p>The expression to resolve to if the condition is false.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The resolved method name.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getType" translate="no">.<a href="#getType">getType</a><span class="signature">( type : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>It might be necessary to convert certain data types to different ones
- so this method can be used to hide the conversion.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The type.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The updated type.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getTypeFromArray" translate="no">.<a href="#getTypeFromArray">getTypeFromArray</a><span class="signature">( array : <span class="param-type">TypedArray</span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the type for a given typed array.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>array</strong>
- </td>
- <td class="description last">
- <p>The typed array.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The type.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getTypeFromAttribute" translate="no">.<a href="#getTypeFromAttribute">getTypeFromAttribute</a><span class="signature">( attribute : <span class="param-type"><a href="BufferAttribute.html">BufferAttribute</a></span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the type for a given buffer attribute.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>attribute</strong>
- </td>
- <td class="description last">
- <p>The buffer attribute.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The type.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getTypeFromLength" translate="no">.<a href="#getTypeFromLength">getTypeFromLength</a><span class="signature">( length : <span class="param-type">number</span>, componentType : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the data type for the given the length and component type.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>length</strong>
- </td>
- <td class="description last">
- <p>The length.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>componentType</strong>
- </td>
- <td class="description last">
- <p>The component type.</p>
- <p>Default is <code>'float'</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The type.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getTypeLength" translate="no">.<a href="#getTypeLength">getTypeLength</a><span class="signature">( type : <span class="param-type">string</span> )</span><span class="type-signature"> : number</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the length for the given data type.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The data type.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The length.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getUniformFromNode" translate="no">.<a href="#getUniformFromNode">getUniformFromNode</a><span class="signature">( node : <span class="param-type"><a href="UniformNode.html">UniformNode</a></span>, type : <span class="param-type">string</span>, shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span>, name : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="NodeUniform.html">NodeUniform</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns an instance of <a href="NodeUniform.html">NodeUniform</a> for the given uniform node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The uniform node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The uniform type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- <p>Default is <code>this.shaderStage</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>name</strong>
- </td>
- <td class="description last">
- <p>The name of the uniform.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The node uniform.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getUniforms" translate="no">.<a href="#getUniforms">getUniforms</a><span class="signature">( shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span> )</span><span class="type-signature"> : string</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Returns the uniform definitions as a shader string for the given shader stage.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The uniform code section.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getVar" translate="no">.<a href="#getVar">getVar</a><span class="signature">( type : <span class="param-type">string</span>, name : <span class="param-type">string</span>, count : <span class="param-type">number</span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns a single variable definition as a shader string for the given variable type and name.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The variable's type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>name</strong>
- </td>
- <td class="description last">
- <p>The variable's name.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>count</strong>
- </td>
- <td class="description last">
- <p>The array length.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The shader string.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getVarFromNode" translate="no">.<a href="#getVarFromNode">getVarFromNode</a><span class="signature">( node : <span class="param-type"><a href="VarNode.html">VarNode</a></span>, name : <span class="param-type">string</span>, type : <span class="param-type">string</span>, shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span>, readOnly : <span class="param-type">boolean</span> )</span><span class="type-signature"> : <a href="NodeVar.html">NodeVar</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns an instance of <a href="NodeVar.html">NodeVar</a> for the given variable node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The variable node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>name</strong>
- </td>
- <td class="description last">
- <p>The variable's name.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The variable's type.</p>
- <p>Default is <code>node.getNodeType( this )</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- <p>Default is <code>this.shaderStage</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>readOnly</strong>
- </td>
- <td class="description last">
- <p>Whether the variable is read-only or not.</p>
- <p>Default is <code>false</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The node variable.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getVars" translate="no">.<a href="#getVars">getVars</a><span class="signature">( shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the variable definitions as a shader string for the given shader stage.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The variable code section.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getVaryingFromNode" translate="no">.<a href="#getVaryingFromNode">getVaryingFromNode</a><span class="signature">( node : <span class="param-type"><a href="VaryingNode.html">VaryingNode</a> | <a href="PropertyNode.html">PropertyNode</a></span>, name : <span class="param-type">string</span>, type : <span class="param-type">string</span>, interpolationType : <span class="param-type">string</span>, interpolationSampling : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="NodeVar.html">NodeVar</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns an instance of <a href="NodeVarying.html">NodeVarying</a> for the given varying node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The varying node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>name</strong>
- </td>
- <td class="description last">
- <p>The varying's name.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The varying's type.</p>
- <p>Default is <code>node.getNodeType( this )</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>interpolationType</strong>
- </td>
- <td class="description last">
- <p>The interpolation type of the varying.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>interpolationSampling</strong>
- </td>
- <td class="description last">
- <p>The interpolation sampling type of the varying.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The node varying.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getVaryings" translate="no">.<a href="#getVaryings">getVaryings</a><span class="signature">( shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span> )</span><span class="type-signature"> : string</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Returns the varying definitions as a shader string for the given shader stage.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The varying code section.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getVectorFromMatrix" translate="no">.<a href="#getVectorFromMatrix">getVectorFromMatrix</a><span class="signature">( type : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the vector type for a given matrix type.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The matrix type.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The vector type.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getVectorType" translate="no">.<a href="#getVectorType">getVectorType</a><span class="signature">( type : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the vector type for a given type.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The type.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The vector type.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getVertexIndex" translate="no">.<a href="#getVertexIndex">getVertexIndex</a><span class="signature">()</span><span class="type-signature"> : string</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Returns the vertexIndex input variable as a native shader string.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The instanceIndex shader string.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="hasGeometryAttribute" translate="no">.<a href="#hasGeometryAttribute">hasGeometryAttribute</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : boolean</span> </h3>
- <div class="method">
- <div class="description">
- <p>Whether the given attribute name is defined in the geometry or not.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>name</strong>
- </td>
- <td class="description last">
- <p>The attribute name.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> Whether the given attribute name is defined in the geometry.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="includes" translate="no">.<a href="#includes">includes</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span> )</span><span class="type-signature"> : boolean</span> </h3>
- <div class="method">
- <div class="description">
- <p>Whether the given node is included in the internal array of nodes or not.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to test.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> Whether the given node is included in the internal array of nodes or not.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="increaseUsage" translate="no">.<a href="#increaseUsage">increaseUsage</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span> )</span><span class="type-signature"> : number</span> </h3>
- <div class="method">
- <div class="description">
- <p>Calling this method increases the usage count for the given node by one.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to increase the usage count for.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The updated usage count.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="isAvailable" translate="no">.<a href="#isAvailable">isAvailable</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : boolean</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Whether the requested feature is available or not.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>name</strong>
- </td>
- <td class="description last">
- <p>The requested feature.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> Whether the requested feature is supported or not.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="isDeterministic" translate="no">.<a href="#isDeterministic">isDeterministic</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span> )</span><span class="type-signature"> : boolean</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns whether a Node or its flow is deterministic, useful for use in <code>const</code>.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The varying node.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> Returns true if deterministic.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="isFilteredTexture" translate="no">.<a href="#isFilteredTexture">isFilteredTexture</a><span class="signature">( texture : <span class="param-type"><a href="Texture.html">Texture</a></span> )</span><span class="type-signature"> : boolean</span> </h3>
- <div class="method">
- <div class="description">
- <p>Whether the given texture is filtered or not.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>texture</strong>
- </td>
- <td class="description last">
- <p>The texture to check.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> Whether the given texture is filtered or not.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="isFlipY" translate="no">.<a href="#isFlipY">isFlipY</a><span class="signature">()</span><span class="type-signature"> : boolean</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Whether to flip texture data along its vertical axis or not. WebGL needs
- this method evaluate to <code>true</code>, WebGPU to <code>false</code>.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> Whether to flip texture data along its vertical axis or not.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="isInteger" translate="no">.<a href="#isInteger">isInteger</a><span class="signature">( type : <span class="param-type">string</span> )</span><span class="type-signature"> : boolean</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the type is an integer type.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The type.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> Whether the type is an integer type or not.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="isMatrix" translate="no">.<a href="#isMatrix">isMatrix</a><span class="signature">( type : <span class="param-type">string</span> )</span><span class="type-signature"> : boolean</span> </h3>
- <div class="method">
- <div class="description">
- <p>Whether the given type is a matrix type or not.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The type to check.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> Whether the given type is a matrix type or not.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="isOpaque" translate="no">.<a href="#isOpaque">isOpaque</a><span class="signature">()</span><span class="type-signature"> : boolean</span> </h3>
- <div class="method">
- <div class="description">
- <p>Whether the material is opaque or not.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> Whether the material is opaque or not.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="isReference" translate="no">.<a href="#isReference">isReference</a><span class="signature">( type : <span class="param-type">string</span> )</span><span class="type-signature"> : boolean</span> </h3>
- <div class="method">
- <div class="description">
- <p>Whether the given type is a reference type or not.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The type to check.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> Whether the given type is a reference type or not.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="isVector" translate="no">.<a href="#isVector">isVector</a><span class="signature">( type : <span class="param-type">string</span> )</span><span class="type-signature"> : boolean</span> </h3>
- <div class="method">
- <div class="description">
- <p>Whether the given type is a vector type or not.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The type to check.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> Whether the given type is a vector type or not.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="needsPreviousData" translate="no">.<a href="#needsPreviousData">needsPreviousData</a><span class="signature">()</span><span class="type-signature"> : boolean</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns <code>true</code> if data from the previous frame are required. Relevant
- when computing motion vectors with <a href="VelocityNode.html">VelocityNode</a>.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> Whether data from the previous frame are required or not.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="needsToWorkingColorSpace" translate="no">.<a href="#needsToWorkingColorSpace">needsToWorkingColorSpace</a><span class="signature">( texture : <span class="param-type"><a href="Texture.html">Texture</a></span> )</span><span class="type-signature"> : boolean</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Checks if the given texture requires a manual conversion to the working color space.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>texture</strong>
- </td>
- <td class="description last">
- <p>The texture to check.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> Whether the given texture requires a conversion to working color space or not.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="registerDeclaration" translate="no">.<a href="#registerDeclaration">registerDeclaration</a><span class="signature">( node : <span class="param-type">Object</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Registers a node declaration in the current shader stage.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to be registered.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="removeActiveStack" translate="no">.<a href="#removeActiveStack">removeActiveStack</a><span class="signature">( stack : <span class="param-type"><a href="StackNode.html">StackNode</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Removes the active stack from the internal stack.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>stack</strong>
- </td>
- <td class="description last">
- <p>The stack node to remove.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="removeChain" translate="no">.<a href="#removeChain">removeChain</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Removes the given node from the internal node chain.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to remove.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="removeFlowTab" translate="no">.<a href="#removeFlowTab">removeFlowTab</a><span class="signature">()</span><span class="type-signature"> : <a href="NodeBuilder.html">NodeBuilder</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Removes a tab.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this node builder.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="removeStack" translate="no">.<a href="#removeStack">removeStack</a><span class="signature">()</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Removes the last stack node from the internal stack.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The removed stack node.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="removeSubBuild" translate="no">.<a href="#removeSubBuild">removeSubBuild</a><span class="signature">()</span><span class="type-signature"> : <a href="SubBuildNode.html">SubBuildNode</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Removes the last sub-build layer from the node builder.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The removed sub-build layer.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="setActiveStack" translate="no">.<a href="#setActiveStack">setActiveStack</a><span class="signature">( stack : <span class="param-type"><a href="StackNode.html">StackNode</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Adds an active stack to the internal stack.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>stack</strong>
- </td>
- <td class="description last">
- <p>The stack node to add.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="setBuildStage" translate="no">.<a href="#setBuildStage">setBuildStage</a><span class="signature">( buildStage : <span class="param-type">'setup' | 'analyze' | 'generate'</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the current build stage.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>buildStage</strong>
- </td>
- <td class="description last">
- <p>The build stage to set.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="setCache" translate="no">.<a href="#setCache">setCache</a><span class="signature">( cache : <span class="param-type"><a href="NodeCache.html">NodeCache</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets builder's cache.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>cache</strong>
- </td>
- <td class="description last">
- <p>The cache to set.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="setContext" translate="no">.<a href="#setContext">setContext</a><span class="signature">( context : <span class="param-type">Object</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets builder's context.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>context</strong>
- </td>
- <td class="description last">
- <p>The context to set.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="setHashNode" translate="no">.<a href="#setHashNode">setHashNode</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, hash : <span class="param-type">number</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>The builder maintains each node in a hash-based dictionary.
- This method sets the given node (value) with the given hash (key) into this dictionary.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to add.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>hash</strong>
- </td>
- <td class="description last">
- <p>The hash of the node.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="setShaderStage" translate="no">.<a href="#setShaderStage">setShaderStage</a><span class="signature">( shaderStage : <span class="param-type">'vertex' | 'fragment' | 'compute' | 'any'</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the current shader stage.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage to set.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="sortBindingGroups" translate="no">.<a href="#sortBindingGroups">sortBindingGroups</a><span class="signature">()</span> </h3>
- <div class="method">
- <div class="description">
- <p>Sorts the bind groups and updates <a href="NodeBuilder.html#bindingsIndexes">NodeBuilder#bindingsIndexes</a>.</p>
- </div>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/NodeBuilder.js" translate="no" target="_blank" rel="noopener">src/nodes/core/NodeBuilder.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|