| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161 |
- <!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 translate="no">object</strong>
- </td>
- <td class="description last">
- <p>The 3D object.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">renderer</strong>
- </td>
- <td class="description last">
- <p>The current renderer.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 nodes the builder is processing in sequential order.</p>
- <p>This is used to determine the update order of nodes, which is important for
- NodeUpdateType#UPDATE_BEFORE and NodeUpdateType#UPDATE_AFTER.</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 translate="no">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 translate="no">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 translate="no">shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The node to add.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">code</strong>
- </td>
- <td class="description last">
- <p>The code to add.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The node to add.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">code</strong>
- </td>
- <td class="description last">
- <p>The code to add.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">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 translate="no">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="buildAsync" translate="no">.<a href="#buildAsync">buildAsync</a><span class="signature">()</span><span class="type-signature"> : Promise.<<a href="NodeBuilder.html">NodeBuilder</a>></span> <span class="type-signature">(async) </span></h3>
- <div class="method">
- <div class="description">
- <p>Async version of build() that yields to main thread between shader stages.
- Use this in compileAsync() to prevent blocking the main thread.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A promise that resolves 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 translate="no">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 translate="no">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 translate="no">type</strong>
- </td>
- <td class="description last">
- <p>The type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">size</strong>
- </td>
- <td class="description last">
- <p>The size of the cube render target.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">width</strong>
- </td>
- <td class="description last">
- <p>The width of the render target.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">height</strong>
- </td>
- <td class="description last">
- <p>The height of the render target.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The node to execute.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">buildStage</strong>
- </td>
- <td class="description last">
- <p>The build stage to execute the node in.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The node to execute.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The node to execute.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The node to execute.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">snippet</strong>
- </td>
- <td class="description last">
- <p>The shader snippet.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">fromType</strong>
- </td>
- <td class="description last">
- <p>The source type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">type</strong>
- </td>
- <td class="description last">
- <p>The type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">count</strong>
- </td>
- <td class="description last">
- <p>The count.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">type</strong>
- </td>
- <td class="description last">
- <p>The type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">type</strong>
- </td>
- <td class="description last">
- <p>The type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">type</strong>
- </td>
- <td class="description last">
- <p>The type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">membersLayout</strong>
- </td>
- <td class="description last">
- <p>The count.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">texture</strong>
- </td>
- <td class="description last">
- <p>The texture.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">textureProperty</strong>
- </td>
- <td class="description last">
- <p>The texture property name.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">texture</strong>
- </td>
- <td class="description last">
- <p>The texture.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">textureProperty</strong>
- </td>
- <td class="description last">
- <p>The texture property name.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">uvSnippet</strong>
- </td>
- <td class="description last">
- <p>Snippet defining the texture coordinates.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">name</strong>
- </td>
- <td class="description last">
- <p>The attribute's name.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">groupName</strong>
- </td>
- <td class="description last">
- <p>The group name.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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="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>, name : <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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The buffer attribute node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">type</strong>
- </td>
- <td class="description last">
- <p>The node type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">name</strong>
- </td>
- <td class="description last">
- <p>The name of the buffer attribute.</p>
- <p>Default is <code>null</code>.</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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The code node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">type</strong>
- </td>
- <td class="description last">
- <p>The node type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The node to get the data for.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>Node that the flow was started.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The node to get the properties for.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">uniformNode</strong>
- </td>
- <td class="description last">
- <p>The uniform node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The output struct node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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="getOutputType" translate="no">.<a href="#getOutputType">getOutputType</a><span class="signature">( index : <span class="param-type">number</span> )</span><span class="type-signature"> : string</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the type of the color output based on the renderer's render target.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">index</strong>
- </td>
- <td class="description last">
- <p>The index of the render target texture.</p>
- <p>Default is <code>0</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="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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The output struct node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">membersLayout</strong>
- </td>
- <td class="description last">
- <p>The output struct types.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">name</strong>
- </td>
- <td class="description last">
- <p>The name of the struct.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">condSnippet</strong>
- </td>
- <td class="description last">
- <p>The condition determining which expression gets resolved.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">length</strong>
- </td>
- <td class="description last">
- <p>The length.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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="getUniformBufferLimit" translate="no">.<a href="#getUniformBufferLimit">getUniformBufferLimit</a><span class="signature">()</span><span class="type-signature"> : number</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns the maximum number of bytes available for uniform buffers.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The maximum number of bytes available for uniform buffers.</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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The uniform node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">type</strong>
- </td>
- <td class="description last">
- <p>The uniform type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">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 translate="no">type</strong>
- </td>
- <td class="description last">
- <p>The variable's type.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">name</strong>
- </td>
- <td class="description last">
- <p>The variable's name.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The variable node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">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 translate="no">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>, global : <span class="param-type">boolean</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 translate="no">shaderStage</strong>
- </td>
- <td class="description last">
- <p>The shader stage.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">global</strong>
- </td>
- <td class="description last">
- <p>Whether the variables are global.</p>
- <p>Default is <code>false</code>.</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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The varying node.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">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="isFlatShading" translate="no">.<a href="#isFlatShading">isFlatShading</a><span class="signature">()</span><span class="type-signature"> : boolean</span> </h3>
- <div class="method">
- <div class="description">
- <p>Whether the material is using flat shading or not.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> Whether the material is using flat shading 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 translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">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="prebuild" translate="no">.<a href="#prebuild">prebuild</a><span class="signature">()</span> </h3>
- <div class="method">
- <div class="description">
- <p>Prebuild the node builder.</p>
- </div>
- </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 translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">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 translate="no">node</strong>
- </td>
- <td class="description last">
- <p>The node to add.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">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 translate="no">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>
|