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