nodes_material.ts 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166
  1. let nodes_material_categories: string[] = [
  2. _tr("Input"),
  3. _tr("Texture"),
  4. _tr("Color"),
  5. _tr("Vector"),
  6. _tr("Converter"),
  7. _tr("Group")
  8. ];
  9. let nodes_material_input: zui_node_t[] = [
  10. {
  11. id: 0,
  12. name: _tr("Attribute"),
  13. type: "ATTRIBUTE",
  14. x: 0,
  15. y: 0,
  16. color: 0xffb34f5a,
  17. inputs: [],
  18. outputs: [
  19. {
  20. id: 0,
  21. node_id: 0,
  22. name: _tr("Color"),
  23. type: "RGBA",
  24. color: 0xffc7c729,
  25. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  26. min: 0.0,
  27. max: 1.0,
  28. precision: 100,
  29. display: 0
  30. },
  31. {
  32. id: 0,
  33. node_id: 0,
  34. name: _tr("Vector"),
  35. type: "VECTOR",
  36. color: 0xff6363c7,
  37. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  38. min: 0.0,
  39. max: 1.0,
  40. precision: 100,
  41. display: 0
  42. },
  43. {
  44. id: 0,
  45. node_id: 0,
  46. name: _tr("Fac"),
  47. type: "VALUE",
  48. color: 0xffa1a1a1,
  49. default_value: f32_array_create_x(0.0),
  50. min: 0.0,
  51. max: 1.0,
  52. precision: 100,
  53. display: 0
  54. }
  55. ],
  56. buttons: [
  57. {
  58. name: _tr("Name"),
  59. type: "STRING",
  60. output: -1,
  61. default_value: f32_array_create_x(0),
  62. data: null,
  63. min: 0.0,
  64. max: 1.0,
  65. precision: 100,
  66. height: 0
  67. }
  68. ],
  69. width: 0
  70. },
  71. {
  72. id: 0,
  73. name: _tr("Camera Data"),
  74. type: "CAMERA",
  75. x: 0,
  76. y: 0,
  77. color: 0xffb34f5a,
  78. inputs: [],
  79. outputs: [
  80. {
  81. id: 0,
  82. node_id: 0,
  83. name: _tr("View Vector"),
  84. type: "VECTOR",
  85. color: 0xff6363c7,
  86. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  87. min: 0.0,
  88. max: 1.0,
  89. precision: 100,
  90. display: 0
  91. },
  92. {
  93. id: 0,
  94. node_id: 0,
  95. name: _tr("View Z Depth"),
  96. type: "VALUE",
  97. color: 0xffa1a1a1,
  98. default_value: f32_array_create_x(0.0),
  99. min: 0.0,
  100. max: 1.0,
  101. precision: 100,
  102. display: 0
  103. },
  104. {
  105. id: 0,
  106. node_id: 0,
  107. name: _tr("View Distance"),
  108. type: "VALUE",
  109. color: 0xffa1a1a1,
  110. default_value: f32_array_create_x(0.0),
  111. min: 0.0,
  112. max: 1.0,
  113. precision: 100,
  114. display: 0
  115. }
  116. ],
  117. buttons: [],
  118. width: 0
  119. },
  120. {
  121. id: 0,
  122. name: _tr("Fresnel"),
  123. type: "FRESNEL",
  124. x: 0,
  125. y: 0,
  126. color: 0xffb34f5a,
  127. inputs: [
  128. {
  129. id: 0,
  130. node_id: 0,
  131. name: _tr("IOR"),
  132. type: "VALUE",
  133. color: 0xffa1a1a1,
  134. default_value: f32_array_create_x(1.45),
  135. min: 0.0,
  136. max: 3.0,
  137. precision: 100,
  138. display: 0
  139. },
  140. {
  141. id: 0,
  142. node_id: 0,
  143. name: _tr("Normal"),
  144. type: "VECTOR",
  145. color: 0xff6363c7,
  146. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  147. min: 0.0,
  148. max: 1.0,
  149. precision: 100,
  150. display: 0
  151. }
  152. ],
  153. outputs: [
  154. {
  155. id: 0,
  156. node_id: 0,
  157. name: _tr("Fac"),
  158. type: "VALUE",
  159. color: 0xffa1a1a1,
  160. default_value: f32_array_create_x(0.0),
  161. min: 0.0,
  162. max: 1.0,
  163. precision: 100,
  164. display: 0
  165. }
  166. ],
  167. buttons: [],
  168. width: 0
  169. },
  170. {
  171. id: 0,
  172. name: _tr("Geometry"),
  173. type: "NEW_GEOMETRY",
  174. x: 0,
  175. y: 0,
  176. color: 0xffb34f5a,
  177. inputs: [],
  178. outputs: [
  179. {
  180. id: 0,
  181. node_id: 0,
  182. name: _tr("Position"),
  183. type: "VECTOR",
  184. color: 0xff6363c7,
  185. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  186. min: 0.0,
  187. max: 1.0,
  188. precision: 100,
  189. display: 0
  190. },
  191. {
  192. id: 0,
  193. node_id: 0,
  194. name: _tr("Normal"),
  195. type: "VECTOR",
  196. color: 0xff6363c7,
  197. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  198. min: 0.0,
  199. max: 1.0,
  200. precision: 100,
  201. display: 0
  202. },
  203. {
  204. id: 0,
  205. node_id: 0,
  206. name: _tr("Tangent"),
  207. type: "VECTOR",
  208. color: 0xff6363c7,
  209. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  210. min: 0.0,
  211. max: 1.0,
  212. precision: 100,
  213. display: 0
  214. },
  215. {
  216. id: 0,
  217. node_id: 0,
  218. name: _tr("True Normal"),
  219. type: "VECTOR",
  220. color: 0xff6363c7,
  221. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  222. min: 0.0,
  223. max: 1.0,
  224. precision: 100,
  225. display: 0
  226. },
  227. {
  228. id: 0,
  229. node_id: 0,
  230. name: _tr("Incoming"),
  231. type: "VECTOR",
  232. color: 0xff6363c7,
  233. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  234. min: 0.0,
  235. max: 1.0,
  236. precision: 100,
  237. display: 0
  238. },
  239. {
  240. id: 0,
  241. node_id: 0,
  242. name: _tr("Parametric"),
  243. type: "VECTOR",
  244. color: 0xff6363c7,
  245. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  246. min: 0.0,
  247. max: 1.0,
  248. precision: 100,
  249. display: 0
  250. },
  251. {
  252. id: 0,
  253. node_id: 0,
  254. name: _tr("Backfacing"),
  255. type: "VALUE",
  256. color: 0xffa1a1a1,
  257. default_value: f32_array_create_x(0.0),
  258. min: 0.0,
  259. max: 1.0,
  260. precision: 100,
  261. display: 0
  262. },
  263. {
  264. id: 0,
  265. node_id: 0,
  266. name: _tr("Pointiness"),
  267. type: "VALUE",
  268. color: 0xffa1a1a1,
  269. default_value: f32_array_create_x(0.0),
  270. min: 0.0,
  271. max: 1.0,
  272. precision: 100,
  273. display: 0
  274. },
  275. {
  276. id: 0,
  277. node_id: 0,
  278. name: _tr("Random Per Island"),
  279. type: "VALUE",
  280. color: 0xffa1a1a1,
  281. default_value: f32_array_create_x(0.0),
  282. min: 0.0,
  283. max: 1.0,
  284. precision: 100,
  285. display: 0
  286. }
  287. ],
  288. buttons: [],
  289. width: 0
  290. },
  291. {
  292. id: 0,
  293. name: _tr("Layer"),
  294. type: "LAYER", // extension
  295. x: 0,
  296. y: 0,
  297. color: 0xff4982a0,
  298. inputs: [],
  299. outputs: [
  300. {
  301. id: 0,
  302. node_id: 0,
  303. name: _tr("Base Color"),
  304. type: "RGBA",
  305. color: 0xffc7c729,
  306. default_value: f32_array_create_xyzw(0.0, 0.0, 0.0, 1.0),
  307. min: 0.0,
  308. max: 1.0,
  309. precision: 100,
  310. display: 0
  311. },
  312. {
  313. id: 0,
  314. node_id: 0,
  315. name: _tr("Opacity"),
  316. type: "VALUE",
  317. color: 0xffa1a1a1,
  318. default_value: f32_array_create_x(1.0),
  319. min: 0.0,
  320. max: 1.0,
  321. precision: 100,
  322. display: 0
  323. },
  324. {
  325. id: 0,
  326. node_id: 0,
  327. name: _tr("Occlusion"),
  328. type: "VALUE",
  329. color: 0xffa1a1a1,
  330. default_value: f32_array_create_x(1.0),
  331. min: 0.0,
  332. max: 1.0,
  333. precision: 100,
  334. display: 0
  335. },
  336. {
  337. id: 0,
  338. node_id: 0,
  339. name: _tr("Roughness"),
  340. type: "VALUE",
  341. color: 0xffa1a1a1,
  342. default_value: f32_array_create_x(1.0),
  343. min: 0.0,
  344. max: 1.0,
  345. precision: 100,
  346. display: 0
  347. },
  348. {
  349. id: 0,
  350. node_id: 0,
  351. name: _tr("Metallic"),
  352. type: "VALUE",
  353. color: 0xffa1a1a1,
  354. default_value: f32_array_create_x(1.0),
  355. min: 0.0,
  356. max: 1.0,
  357. precision: 100,
  358. display: 0
  359. },
  360. {
  361. id: 0,
  362. node_id: 0,
  363. name: _tr("Normal Map"),
  364. type: "VECTOR",
  365. color: -10238109,
  366. default_value: f32_array_create_xyz(0.5, 0.5, 1.0),
  367. min: 0.0,
  368. max: 1.0,
  369. precision: 100,
  370. display: 0
  371. },
  372. {
  373. id: 0,
  374. node_id: 0,
  375. name: _tr("Emission"),
  376. type: "VALUE",
  377. color: 0xffa1a1a1,
  378. default_value: f32_array_create_x(1.0),
  379. min: 0.0,
  380. max: 1.0,
  381. precision: 100,
  382. display: 0
  383. },
  384. {
  385. id: 0,
  386. node_id: 0,
  387. name: _tr("Height"),
  388. type: "VALUE",
  389. color: 0xffa1a1a1,
  390. default_value: f32_array_create_x(1.0),
  391. min: 0.0,
  392. max: 1.0,
  393. precision: 100,
  394. display: 0
  395. },
  396. {
  397. id: 0,
  398. node_id: 0,
  399. name: _tr("Subsurface"),
  400. type: "VALUE",
  401. color: 0xffa1a1a1,
  402. default_value: f32_array_create_x(1.0),
  403. min: 0.0,
  404. max: 1.0,
  405. precision: 100,
  406. display: 0
  407. }
  408. ],
  409. buttons: [
  410. {
  411. name: _tr("Layer"),
  412. type: "ENUM",
  413. output: -1,
  414. default_value: f32_array_create_x(0),
  415. data: u8_array_create_from_string(""),
  416. min: 0.0,
  417. max: 1.0,
  418. precision: 100,
  419. height: 0
  420. }
  421. ],
  422. width: 0
  423. },
  424. {
  425. id: 0,
  426. name: _tr("Layer Mask"),
  427. type: "LAYER_MASK", // extension
  428. x: 0,
  429. y: 0,
  430. color: 0xff4982a0,
  431. inputs: [],
  432. outputs: [
  433. {
  434. id: 0,
  435. node_id: 0,
  436. name: _tr("Value"),
  437. type: "VALUE",
  438. color: 0xffa1a1a1,
  439. default_value: f32_array_create_x(0.0),
  440. min: 0.0,
  441. max: 1.0,
  442. precision: 100,
  443. display: 0
  444. }
  445. ],
  446. buttons: [
  447. {
  448. name: _tr("Layer"),
  449. type: "ENUM",
  450. output: -1,
  451. default_value: f32_array_create_x(0),
  452. data: u8_array_create_from_string(""),
  453. min: 0.0,
  454. max: 1.0,
  455. precision: 100,
  456. height: 0
  457. }
  458. ],
  459. width: 0
  460. },
  461. {
  462. id: 0,
  463. name: _tr("Layer Weight"),
  464. type: "LAYER_WEIGHT",
  465. x: 0,
  466. y: 0,
  467. color: 0xffb34f5a,
  468. inputs: [
  469. {
  470. id: 0,
  471. node_id: 0,
  472. name: _tr("Blend"),
  473. type: "VALUE",
  474. color: 0xffa1a1a1,
  475. default_value: f32_array_create_x(0.5),
  476. min: 0.0,
  477. max: 1.0,
  478. precision: 100,
  479. display: 0
  480. },
  481. {
  482. id: 0,
  483. node_id: 0,
  484. name: _tr("Normal"),
  485. type: "VECTOR",
  486. color: 0xff6363c7,
  487. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  488. min: 0.0,
  489. max: 1.0,
  490. precision: 100,
  491. display: 0
  492. }
  493. ],
  494. outputs: [
  495. {
  496. id: 0,
  497. node_id: 0,
  498. name: _tr("Fresnel"),
  499. type: "VALUE",
  500. color: 0xffa1a1a1,
  501. default_value: f32_array_create_x(0.0),
  502. min: 0.0,
  503. max: 1.0,
  504. precision: 100,
  505. display: 0
  506. },
  507. {
  508. id: 0,
  509. node_id: 0,
  510. name: _tr("Facing"),
  511. type: "VALUE",
  512. color: 0xffa1a1a1,
  513. default_value: f32_array_create_x(0.0),
  514. min: 0.0,
  515. max: 1.0,
  516. precision: 100,
  517. display: 0
  518. }
  519. ],
  520. buttons: [],
  521. width: 0
  522. },
  523. {
  524. id: 0,
  525. name: _tr("Material"),
  526. type: "MATERIAL", // extension
  527. x: 0,
  528. y: 0,
  529. color: 0xff4982a0,
  530. inputs: [],
  531. outputs: [
  532. {
  533. id: 0,
  534. node_id: 0,
  535. name: _tr("Base Color"),
  536. type: "RGBA",
  537. color: 0xffc7c729,
  538. default_value: f32_array_create_xyzw(0.0, 0.0, 0.0, 1.0),
  539. min: 0.0,
  540. max: 1.0,
  541. precision: 100,
  542. display: 0
  543. },
  544. {
  545. id: 0,
  546. node_id: 0,
  547. name: _tr("Opacity"),
  548. type: "VALUE",
  549. color: 0xffa1a1a1,
  550. default_value: f32_array_create_x(1.0),
  551. min: 0.0,
  552. max: 1.0,
  553. precision: 100,
  554. display: 0
  555. },
  556. {
  557. id: 0,
  558. node_id: 0,
  559. name: _tr("Occlusion"),
  560. type: "VALUE",
  561. color: 0xffa1a1a1,
  562. default_value: f32_array_create_x(1.0),
  563. min: 0.0,
  564. max: 1.0,
  565. precision: 100,
  566. display: 0
  567. },
  568. {
  569. id: 0,
  570. node_id: 0,
  571. name: _tr("Roughness"),
  572. type: "VALUE",
  573. color: 0xffa1a1a1,
  574. default_value: f32_array_create_x(1.0),
  575. min: 0.0,
  576. max: 1.0,
  577. precision: 100,
  578. display: 0
  579. },
  580. {
  581. id: 0,
  582. node_id: 0,
  583. name: _tr("Metallic"),
  584. type: "VALUE",
  585. color: 0xffa1a1a1,
  586. default_value: f32_array_create_x(1.0),
  587. min: 0.0,
  588. max: 1.0,
  589. precision: 100,
  590. display: 0
  591. },
  592. {
  593. id: 0,
  594. node_id: 0,
  595. name: _tr("Normal Map"),
  596. type: "VECTOR",
  597. color: -10238109,
  598. default_value: f32_array_create_xyz(0.5, 0.5, 1.0),
  599. min: 0.0,
  600. max: 1.0,
  601. precision: 100,
  602. display: 0
  603. },
  604. {
  605. id: 0,
  606. node_id: 0,
  607. name: _tr("Emission"),
  608. type: "VALUE",
  609. color: 0xffa1a1a1,
  610. default_value: f32_array_create_x(1.0),
  611. min: 0.0,
  612. max: 1.0,
  613. precision: 100,
  614. display: 0
  615. },
  616. {
  617. id: 0,
  618. node_id: 0,
  619. name: _tr("Height"),
  620. type: "VALUE",
  621. color: 0xffa1a1a1,
  622. default_value: f32_array_create_x(1.0),
  623. min: 0.0,
  624. max: 1.0,
  625. precision: 100,
  626. display: 0
  627. },
  628. {
  629. id: 0,
  630. node_id: 0,
  631. name: _tr("Subsurface"),
  632. type: "VALUE",
  633. color: 0xffa1a1a1,
  634. default_value: f32_array_create_x(1.0),
  635. min: 0.0,
  636. max: 1.0,
  637. precision: 100,
  638. display: 0
  639. }
  640. ],
  641. buttons: [
  642. {
  643. name: _tr("Material"),
  644. type: "ENUM",
  645. output: -1,
  646. default_value: f32_array_create_x(0),
  647. data: u8_array_create_from_string(""),
  648. min: 0.0,
  649. max: 1.0,
  650. precision: 100,
  651. height: 0
  652. }
  653. ],
  654. width: 0
  655. },
  656. {
  657. id: 0,
  658. name: _tr("Object Info"),
  659. type: "OBJECT_INFO",
  660. x: 0,
  661. y: 0,
  662. color: 0xffb34f5a,
  663. inputs: [],
  664. outputs: [
  665. {
  666. id: 0,
  667. node_id: 0,
  668. name: _tr("Location"),
  669. type: "VECTOR",
  670. color: 0xff6363c7,
  671. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  672. min: 0.0,
  673. max: 1.0,
  674. precision: 100,
  675. display: 0
  676. },
  677. {
  678. id: 0,
  679. node_id: 0,
  680. name: _tr("Color"),
  681. type: "RGBA",
  682. color: 0xffc7c729,
  683. default_value: f32_array_create_xyzw(0.0, 0.0, 0.0, 1.0),
  684. min: 0.0,
  685. max: 1.0,
  686. precision: 100,
  687. display: 0
  688. },
  689. {
  690. id: 0,
  691. node_id: 0,
  692. name: _tr("Object Index"),
  693. type: "VALUE",
  694. color: 0xffa1a1a1,
  695. default_value: f32_array_create_x(0.0),
  696. min: 0.0,
  697. max: 1.0,
  698. precision: 100,
  699. display: 0
  700. },
  701. {
  702. id: 0,
  703. node_id: 0,
  704. name: _tr("Material Index"),
  705. type: "VALUE",
  706. color: 0xffa1a1a1,
  707. default_value: f32_array_create_x(0.0),
  708. min: 0.0,
  709. max: 1.0,
  710. precision: 100,
  711. display: 0
  712. },
  713. {
  714. id: 0,
  715. node_id: 0,
  716. name: _tr("Random"),
  717. type: "VALUE",
  718. color: 0xffa1a1a1,
  719. default_value: f32_array_create_x(0.0),
  720. min: 0.0,
  721. max: 1.0,
  722. precision: 100,
  723. display: 0
  724. }
  725. ],
  726. buttons: [],
  727. width: 0
  728. },
  729. {
  730. id: 0,
  731. name: _tr("Picker"),
  732. type: "PICKER", // extension
  733. x: 0,
  734. y: 0,
  735. color: 0xff4982a0,
  736. inputs: [],
  737. outputs: [
  738. {
  739. id: 0,
  740. node_id: 0,
  741. name: _tr("Base Color"),
  742. type: "RGBA",
  743. color: 0xffc7c729,
  744. default_value: f32_array_create_xyzw(0.0, 0.0, 0.0, 1.0),
  745. min: 0.0,
  746. max: 1.0,
  747. precision: 100,
  748. display: 0
  749. },
  750. {
  751. id: 0,
  752. node_id: 0,
  753. name: _tr("Opacity"),
  754. type: "VALUE",
  755. color: 0xffa1a1a1,
  756. default_value: f32_array_create_x(1.0),
  757. min: 0.0,
  758. max: 1.0,
  759. precision: 100,
  760. display: 0
  761. },
  762. {
  763. id: 0,
  764. node_id: 0,
  765. name: _tr("Occlusion"),
  766. type: "VALUE",
  767. color: 0xffa1a1a1,
  768. default_value: f32_array_create_x(1.0),
  769. min: 0.0,
  770. max: 1.0,
  771. precision: 100,
  772. display: 0
  773. },
  774. {
  775. id: 0,
  776. node_id: 0,
  777. name: _tr("Roughness"),
  778. type: "VALUE",
  779. color: 0xffa1a1a1,
  780. default_value: f32_array_create_x(1.0),
  781. min: 0.0,
  782. max: 1.0,
  783. precision: 100,
  784. display: 0
  785. },
  786. {
  787. id: 0,
  788. node_id: 0,
  789. name: _tr("Metallic"),
  790. type: "VALUE",
  791. color: 0xffa1a1a1,
  792. default_value: f32_array_create_x(1.0),
  793. min: 0.0,
  794. max: 1.0,
  795. precision: 100,
  796. display: 0
  797. },
  798. {
  799. id: 0,
  800. node_id: 0,
  801. name: _tr("Normal Map"),
  802. type: "VECTOR",
  803. color: -10238109,
  804. default_value: f32_array_create_xyz(0.5, 0.5, 1.0),
  805. min: 0.0,
  806. max: 1.0,
  807. precision: 100,
  808. display: 0
  809. },
  810. {
  811. id: 0,
  812. node_id: 0,
  813. name: _tr("Emission"),
  814. type: "VALUE",
  815. color: 0xffa1a1a1,
  816. default_value: f32_array_create_x(1.0),
  817. min: 0.0,
  818. max: 1.0,
  819. precision: 100,
  820. display: 0
  821. },
  822. {
  823. id: 0,
  824. node_id: 0,
  825. name: _tr("Height"),
  826. type: "VALUE",
  827. color: 0xffa1a1a1,
  828. default_value: f32_array_create_x(1.0),
  829. min: 0.0,
  830. max: 1.0,
  831. precision: 100,
  832. display: 0
  833. },
  834. {
  835. id: 0,
  836. node_id: 0,
  837. name: _tr("Subsurface"),
  838. type: "VALUE",
  839. color: 0xffa1a1a1,
  840. default_value: f32_array_create_x(1.0),
  841. min: 0.0,
  842. max: 1.0,
  843. precision: 100,
  844. display: 0
  845. }
  846. ],
  847. buttons: [],
  848. width: 0
  849. },
  850. {
  851. id: 0,
  852. name: _tr("RGB"),
  853. type: "RGB",
  854. x: 0,
  855. y: 0,
  856. color: 0xffb34f5a,
  857. inputs: [],
  858. outputs: [
  859. {
  860. id: 0,
  861. node_id: 0,
  862. name: _tr("Color"),
  863. type: "RGBA",
  864. color: 0xffc7c729,
  865. default_value: f32_array_create_xyzw(0.5, 0.5, 0.5, 1.0),
  866. min: 0.0,
  867. max: 1.0,
  868. precision: 100,
  869. display: 0
  870. }
  871. ],
  872. buttons: [
  873. {
  874. name: _tr("default_value"),
  875. type: "RGBA",
  876. output: 0,
  877. default_value: f32_array_create_x(0),
  878. data: null,
  879. min: 0.0,
  880. max: 1.0,
  881. precision: 100,
  882. height: 0
  883. }
  884. ],
  885. width: 0
  886. },
  887. {
  888. id: 0,
  889. name: _tr("Script"),
  890. type: "SCRIPT_CPU", // extension
  891. x: 0,
  892. y: 0,
  893. color: 0xffb34f5a,
  894. inputs: [],
  895. outputs: [
  896. {
  897. id: 0,
  898. node_id: 0,
  899. name: _tr("Value"),
  900. type: "VALUE",
  901. color: 0xffa1a1a1,
  902. default_value: f32_array_create_x(0.5),
  903. min: 0.0,
  904. max: 1.0,
  905. precision: 100,
  906. display: 0
  907. }
  908. ],
  909. buttons: [
  910. {
  911. name: " ",
  912. type: "STRING",
  913. output: -1,
  914. default_value: f32_array_create_x(0), // "",
  915. data: null,
  916. min: 0.0,
  917. max: 1.0,
  918. precision: 100,
  919. height: 0
  920. }
  921. ],
  922. width: 0
  923. },
  924. {
  925. id: 0,
  926. name: _tr("Shader"),
  927. type: "SHADER_GPU", // extension
  928. x: 0,
  929. y: 0,
  930. color: 0xffb34f5a,
  931. inputs: [],
  932. outputs: [
  933. {
  934. id: 0,
  935. node_id: 0,
  936. name: _tr("Value"),
  937. type: "VALUE",
  938. color: 0xffa1a1a1,
  939. default_value: f32_array_create_x(0.5),
  940. min: 0.0,
  941. max: 1.0,
  942. precision: 100,
  943. display: 0
  944. }
  945. ],
  946. buttons: [
  947. {
  948. name: " ",
  949. type: "STRING",
  950. output: -1,
  951. default_value: f32_array_create_x(0), // "",
  952. data: null,
  953. min: 0.0,
  954. max: 1.0,
  955. precision: 100,
  956. height: 0
  957. }
  958. ],
  959. width: 0
  960. },
  961. {
  962. id: 0,
  963. name: _tr("Tangent"),
  964. type: "TANGENT",
  965. x: 0,
  966. y: 0,
  967. color: 0xffb34f5a,
  968. inputs: [],
  969. outputs: [
  970. {
  971. id: 0,
  972. node_id: 0,
  973. name: _tr("Tangent"),
  974. type: "VECTOR",
  975. color: 0xff6363c7,
  976. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  977. min: 0.0,
  978. max: 1.0,
  979. precision: 100,
  980. display: 0
  981. }
  982. ],
  983. buttons: [],
  984. width: 0
  985. },
  986. {
  987. id: 0,
  988. name: _tr("Texture Coordinate"),
  989. type: "TEX_COORD",
  990. x: 0,
  991. y: 0,
  992. color: 0xffb34f5a,
  993. inputs: [],
  994. outputs: [
  995. {
  996. id: 0,
  997. node_id: 0,
  998. name: _tr("Generated"),
  999. type: "VECTOR",
  1000. color: 0xff6363c7,
  1001. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1002. min: 0.0,
  1003. max: 1.0,
  1004. precision: 100,
  1005. display: 0
  1006. },
  1007. {
  1008. id: 0,
  1009. node_id: 0,
  1010. name: _tr("Normal"),
  1011. type: "VECTOR",
  1012. color: 0xff6363c7,
  1013. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1014. min: 0.0,
  1015. max: 1.0,
  1016. precision: 100,
  1017. display: 0
  1018. },
  1019. {
  1020. id: 0,
  1021. node_id: 0,
  1022. name: _tr("UV"),
  1023. type: "VECTOR",
  1024. color: 0xff6363c7,
  1025. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1026. min: 0.0,
  1027. max: 1.0,
  1028. precision: 100,
  1029. display: 0
  1030. },
  1031. {
  1032. id: 0,
  1033. node_id: 0,
  1034. name: _tr("Object"),
  1035. type: "VECTOR",
  1036. color: 0xff6363c7,
  1037. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1038. min: 0.0,
  1039. max: 1.0,
  1040. precision: 100,
  1041. display: 0
  1042. },
  1043. {
  1044. id: 0,
  1045. node_id: 0,
  1046. name: _tr("Camera"),
  1047. type: "VECTOR",
  1048. color: 0xff6363c7,
  1049. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1050. min: 0.0,
  1051. max: 1.0,
  1052. precision: 100,
  1053. display: 0
  1054. },
  1055. {
  1056. id: 0,
  1057. node_id: 0,
  1058. name: _tr("Window"),
  1059. type: "VECTOR",
  1060. color: 0xff6363c7,
  1061. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1062. min: 0.0,
  1063. max: 1.0,
  1064. precision: 100,
  1065. display: 0
  1066. },
  1067. {
  1068. id: 0,
  1069. node_id: 0,
  1070. name: _tr("Reflection"),
  1071. type: "VECTOR",
  1072. color: 0xff6363c7,
  1073. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1074. min: 0.0,
  1075. max: 1.0,
  1076. precision: 100,
  1077. display: 0
  1078. }
  1079. ],
  1080. buttons: []
  1081. },
  1082. {
  1083. id: 0,
  1084. name: _tr("UV Map"),
  1085. type: "UVMAP",
  1086. x: 0,
  1087. y: 0,
  1088. color: 0xffb34f5a,
  1089. inputs: [],
  1090. outputs: [
  1091. {
  1092. id: 0,
  1093. node_id: 0,
  1094. name: _tr("UV"),
  1095. type: "VECTOR",
  1096. color: 0xff6363c7,
  1097. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1098. min: 0.0,
  1099. max: 1.0,
  1100. precision: 100,
  1101. display: 0
  1102. }
  1103. ],
  1104. buttons: [],
  1105. width: 0
  1106. },
  1107. {
  1108. id: 0,
  1109. name: _tr("Value"),
  1110. type: "VALUE",
  1111. x: 0,
  1112. y: 0,
  1113. color: 0xffb34f5a,
  1114. inputs: [],
  1115. outputs: [
  1116. {
  1117. id: 0,
  1118. node_id: 0,
  1119. name: _tr("Value"),
  1120. type: "VALUE",
  1121. color: 0xffa1a1a1,
  1122. default_value: f32_array_create_x(0.5),
  1123. min: 0.0,
  1124. max: 1.0,
  1125. precision: 100,
  1126. display: 0
  1127. }
  1128. ],
  1129. buttons: [
  1130. {
  1131. name: _tr("default_value"),
  1132. type: "VALUE",
  1133. output: 0,
  1134. default_value: f32_array_create_x(0),
  1135. data: null,
  1136. min: 0.0,
  1137. max: 10.0,
  1138. precision: 100,
  1139. height: 0
  1140. }
  1141. ],
  1142. width: 0
  1143. },
  1144. {
  1145. id: 0,
  1146. name: _tr("Vertex Color"),
  1147. type: "VERTEX_COLOR",
  1148. x: 0,
  1149. y: 0,
  1150. color: 0xffb34f5a,
  1151. inputs: [],
  1152. outputs: [
  1153. {
  1154. id: 0,
  1155. node_id: 0,
  1156. name: _tr("Color"),
  1157. type: "RGBA",
  1158. color: 0xffc7c729,
  1159. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  1160. min: 0.0,
  1161. max: 1.0,
  1162. precision: 100,
  1163. display: 0
  1164. },
  1165. {
  1166. id: 0,
  1167. node_id: 0,
  1168. name: _tr("Alpha"),
  1169. type: "VALUE",
  1170. color: 0xffa1a1a1,
  1171. default_value: f32_array_create_x(0.0),
  1172. min: 0.0,
  1173. max: 1.0,
  1174. precision: 100,
  1175. display: 0
  1176. }
  1177. ],
  1178. buttons: [],
  1179. width: 0
  1180. },
  1181. {
  1182. id: 0,
  1183. name: _tr("Wireframe"),
  1184. type: "WIREFRAME",
  1185. x: 0,
  1186. y: 0,
  1187. color: 0xffb34f5a,
  1188. inputs: [
  1189. {
  1190. id: 0,
  1191. node_id: 0,
  1192. name: _tr("Size"),
  1193. type: "VALUE",
  1194. color: 0xffa1a1a1,
  1195. default_value: f32_array_create_x(0.01),
  1196. min: 0.0,
  1197. max: 0.1,
  1198. precision: 100,
  1199. display: 0
  1200. },
  1201. ],
  1202. outputs: [
  1203. {
  1204. id: 0,
  1205. node_id: 0,
  1206. name: _tr("Fac"),
  1207. type: "VALUE",
  1208. color: 0xffa1a1a1,
  1209. default_value: f32_array_create_x(0.0),
  1210. min: 0.0,
  1211. max: 1.0,
  1212. precision: 100,
  1213. display: 0
  1214. }
  1215. ],
  1216. buttons: [
  1217. {
  1218. name: _tr("Pixel Size"),
  1219. type: "BOOL",
  1220. output: 0,
  1221. default_value: f32_array_create_x(0),
  1222. data: null,
  1223. min: 0.0,
  1224. max: 1.0,
  1225. precision: 100,
  1226. height: 0
  1227. }
  1228. ],
  1229. width: 0
  1230. },
  1231. ];
  1232. // let nodes_material_output: zui_node_t[] = [
  1233. // {
  1234. // id: 0,
  1235. // name: _tr("Material Output"),
  1236. // type: "OUTPUT_MATERIAL_PBR",
  1237. // x: 0,
  1238. // y: 0,
  1239. // color: 0xffb34f5a,
  1240. // inputs: [
  1241. // {
  1242. // id: 0,
  1243. // node_id: 0,
  1244. // name: _tr("Base Color"),
  1245. // type: "RGBA",
  1246. // color: 0xffc7c729,
  1247. // default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  1248. // min: 0.0,
  1249. // max: 1.0,
  1250. // precision: 100,
  1251. // display: 0
  1252. // },
  1253. // {
  1254. // id: 0,
  1255. // node_id: 0,
  1256. // name: _tr("Opacity"),
  1257. // type: "VALUE",
  1258. // color: 0xffa1a1a1,
  1259. // default_value: f32_array_create_x(1.0),
  1260. // min: 0.0,
  1261. // max: 1.0,
  1262. // precision: 100,
  1263. // display: 0
  1264. // },
  1265. // {
  1266. // id: 0,
  1267. // node_id: 0,
  1268. // name: _tr("Occlusion"),
  1269. // type: "VALUE",
  1270. // color: 0xffa1a1a1,
  1271. // default_value: f32_array_create_x(1.0),
  1272. // min: 0.0,
  1273. // max: 1.0,
  1274. // precision: 100,
  1275. // display: 0
  1276. // },
  1277. // {
  1278. // id: 0,
  1279. // node_id: 0,
  1280. // name: _tr("Roughness"),
  1281. // type: "VALUE",
  1282. // color: 0xffa1a1a1,
  1283. // default_value: f32_array_create_x(0.1),
  1284. // min: 0.0,
  1285. // max: 1.0,
  1286. // precision: 100,
  1287. // display: 0
  1288. // },
  1289. // {
  1290. // id: 0,
  1291. // node_id: 0,
  1292. // name: _tr("Metallic"),
  1293. // type: "VALUE",
  1294. // color: 0xffa1a1a1,
  1295. // default_value: f32_array_create_x(0.0),
  1296. // min: 0.0,
  1297. // max: 1.0,
  1298. // precision: 100,
  1299. // display: 0
  1300. // },
  1301. // {
  1302. // id: 0,
  1303. // node_id: 0,
  1304. // name: _tr("Normal Map"),
  1305. // type: "VECTOR",
  1306. // color: -10238109,
  1307. // default_value: f32_array_create_xyz(0.5, 0.5, 1.0),
  1308. // min: 0.0,
  1309. // max: 1.0,
  1310. // precision: 100,
  1311. // display: 0
  1312. // },
  1313. // {
  1314. // id: 0,
  1315. // node_id: 0,
  1316. // name: _tr("Emission"),
  1317. // type: "VALUE",
  1318. // color: 0xffa1a1a1,
  1319. // default_value: f32_array_create_x(0.0),
  1320. // min: 0.0,
  1321. // max: 1.0,
  1322. // precision: 100,
  1323. // display: 0
  1324. // },
  1325. // {
  1326. // id: 0,
  1327. // node_id: 0,
  1328. // name: _tr("Height"),
  1329. // type: "VALUE",
  1330. // color: 0xffa1a1a1,
  1331. // default_value: f32_array_create_x(0.0),
  1332. // min: 0.0,
  1333. // max: 1.0,
  1334. // precision: 100,
  1335. // display: 0
  1336. // },
  1337. // {
  1338. // id: 0,
  1339. // node_id: 0,
  1340. // name: _tr("Subsurface"),
  1341. // type: "VALUE",
  1342. // color: 0xffa1a1a1,
  1343. // default_value: f32_array_create_x(0.0),
  1344. // min: 0.0,
  1345. // max: 1.0,
  1346. // precision: 100,
  1347. // display: 0
  1348. // }
  1349. // ],
  1350. // outputs: [],
  1351. // buttons: [],
  1352. // width: 0
  1353. // }
  1354. // ];
  1355. let nodes_material_texture: zui_node_t[] = [
  1356. {
  1357. id: 0,
  1358. name: _tr("Brick Texture"),
  1359. type: "TEX_BRICK",
  1360. x: 0,
  1361. y: 0,
  1362. color: 0xff4982a0,
  1363. inputs: [
  1364. {
  1365. id: 0,
  1366. node_id: 0,
  1367. name: _tr("Vector"),
  1368. type: "VECTOR",
  1369. color: 0xff6363c7,
  1370. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1371. min: 0.0,
  1372. max: 1.0,
  1373. precision: 100,
  1374. display: 0
  1375. },
  1376. {
  1377. id: 0,
  1378. node_id: 0,
  1379. name: _tr("Color 1"),
  1380. type: "RGBA",
  1381. color: 0xffc7c729,
  1382. default_value: f32_array_create_xyz(0.8, 0.8, 0.8),
  1383. min: 0.0,
  1384. max: 1.0,
  1385. precision: 100,
  1386. display: 0
  1387. },
  1388. {
  1389. id: 0,
  1390. node_id: 0,
  1391. name: _tr("Color 2"),
  1392. type: "RGBA",
  1393. color: 0xffc7c729,
  1394. default_value: f32_array_create_xyz(0.2, 0.2, 0.2),
  1395. min: 0.0,
  1396. max: 1.0,
  1397. precision: 100,
  1398. display: 0
  1399. },
  1400. {
  1401. id: 0,
  1402. node_id: 0,
  1403. name: _tr("Mortar"),
  1404. type: "RGBA",
  1405. color: 0xffc7c729,
  1406. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1407. min: 0.0,
  1408. max: 1.0,
  1409. precision: 100,
  1410. display: 0
  1411. },
  1412. {
  1413. id: 0,
  1414. node_id: 0,
  1415. name: _tr("Scale"),
  1416. type: "VALUE",
  1417. color: 0xffa1a1a1,
  1418. default_value: f32_array_create_x(5.0),
  1419. min: 0.0,
  1420. max: 10.0,
  1421. precision: 100,
  1422. display: 0
  1423. }
  1424. ],
  1425. outputs: [
  1426. {
  1427. id: 0,
  1428. node_id: 0,
  1429. name: _tr("Color"),
  1430. type: "RGBA",
  1431. color: 0xffc7c729,
  1432. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  1433. min: 0.0,
  1434. max: 1.0,
  1435. precision: 100,
  1436. display: 0
  1437. },
  1438. {
  1439. id: 0,
  1440. node_id: 0,
  1441. name: _tr("Fac"),
  1442. type: "VALUE",
  1443. color: 0xffa1a1a1,
  1444. default_value: f32_array_create_x(1.0),
  1445. min: 0.0,
  1446. max: 1.0,
  1447. precision: 100,
  1448. display: 0
  1449. }
  1450. ],
  1451. buttons: [],
  1452. width: 0
  1453. },
  1454. {
  1455. id: 0,
  1456. name: _tr("Checker Texture"),
  1457. type: "TEX_CHECKER",
  1458. x: 0,
  1459. y: 0,
  1460. color: 0xff4982a0,
  1461. inputs: [
  1462. {
  1463. id: 0,
  1464. node_id: 0,
  1465. name: _tr("Vector"),
  1466. type: "VECTOR",
  1467. color: 0xff6363c7,
  1468. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1469. min: 0.0,
  1470. max: 1.0,
  1471. precision: 100,
  1472. display: 0
  1473. },
  1474. {
  1475. id: 0,
  1476. node_id: 0,
  1477. name: _tr("Color 1"),
  1478. type: "RGBA",
  1479. color: 0xffc7c729,
  1480. default_value: f32_array_create_xyz(0.8, 0.8, 0.8),
  1481. min: 0.0,
  1482. max: 1.0,
  1483. precision: 100,
  1484. display: 0
  1485. },
  1486. {
  1487. id: 0,
  1488. node_id: 0,
  1489. name: _tr("Color 2"),
  1490. type: "RGBA",
  1491. color: 0xffc7c729,
  1492. default_value: f32_array_create_xyz(0.2, 0.2, 0.2),
  1493. min: 0.0,
  1494. max: 1.0,
  1495. precision: 100,
  1496. display: 0
  1497. },
  1498. {
  1499. id: 0,
  1500. node_id: 0,
  1501. name: _tr("Scale"),
  1502. type: "VALUE",
  1503. color: 0xffa1a1a1,
  1504. default_value: f32_array_create_x(5.0),
  1505. min: 0.0,
  1506. max: 1.0,
  1507. precision: 100,
  1508. display: 0
  1509. }
  1510. ],
  1511. outputs: [
  1512. {
  1513. id: 0,
  1514. node_id: 0,
  1515. name: _tr("Color"),
  1516. type: "RGBA",
  1517. color: 0xffc7c729,
  1518. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  1519. min: 0.0,
  1520. max: 1.0,
  1521. precision: 100,
  1522. display: 0
  1523. },
  1524. {
  1525. id: 0,
  1526. node_id: 0,
  1527. name: _tr("Fac"),
  1528. type: "VALUE",
  1529. color: 0xffa1a1a1,
  1530. default_value: f32_array_create_x(1.0),
  1531. min: 0.0,
  1532. max: 1.0,
  1533. precision: 100,
  1534. display: 0
  1535. }
  1536. ],
  1537. buttons: [],
  1538. width: 0
  1539. },
  1540. {
  1541. id: 0,
  1542. name: _tr("Curvature Bake"),
  1543. type: "BAKE_CURVATURE",
  1544. x: 0,
  1545. y: 0,
  1546. color: 0xff4982a0,
  1547. inputs: [
  1548. {
  1549. id: 0,
  1550. node_id: 0,
  1551. name: _tr("Strength"),
  1552. type: "VALUE",
  1553. color: 0xffa1a1a1,
  1554. default_value: f32_array_create_x(1.0),
  1555. min: 0.0,
  1556. max: 2.0,
  1557. precision: 100,
  1558. display: 0
  1559. },
  1560. {
  1561. id: 0,
  1562. node_id: 0,
  1563. name: _tr("Radius"),
  1564. type: "VALUE",
  1565. color: 0xffa1a1a1,
  1566. default_value: f32_array_create_x(1.0),
  1567. min: 0.0,
  1568. max: 2.0,
  1569. precision: 100,
  1570. display: 0
  1571. },
  1572. {
  1573. id: 0,
  1574. node_id: 0,
  1575. name: _tr("Offset"),
  1576. type: "VALUE",
  1577. color: 0xffa1a1a1,
  1578. default_value: f32_array_create_x(0.0),
  1579. min: -2.0,
  1580. max: 2.0,
  1581. precision: 100,
  1582. display: 0
  1583. }
  1584. ],
  1585. outputs: [
  1586. {
  1587. id: 0,
  1588. node_id: 0,
  1589. name: _tr("Value"),
  1590. type: "VALUE",
  1591. color: 0xffa1a1a1,
  1592. default_value: f32_array_create_x(1.0),
  1593. min: 0.0,
  1594. max: 1.0,
  1595. precision: 100,
  1596. display: 0
  1597. }
  1598. ],
  1599. buttons: [],
  1600. width: 0
  1601. },
  1602. {
  1603. id: 0,
  1604. name: _tr("Gradient Texture"),
  1605. type: "TEX_GRADIENT",
  1606. x: 0,
  1607. y: 0,
  1608. color: 0xff4982a0,
  1609. inputs: [
  1610. {
  1611. id: 0,
  1612. node_id: 0,
  1613. name: _tr("Vector"),
  1614. type: "VECTOR",
  1615. color: 0xff6363c7,
  1616. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1617. min: 0.0,
  1618. max: 1.0,
  1619. precision: 100,
  1620. display: 0
  1621. }
  1622. ],
  1623. outputs: [
  1624. {
  1625. id: 0,
  1626. node_id: 0,
  1627. name: _tr("Color"),
  1628. type: "RGBA",
  1629. color: 0xffc7c729,
  1630. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  1631. min: 0.0,
  1632. max: 1.0,
  1633. precision: 100,
  1634. display: 0
  1635. },
  1636. {
  1637. id: 0,
  1638. node_id: 0,
  1639. name: _tr("Fac"),
  1640. type: "VALUE",
  1641. color: 0xffa1a1a1,
  1642. default_value: f32_array_create_x(1.0),
  1643. min: 0.0,
  1644. max: 1.0,
  1645. precision: 100,
  1646. display: 0
  1647. }
  1648. ],
  1649. buttons: [
  1650. {
  1651. name: _tr("gradient_type"),
  1652. type: "ENUM",
  1653. output: 0,
  1654. default_value: f32_array_create_x(0),
  1655. data: u8_array_create_from_string(_tr("Linear") + "\0" + _tr("Diagonal") + "\0" + _tr("Radial") + "\0" + _tr("Spherical")),
  1656. min: 0.0,
  1657. max: 1.0,
  1658. precision: 100,
  1659. height: 0
  1660. }
  1661. ],
  1662. width: 0
  1663. },
  1664. {
  1665. id: 0,
  1666. name: _tr("Image Texture"),
  1667. type: "TEX_IMAGE",
  1668. x: 0,
  1669. y: 0,
  1670. color: 0xff4982a0,
  1671. inputs: [
  1672. {
  1673. id: 0,
  1674. node_id: 0,
  1675. name: _tr("Vector"),
  1676. type: "VECTOR",
  1677. color: 0xff6363c7,
  1678. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1679. min: 0.0,
  1680. max: 1.0,
  1681. precision: 100,
  1682. display: 0
  1683. }
  1684. ],
  1685. outputs: [
  1686. {
  1687. id: 0,
  1688. node_id: 0,
  1689. name: _tr("Color"),
  1690. type: "RGBA",
  1691. color: 0xffc7c729,
  1692. default_value: f32_array_create_xyzw(0.0, 0.0, 0.0, 1.0),
  1693. min: 0.0,
  1694. max: 1.0,
  1695. precision: 100,
  1696. display: 0
  1697. },
  1698. {
  1699. id: 0,
  1700. node_id: 0,
  1701. name: _tr("Alpha"),
  1702. type: "VALUE",
  1703. color: 0xffa1a1a1,
  1704. default_value: f32_array_create_x(1.0),
  1705. min: 0.0,
  1706. max: 1.0,
  1707. precision: 100,
  1708. display: 0
  1709. }
  1710. ],
  1711. buttons: [
  1712. {
  1713. name: _tr("File"),
  1714. type: "ENUM",
  1715. output: -1,
  1716. default_value: f32_array_create_x(0),
  1717. data: u8_array_create_from_string(""),
  1718. min: 0.0,
  1719. max: 1.0,
  1720. precision: 100,
  1721. height: 0
  1722. },
  1723. {
  1724. name: _tr("Color Space"),
  1725. type: "ENUM",
  1726. output: -1,
  1727. default_value: f32_array_create_x(0),
  1728. data: u8_array_create_from_string(_tr("Auto") + "\0" + _tr("Linear") + "\0" + _tr("sRGB") + "\0" + _tr("DirectX Normal Map")),
  1729. min: 0.0,
  1730. max: 1.0,
  1731. precision: 100,
  1732. height: 0
  1733. }
  1734. ],
  1735. width: 0
  1736. },
  1737. {
  1738. id: 0,
  1739. name: _tr("Magic Texture"),
  1740. type: "TEX_MAGIC",
  1741. x: 0,
  1742. y: 0,
  1743. color: 0xff4982a0,
  1744. inputs: [
  1745. {
  1746. id: 0,
  1747. node_id: 0,
  1748. name: _tr("Vector"),
  1749. type: "VECTOR",
  1750. color: 0xff6363c7,
  1751. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1752. min: 0.0,
  1753. max: 1.0,
  1754. precision: 100,
  1755. display: 0
  1756. },
  1757. {
  1758. id: 0,
  1759. node_id: 0,
  1760. name: _tr("Scale"),
  1761. type: "VALUE",
  1762. color: 0xffa1a1a1,
  1763. default_value: f32_array_create_x(5.0),
  1764. min: 0.0,
  1765. max: 10.0,
  1766. precision: 100,
  1767. display: 0
  1768. }
  1769. ],
  1770. outputs: [
  1771. {
  1772. id: 0,
  1773. node_id: 0,
  1774. name: _tr("Color"),
  1775. type: "RGBA",
  1776. color: 0xffc7c729,
  1777. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  1778. min: 0.0,
  1779. max: 1.0,
  1780. precision: 100,
  1781. display: 0
  1782. },
  1783. {
  1784. id: 0,
  1785. node_id: 0,
  1786. name: _tr("Fac"),
  1787. type: "VALUE",
  1788. color: 0xffa1a1a1,
  1789. default_value: f32_array_create_x(1.0),
  1790. min: 0.0,
  1791. max: 1.0,
  1792. precision: 100,
  1793. display: 0
  1794. }
  1795. ],
  1796. buttons: [],
  1797. width: 0
  1798. },
  1799. {
  1800. id: 0,
  1801. name: _tr("Musgrave Texture"),
  1802. type: "TEX_MUSGRAVE",
  1803. x: 0,
  1804. y: 0,
  1805. color: 0xff4982a0,
  1806. inputs: [
  1807. {
  1808. id: 0,
  1809. node_id: 0,
  1810. name: _tr("Vector"),
  1811. type: "VECTOR",
  1812. color: 0xff6363c7,
  1813. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1814. min: 0.0,
  1815. max: 1.0,
  1816. precision: 100,
  1817. display: 0
  1818. },
  1819. {
  1820. id: 0,
  1821. node_id: 0,
  1822. name: _tr("Scale"),
  1823. type: "VALUE",
  1824. color: 0xffa1a1a1,
  1825. default_value: f32_array_create_x(5.0),
  1826. min: 0.0,
  1827. max: 10.0,
  1828. precision: 100,
  1829. display: 0
  1830. }
  1831. ],
  1832. outputs: [
  1833. {
  1834. id: 0,
  1835. node_id: 0,
  1836. name: _tr("Height"),
  1837. type: "VALUE",
  1838. color: 0xffa1a1a1,
  1839. default_value: f32_array_create_x(1.0),
  1840. min: 0.0,
  1841. max: 1.0,
  1842. precision: 100,
  1843. display: 0
  1844. }
  1845. ],
  1846. buttons: [],
  1847. width: 0
  1848. },
  1849. {
  1850. id: 0,
  1851. name: _tr("Noise Texture"),
  1852. type: "TEX_NOISE",
  1853. x: 0,
  1854. y: 0,
  1855. color: 0xff4982a0,
  1856. inputs: [
  1857. {
  1858. id: 0,
  1859. node_id: 0,
  1860. name: _tr("Vector"),
  1861. type: "VECTOR",
  1862. color: 0xff6363c7,
  1863. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1864. min: 0.0,
  1865. max: 1.0,
  1866. precision: 100,
  1867. display: 0
  1868. },
  1869. {
  1870. id: 0,
  1871. node_id: 0,
  1872. name: _tr("Scale"),
  1873. type: "VALUE",
  1874. color: 0xffa1a1a1,
  1875. default_value: f32_array_create_x(5.0),
  1876. min: 0.0,
  1877. max: 10.0,
  1878. precision: 100,
  1879. display: 0
  1880. }
  1881. ],
  1882. outputs: [
  1883. {
  1884. id: 0,
  1885. node_id: 0,
  1886. name: _tr("Color"),
  1887. type: "RGBA",
  1888. color: 0xffc7c729,
  1889. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  1890. min: 0.0,
  1891. max: 1.0,
  1892. precision: 100,
  1893. display: 0
  1894. },
  1895. {
  1896. id: 0,
  1897. node_id: 0,
  1898. name: _tr("Fac"),
  1899. type: "VALUE",
  1900. color: 0xffa1a1a1,
  1901. default_value: f32_array_create_x(1.0),
  1902. min: 0.0,
  1903. max: 1.0,
  1904. precision: 100,
  1905. display: 0
  1906. }
  1907. ],
  1908. buttons: [],
  1909. width: 0
  1910. },
  1911. {
  1912. id: 0,
  1913. name: _tr("Voronoi Texture"),
  1914. type: "TEX_VORONOI",
  1915. x: 0,
  1916. y: 0,
  1917. color: 0xff4982a0,
  1918. inputs: [
  1919. {
  1920. id: 0,
  1921. node_id: 0,
  1922. name: _tr("Vector"),
  1923. type: "VECTOR",
  1924. color: 0xff6363c7,
  1925. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  1926. min: 0.0,
  1927. max: 1.0,
  1928. precision: 100,
  1929. display: 0
  1930. },
  1931. {
  1932. id: 0,
  1933. node_id: 0,
  1934. name: _tr("Scale"),
  1935. type: "VALUE",
  1936. color: 0xffa1a1a1,
  1937. default_value: f32_array_create_x(5.0),
  1938. min: 0.0,
  1939. max: 10.0,
  1940. precision: 100,
  1941. display: 0
  1942. }
  1943. ],
  1944. outputs: [
  1945. {
  1946. id: 0,
  1947. node_id: 0,
  1948. name: _tr("Color"),
  1949. type: "RGBA",
  1950. color: 0xffc7c729,
  1951. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  1952. min: 0.0,
  1953. max: 1.0,
  1954. precision: 100,
  1955. display: 0
  1956. },
  1957. {
  1958. id: 0,
  1959. node_id: 0,
  1960. name: _tr("Fac"),
  1961. type: "VALUE",
  1962. color: 0xffa1a1a1,
  1963. default_value: f32_array_create_x(1.0),
  1964. min: 0.0,
  1965. max: 1.0,
  1966. precision: 100,
  1967. display: 0
  1968. }
  1969. ],
  1970. buttons: [
  1971. {
  1972. name: _tr("coloring"),
  1973. type: "ENUM",
  1974. output: 0,
  1975. default_value: f32_array_create_x(0),
  1976. data: u8_array_create_from_string(_tr("Intensity") + "\0" + _tr("Cells")),
  1977. min: 0.0,
  1978. max: 1.0,
  1979. precision: 100,
  1980. height: 0
  1981. }
  1982. ],
  1983. width: 0
  1984. },
  1985. {
  1986. id: 0,
  1987. name: _tr("Wave Texture"),
  1988. type: "TEX_WAVE",
  1989. x: 0,
  1990. y: 0,
  1991. color: 0xff4982a0,
  1992. inputs: [
  1993. {
  1994. id: 0,
  1995. node_id: 0,
  1996. name: _tr("Vector"),
  1997. type: "VECTOR",
  1998. color: 0xff6363c7,
  1999. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  2000. min: 0.0,
  2001. max: 1.0,
  2002. precision: 100,
  2003. display: 0
  2004. },
  2005. {
  2006. id: 0,
  2007. node_id: 0,
  2008. name: _tr("Scale"),
  2009. type: "VALUE",
  2010. color: 0xffa1a1a1,
  2011. default_value: f32_array_create_x(5.0),
  2012. min: 0.0,
  2013. max: 10.0,
  2014. precision: 100,
  2015. display: 0
  2016. }
  2017. ],
  2018. outputs: [
  2019. {
  2020. id: 0,
  2021. node_id: 0,
  2022. name: _tr("Color"),
  2023. type: "RGBA",
  2024. color: 0xffc7c729,
  2025. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  2026. min: 0.0,
  2027. max: 1.0,
  2028. precision: 100,
  2029. display: 0
  2030. },
  2031. {
  2032. id: 0,
  2033. node_id: 0,
  2034. name: _tr("Fac"),
  2035. type: "VALUE",
  2036. color: 0xffa1a1a1,
  2037. default_value: f32_array_create_x(1.0),
  2038. min: 0.0,
  2039. max: 1.0,
  2040. precision: 100,
  2041. display: 0
  2042. }
  2043. ],
  2044. buttons: [],
  2045. width: 0
  2046. }
  2047. ];
  2048. let nodes_material_color: zui_node_t[] = [
  2049. {
  2050. id: 0,
  2051. name: _tr("Blur"),
  2052. type: "BLUR", // extension
  2053. x: 0,
  2054. y: 0,
  2055. color: 0xff448c6d,
  2056. inputs: [
  2057. {
  2058. id: 0,
  2059. node_id: 0,
  2060. name: _tr("Color"),
  2061. type: "RGBA",
  2062. color: 0xffc7c729,
  2063. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  2064. min: 0.0,
  2065. max: 1.0,
  2066. precision: 100,
  2067. display: 0
  2068. },
  2069. {
  2070. id: 0,
  2071. node_id: 0,
  2072. name: _tr("Strength"),
  2073. type: "VALUE",
  2074. color: 0xffa1a1a1,
  2075. default_value: f32_array_create_x(0.5),
  2076. min: 0.0,
  2077. max: 1.0,
  2078. precision: 100,
  2079. display: 0
  2080. }
  2081. ],
  2082. outputs: [
  2083. {
  2084. id: 0,
  2085. node_id: 0,
  2086. name: _tr("Color"),
  2087. type: "RGBA",
  2088. color: 0xffc7c729,
  2089. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  2090. min: 0.0,
  2091. max: 1.0,
  2092. precision: 100,
  2093. display: 0
  2094. }
  2095. ],
  2096. buttons: [],
  2097. width: 0
  2098. },
  2099. {
  2100. id: 0,
  2101. name: _tr("Bright/Contrast"),
  2102. type: "BRIGHTCONTRAST",
  2103. x: 0,
  2104. y: 0,
  2105. color: 0xff448c6d,
  2106. inputs: [
  2107. {
  2108. id: 0,
  2109. node_id: 0,
  2110. name: _tr("Color"),
  2111. type: "RGBA",
  2112. color: 0xffc7c729,
  2113. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  2114. min: 0.0,
  2115. max: 1.0,
  2116. precision: 100,
  2117. display: 0
  2118. },
  2119. {
  2120. id: 0,
  2121. node_id: 0,
  2122. name: _tr("Bright"),
  2123. type: "VALUE",
  2124. color: 0xffa1a1a1,
  2125. default_value: f32_array_create_x(0.0),
  2126. min: 0.0,
  2127. max: 1.0,
  2128. precision: 100,
  2129. display: 0
  2130. },
  2131. {
  2132. id: 0,
  2133. node_id: 0,
  2134. name: _tr("Contrast"),
  2135. type: "VALUE",
  2136. color: 0xffa1a1a1,
  2137. default_value: f32_array_create_x(0.0),
  2138. min: 0.0,
  2139. max: 1.0,
  2140. precision: 100,
  2141. display: 0
  2142. }
  2143. ],
  2144. outputs: [
  2145. {
  2146. id: 0,
  2147. node_id: 0,
  2148. name: _tr("Color"),
  2149. type: "RGBA",
  2150. color: 0xffc7c729,
  2151. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  2152. min: 0.0,
  2153. max: 1.0,
  2154. precision: 100,
  2155. display: 0
  2156. }
  2157. ],
  2158. buttons: [],
  2159. width: 0
  2160. },
  2161. {
  2162. id: 0,
  2163. name: _tr("Gamma"),
  2164. type: "GAMMA",
  2165. x: 0,
  2166. y: 0,
  2167. color: 0xff448c6d,
  2168. inputs: [
  2169. {
  2170. id: 0,
  2171. node_id: 0,
  2172. name: _tr("Color"),
  2173. type: "RGBA",
  2174. color: 0xffc7c729,
  2175. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  2176. min: 0.0,
  2177. max: 1.0,
  2178. precision: 100,
  2179. display: 0
  2180. },
  2181. {
  2182. id: 0,
  2183. node_id: 0,
  2184. name: _tr("Gamma"),
  2185. type: "VALUE",
  2186. color: 0xffa1a1a1,
  2187. default_value: f32_array_create_x(1.0),
  2188. min: 0.0,
  2189. max: 1.0,
  2190. precision: 100,
  2191. display: 0
  2192. }
  2193. ],
  2194. outputs: [
  2195. {
  2196. id: 0,
  2197. node_id: 0,
  2198. name: _tr("Color"),
  2199. type: "RGBA",
  2200. color: 0xffc7c729,
  2201. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  2202. min: 0.0,
  2203. max: 1.0,
  2204. precision: 100,
  2205. display: 0
  2206. }
  2207. ],
  2208. buttons: [],
  2209. width: 0
  2210. },
  2211. {
  2212. id: 0,
  2213. name: _tr("Hue/Saturation"),
  2214. type: "HUE_SAT",
  2215. x: 0,
  2216. y: 0,
  2217. color: 0xff448c6d,
  2218. inputs: [
  2219. {
  2220. id: 0,
  2221. node_id: 0,
  2222. name: _tr("Hue"),
  2223. type: "VALUE",
  2224. color: 0xffa1a1a1,
  2225. default_value: f32_array_create_x(0.5),
  2226. min: 0.0,
  2227. max: 1.0,
  2228. precision: 100,
  2229. display: 0
  2230. },
  2231. {
  2232. id: 0,
  2233. node_id: 0,
  2234. name: _tr("Saturation"),
  2235. type: "VALUE",
  2236. color: 0xffa1a1a1,
  2237. default_value: f32_array_create_x(1.0),
  2238. min: 0.0,
  2239. max: 1.0,
  2240. precision: 100,
  2241. display: 0
  2242. },
  2243. {
  2244. id: 0,
  2245. node_id: 0,
  2246. name: _tr("Value"),
  2247. type: "VALUE",
  2248. color: 0xffa1a1a1,
  2249. default_value: f32_array_create_x(1.0),
  2250. min: 0.0,
  2251. max: 1.0,
  2252. precision: 100,
  2253. display: 0
  2254. },
  2255. {
  2256. id: 0,
  2257. node_id: 0,
  2258. name: _tr("Fac"),
  2259. type: "VALUE",
  2260. color: 0xffa1a1a1,
  2261. default_value: f32_array_create_x(1.0),
  2262. min: 0.0,
  2263. max: 1.0,
  2264. precision: 100,
  2265. display: 0
  2266. },
  2267. {
  2268. id: 0,
  2269. node_id: 0,
  2270. name: _tr("Color"),
  2271. type: "RGBA",
  2272. color: 0xffc7c729,
  2273. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  2274. min: 0.0,
  2275. max: 1.0,
  2276. precision: 100,
  2277. display: 0
  2278. }
  2279. ],
  2280. outputs: [
  2281. {
  2282. id: 0,
  2283. node_id: 0,
  2284. name: _tr("Color"),
  2285. type: "RGBA",
  2286. color: 0xffc7c729,
  2287. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  2288. min: 0.0,
  2289. max: 1.0,
  2290. precision: 100,
  2291. display: 0
  2292. }
  2293. ],
  2294. buttons: [],
  2295. width: 0
  2296. },
  2297. {
  2298. id: 0,
  2299. name: _tr("Invert"),
  2300. type: "INVERT",
  2301. x: 0,
  2302. y: 0,
  2303. color: 0xff448c6d,
  2304. inputs: [
  2305. {
  2306. id: 0,
  2307. node_id: 0,
  2308. name: _tr("Fac"),
  2309. type: "VALUE",
  2310. color: 0xffa1a1a1,
  2311. default_value: f32_array_create_x(1.0),
  2312. min: 0.0,
  2313. max: 1.0,
  2314. precision: 100,
  2315. display: 0
  2316. },
  2317. {
  2318. id: 0,
  2319. node_id: 0,
  2320. name: _tr("Color"),
  2321. type: "RGBA",
  2322. color: 0xffc7c729,
  2323. default_value: f32_array_create_xyzw(0.0, 0.0, 0.0, 1.0),
  2324. min: 0.0,
  2325. max: 1.0,
  2326. precision: 100,
  2327. display: 0
  2328. }
  2329. ],
  2330. outputs: [
  2331. {
  2332. id: 0,
  2333. node_id: 0,
  2334. name: _tr("Color"),
  2335. type: "RGBA",
  2336. color: 0xffc7c729,
  2337. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  2338. min: 0.0,
  2339. max: 1.0,
  2340. precision: 100,
  2341. display: 0
  2342. }
  2343. ],
  2344. buttons: [],
  2345. width: 0
  2346. },
  2347. {
  2348. id: 0,
  2349. name: _tr("MixRGB"),
  2350. type: "MIX_RGB",
  2351. x: 0,
  2352. y: 0,
  2353. color: 0xff448c6d,
  2354. inputs: [
  2355. {
  2356. id: 0,
  2357. node_id: 0,
  2358. name: _tr("Fac"),
  2359. type: "VALUE",
  2360. color: 0xffa1a1a1,
  2361. default_value: f32_array_create_x(0.5),
  2362. min: 0.0,
  2363. max: 1.0,
  2364. precision: 100,
  2365. display: 0
  2366. },
  2367. {
  2368. id: 0,
  2369. node_id: 0,
  2370. name: _tr("Color 1"),
  2371. type: "RGBA",
  2372. color: 0xffc7c729,
  2373. default_value: f32_array_create_xyzw(0.5, 0.5, 0.5, 1.0),
  2374. min: 0.0,
  2375. max: 1.0,
  2376. precision: 100,
  2377. display: 0
  2378. },
  2379. {
  2380. id: 0,
  2381. node_id: 0,
  2382. name: _tr("Color 2"),
  2383. type: "RGBA",
  2384. color: 0xffc7c729,
  2385. default_value: f32_array_create_xyzw(0.5, 0.5, 0.5, 1.0),
  2386. min: 0.0,
  2387. max: 1.0,
  2388. precision: 100,
  2389. display: 0
  2390. }
  2391. ],
  2392. outputs: [
  2393. {
  2394. id: 0,
  2395. node_id: 0,
  2396. name: _tr("Color"),
  2397. type: "RGBA",
  2398. color: 0xffc7c729,
  2399. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  2400. min: 0.0,
  2401. max: 1.0,
  2402. precision: 100,
  2403. display: 0
  2404. }
  2405. ],
  2406. buttons: [
  2407. {
  2408. name: _tr("blend_type"),
  2409. type: "ENUM",
  2410. output: 0,
  2411. default_value: f32_array_create_x(0),
  2412. data: u8_array_create_from_string(_tr("Mix") + "\0" + _tr("Darken") + "\0" + _tr("Multiply") + "\0" + _tr("Burn") + "\0" + _tr("Lighten") + "\0" + _tr("Screen") + "\0" + _tr("Dodge") + "\0" + _tr("Add") + "\0" + _tr("Overlay") + "\0" + _tr("Soft Light") + "\0" + _tr("Linear Light") + "\0" + _tr("Difference") + "\0" + _tr("Subtract") + "\0" + _tr("Divide") + "\0" + _tr("Hue") + "\0" + _tr("Saturation") + "\0" + _tr("Color") + "\0" + _tr("Value")),
  2413. min: 0.0,
  2414. max: 1.0,
  2415. precision: 100,
  2416. height: 0
  2417. },
  2418. {
  2419. name: _tr("use_clamp"),
  2420. type: "BOOL",
  2421. output: 0,
  2422. default_value: f32_array_create_x(0),
  2423. data: null,
  2424. min: 0.0,
  2425. max: 1.0,
  2426. precision: 100,
  2427. height: 0
  2428. }
  2429. ],
  2430. width: 0
  2431. },
  2432. {
  2433. id: 0,
  2434. name: _tr("Quantize"),
  2435. type: "QUANTIZE",
  2436. x: 0,
  2437. y: 0,
  2438. color: 0xff448c6d,
  2439. inputs: [
  2440. {
  2441. id: 0,
  2442. node_id: 0,
  2443. name: _tr("Stength"),
  2444. type: "VALUE",
  2445. color: 0xffa1a1a1,
  2446. default_value: f32_array_create_x(0.1),
  2447. min: 0.0,
  2448. max: 1.0,
  2449. precision: 100,
  2450. display: 0
  2451. },
  2452. {
  2453. id: 0,
  2454. node_id: 0,
  2455. name: _tr("Color"),
  2456. type: "RGBA",
  2457. color: 0xffc7c729,
  2458. default_value: f32_array_create_xyzw(0.0, 0.0, 0.0, 1.0),
  2459. min: 0.0,
  2460. max: 1.0,
  2461. precision: 100,
  2462. display: 0
  2463. }
  2464. ],
  2465. outputs: [
  2466. {
  2467. id: 0,
  2468. node_id: 0,
  2469. name: _tr("Color"),
  2470. type: "RGBA",
  2471. color: 0xffc7c729,
  2472. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  2473. min: 0.0,
  2474. max: 1.0,
  2475. precision: 100,
  2476. display: 0
  2477. }
  2478. ],
  2479. buttons: [],
  2480. width: 0
  2481. },
  2482. {
  2483. id: 0,
  2484. name: _tr("Warp"),
  2485. type: "DIRECT_WARP", // extension
  2486. x: 0,
  2487. y: 0,
  2488. color: 0xff448c6d,
  2489. inputs: [
  2490. {
  2491. id: 0,
  2492. node_id: 0,
  2493. name: _tr("Color"),
  2494. type: "RGBA",
  2495. color: 0xffc7c729,
  2496. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  2497. min: 0.0,
  2498. max: 1.0,
  2499. precision: 100,
  2500. display: 0
  2501. },
  2502. {
  2503. id: 0,
  2504. node_id: 0,
  2505. name: _tr("Angle"),
  2506. type: "VALUE",
  2507. color: 0xffa1a1a1,
  2508. default_value: f32_array_create_x(0.0),
  2509. min: 0.0,
  2510. max: 360.0,
  2511. precision: 100,
  2512. display: 0
  2513. },
  2514. {
  2515. id: 0,
  2516. node_id: 0,
  2517. name: _tr("Mask"),
  2518. type: "VALUE",
  2519. color: 0xffa1a1a1,
  2520. default_value: f32_array_create_x(0.5),
  2521. min: 0.0,
  2522. max: 1.0,
  2523. precision: 100,
  2524. display: 0
  2525. }
  2526. ],
  2527. outputs: [
  2528. {
  2529. id: 0,
  2530. node_id: 0,
  2531. name: _tr("Color"),
  2532. type: "RGBA",
  2533. color: 0xffc7c729,
  2534. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  2535. min: 0.0,
  2536. max: 1.0,
  2537. precision: 100,
  2538. display: 0
  2539. }
  2540. ],
  2541. buttons: [],
  2542. width: 0
  2543. }
  2544. ];
  2545. let nodes_material_vector: zui_node_t[] = [
  2546. {
  2547. id: 0,
  2548. name: _tr("Bump"),
  2549. type: "BUMP",
  2550. x: 0,
  2551. y: 0,
  2552. color: 0xff522c99,
  2553. inputs: [
  2554. {
  2555. id: 0,
  2556. node_id: 0,
  2557. name: _tr("Strength"),
  2558. type: "VALUE",
  2559. color: 0xffa1a1a1,
  2560. default_value: f32_array_create_x(1.0),
  2561. min: 0.0,
  2562. max: 1.0,
  2563. precision: 100,
  2564. display: 0
  2565. },
  2566. {
  2567. id: 0,
  2568. node_id: 0,
  2569. name: _tr("Distance"),
  2570. type: "VALUE",
  2571. color: 0xffa1a1a1,
  2572. default_value: f32_array_create_x(0.0),
  2573. min: 0.0,
  2574. max: 1.0,
  2575. precision: 100,
  2576. display: 0
  2577. },
  2578. {
  2579. id: 0,
  2580. node_id: 0,
  2581. name: _tr("Height"),
  2582. type: "VALUE",
  2583. color: 0xffa1a1a1,
  2584. default_value: f32_array_create_x(1.0),
  2585. min: 0.0,
  2586. max: 1.0,
  2587. precision: 100,
  2588. display: 0
  2589. },
  2590. {
  2591. id: 0,
  2592. node_id: 0,
  2593. name: _tr("Normal"),
  2594. type: "VECTOR",
  2595. color: 0xff6363c7,
  2596. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  2597. min: 0.0,
  2598. max: 1.0,
  2599. precision: 100,
  2600. display: 0
  2601. }
  2602. ],
  2603. outputs: [
  2604. {
  2605. id: 0,
  2606. node_id: 0,
  2607. name: _tr("Normal Map"),
  2608. type: "VECTOR",
  2609. color: -10238109,
  2610. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  2611. min: 0.0,
  2612. max: 1.0,
  2613. precision: 100,
  2614. display: 0
  2615. }
  2616. ],
  2617. buttons: [],
  2618. width: 0
  2619. },
  2620. {
  2621. id: 0,
  2622. name: _tr("Mapping"),
  2623. type: "MAPPING",
  2624. x: 0,
  2625. y: 0,
  2626. color: 0xff522c99,
  2627. inputs: [
  2628. {
  2629. id: 0,
  2630. node_id: 0,
  2631. name: _tr("Vector"),
  2632. type: "VECTOR",
  2633. color: 0xff6363c7,
  2634. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  2635. min: 0.0,
  2636. max: 1.0,
  2637. precision: 100,
  2638. display: 0
  2639. },
  2640. {
  2641. id: 0,
  2642. node_id: 0,
  2643. name: _tr("Location"),
  2644. type: "VECTOR",
  2645. color: 0xff6363c7,
  2646. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  2647. min: 0.0,
  2648. max: 1.0,
  2649. precision: 100,
  2650. display: 1
  2651. },
  2652. {
  2653. id: 0,
  2654. node_id: 0,
  2655. name: _tr("Rotation"),
  2656. type: "VECTOR",
  2657. color: 0xff6363c7,
  2658. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  2659. min: 0.0,
  2660. max: 360.0,
  2661. precision: 100,
  2662. display: 1
  2663. },
  2664. {
  2665. id: 0,
  2666. node_id: 0,
  2667. name: _tr("Scale"),
  2668. type: "VECTOR",
  2669. color: 0xff6363c7,
  2670. default_value: f32_array_create_xyz(1.0, 1.0, 1.0),
  2671. min: 0.0,
  2672. max: 1.0,
  2673. precision: 100,
  2674. display: 1
  2675. }
  2676. ],
  2677. outputs: [
  2678. {
  2679. id: 0,
  2680. node_id: 0,
  2681. name: _tr("Vector"),
  2682. type: "VECTOR",
  2683. color: 0xff6363c7,
  2684. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  2685. min: 0.0,
  2686. max: 1.0,
  2687. precision: 100,
  2688. display: 0
  2689. }
  2690. ],
  2691. buttons: [],
  2692. width: 0
  2693. },
  2694. {
  2695. id: 0,
  2696. name: _tr("Mix Normal Map"),
  2697. type: "MIX_NORMAL_MAP",
  2698. x: 0,
  2699. y: 0,
  2700. color: 0xff522c99,
  2701. inputs: [
  2702. {
  2703. id: 0,
  2704. node_id: 0,
  2705. name: _tr("Normal Map 1"),
  2706. type: "VECTOR",
  2707. color: -10238109,
  2708. default_value: f32_array_create_xyz(0.5, 0.5, 1.0),
  2709. min: 0.0,
  2710. max: 1.0,
  2711. precision: 100,
  2712. display: 0
  2713. },
  2714. {
  2715. id: 0,
  2716. node_id: 0,
  2717. name: _tr("Normal Map 2"),
  2718. type: "VECTOR",
  2719. color: -10238109,
  2720. default_value: f32_array_create_xyz(0.5, 0.5, 1.0),
  2721. min: 0.0,
  2722. max: 1.0,
  2723. precision: 100,
  2724. display: 0
  2725. }
  2726. ],
  2727. outputs: [
  2728. {
  2729. id: 0,
  2730. node_id: 0,
  2731. name: _tr("Normal Map"),
  2732. type: "VECTOR",
  2733. color: -10238109,
  2734. default_value: f32_array_create_xyz(0.5, 0.5, 1.0),
  2735. min: 0.0,
  2736. max: 1.0,
  2737. precision: 100,
  2738. display: 0
  2739. }
  2740. ],
  2741. buttons: [
  2742. {
  2743. name: _tr("blend_type"),
  2744. type: "ENUM",
  2745. output: 0,
  2746. default_value: f32_array_create_x(0),
  2747. data: u8_array_create_from_string(_tr("Partial Derivative") + "\0" + _tr("Whiteout") + "\0" + _tr("Reoriented")),
  2748. min: 0.0,
  2749. max: 1.0,
  2750. precision: 100,
  2751. height: 0
  2752. }
  2753. ],
  2754. width: 0
  2755. },
  2756. {
  2757. id: 0,
  2758. name: _tr("Normal"),
  2759. type: "NORMAL",
  2760. x: 0,
  2761. y: 0,
  2762. color: 0xff522c99,
  2763. inputs: [
  2764. {
  2765. id: 0,
  2766. node_id: 0,
  2767. name: _tr("Normal"),
  2768. type: "VECTOR",
  2769. color: 0xff6363c7,
  2770. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  2771. min: 0.0,
  2772. max: 1.0,
  2773. precision: 100,
  2774. display: 0
  2775. }
  2776. ],
  2777. outputs: [
  2778. {
  2779. id: 0,
  2780. node_id: 0,
  2781. name: _tr("Normal"),
  2782. type: "VECTOR",
  2783. color: 0xff6363c7,
  2784. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  2785. min: 0.0,
  2786. max: 1.0,
  2787. precision: 100,
  2788. display: 0
  2789. },
  2790. {
  2791. id: 0,
  2792. node_id: 0,
  2793. name: _tr("Dot"),
  2794. type: "VALUE",
  2795. color: 0xffa1a1a1,
  2796. default_value: f32_array_create_x(1.0),
  2797. min: 0.0,
  2798. max: 1.0,
  2799. precision: 100,
  2800. display: 0
  2801. }
  2802. ],
  2803. buttons: [
  2804. {
  2805. name: _tr("Vector"),
  2806. type: "VECTOR",
  2807. output: 0,
  2808. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  2809. data: null,
  2810. min: 0.0,
  2811. max: 1.0,
  2812. precision: 100,
  2813. height: 0
  2814. }
  2815. ],
  2816. width: 0
  2817. },
  2818. {
  2819. id: 0,
  2820. name: _tr("Normal Map"),
  2821. type: "NORMAL_MAP",
  2822. x: 0,
  2823. y: 0,
  2824. color: 0xff522c99,
  2825. inputs: [
  2826. {
  2827. id: 0,
  2828. node_id: 0,
  2829. name: _tr("Stength"),
  2830. type: "VALUE",
  2831. color: 0xffa1a1a1,
  2832. default_value: f32_array_create_x(1.0),
  2833. min: 0.0,
  2834. max: 2.0,
  2835. precision: 100,
  2836. display: 0
  2837. },
  2838. {
  2839. id: 0,
  2840. node_id: 0,
  2841. name: _tr("Normal Map"),
  2842. type: "VECTOR",
  2843. color: -10238109,
  2844. default_value: f32_array_create_xyz(0.5, 0.5, 1.0),
  2845. min: 0.0,
  2846. max: 1.0,
  2847. precision: 100,
  2848. display: 0
  2849. }
  2850. ],
  2851. outputs: [
  2852. {
  2853. id: 0,
  2854. node_id: 0,
  2855. name: _tr("Normal Map"),
  2856. type: "VECTOR",
  2857. color: -10238109,
  2858. default_value: f32_array_create_xyz(0.5, 0.5, 1.0),
  2859. min: 0.0,
  2860. max: 1.0,
  2861. precision: 100,
  2862. display: 0
  2863. }
  2864. ],
  2865. buttons: [],
  2866. width: 0
  2867. },
  2868. {
  2869. id: 0,
  2870. name: _tr("Vector Curves"),
  2871. type: "CURVE_VEC",
  2872. x: 0,
  2873. y: 0,
  2874. color: 0xff522c99,
  2875. inputs: [
  2876. {
  2877. id: 0,
  2878. node_id: 0,
  2879. name: _tr("Fac"),
  2880. type: "VALUE",
  2881. color: 0xffa1a1a1,
  2882. default_value: f32_array_create_x(1.0),
  2883. min: 0.0,
  2884. max: 1.0,
  2885. precision: 100,
  2886. display: 0
  2887. },
  2888. {
  2889. id: 0,
  2890. node_id: 0,
  2891. name: _tr("Vector"),
  2892. type: "VECTOR",
  2893. color: 0xff6363c7,
  2894. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  2895. min: 0.0,
  2896. max: 1.0,
  2897. precision: 100,
  2898. display: 0
  2899. }
  2900. ],
  2901. outputs: [
  2902. {
  2903. id: 0,
  2904. node_id: 0,
  2905. name: _tr("Vector"),
  2906. type: "VECTOR",
  2907. color: 0xff6363c7,
  2908. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  2909. min: 0.0,
  2910. max: 1.0,
  2911. precision: 100,
  2912. display: 0
  2913. }
  2914. ],
  2915. buttons: [
  2916. {
  2917. name: "nodes_material_vector_curves_button",
  2918. type: "CUSTOM",
  2919. output: 0,
  2920. // default_value: [[f32_array_create_xy(0.0, 0.0), f32_array_create_xy(0.0, 0.0)], [f32_array_create_xy(0.0, 0.0), f32_array_create_xy(0.0, 0.0)], [f32_array_create_xy(0.0, 0.0), f32_array_create_xy(0.0, 0.0)]],
  2921. default_value: f32_array_create(0),
  2922. data: null,
  2923. min: 0.0,
  2924. max: 1.0,
  2925. precision: 100,
  2926. height: 8.5
  2927. }
  2928. ],
  2929. width: 0
  2930. }
  2931. ];
  2932. let nodes_material_converter: zui_node_t[] = [
  2933. {
  2934. id: 0,
  2935. name: _tr("Clamp"),
  2936. type: "CLAMP",
  2937. x: 0,
  2938. y: 0,
  2939. color: 0xff62676d,
  2940. inputs: [
  2941. {
  2942. id: 0,
  2943. node_id: 0,
  2944. name: _tr("Value"),
  2945. type: "VALUE",
  2946. color: 0xffa1a1a1,
  2947. default_value: f32_array_create_x(0.5),
  2948. min: 0.0,
  2949. max: 1.0,
  2950. precision: 100,
  2951. display: 0
  2952. },
  2953. {
  2954. id: 0,
  2955. node_id: 0,
  2956. name: _tr("Min"),
  2957. type: "VALUE",
  2958. color: 0xffa1a1a1,
  2959. default_value: f32_array_create_x(0.0),
  2960. min: 0.0,
  2961. max: 1.0,
  2962. precision: 100,
  2963. display: 0
  2964. },
  2965. {
  2966. id: 0,
  2967. node_id: 0,
  2968. name: _tr("Max"),
  2969. type: "VALUE",
  2970. color: 0xffa1a1a1,
  2971. default_value: f32_array_create_x(1.0),
  2972. min: 0.0,
  2973. max: 1.0,
  2974. precision: 100,
  2975. display: 0
  2976. }
  2977. ],
  2978. outputs: [
  2979. {
  2980. id: 0,
  2981. node_id: 0,
  2982. name: _tr("Value"),
  2983. type: "VALUE",
  2984. color: 0xffa1a1a1,
  2985. default_value: f32_array_create_x(0.0),
  2986. min: 0.0,
  2987. max: 1.0,
  2988. precision: 100,
  2989. display: 0
  2990. }
  2991. ],
  2992. buttons: [
  2993. {
  2994. name: _tr("operation"),
  2995. type: "ENUM",
  2996. output: 0,
  2997. default_value: f32_array_create_x(0),
  2998. data: u8_array_create_from_string(_tr("Min Max") + "\0" + _tr("Range")),
  2999. min: 0.0,
  3000. max: 1.0,
  3001. precision: 100,
  3002. height: 0
  3003. }
  3004. ],
  3005. width: 0
  3006. },
  3007. {
  3008. id: 0,
  3009. name: _tr("Color Ramp"),
  3010. type: "VALTORGB",
  3011. x: 0,
  3012. y: 0,
  3013. color: 0xff62676d,
  3014. inputs: [
  3015. {
  3016. id: 0,
  3017. node_id: 0,
  3018. name: _tr("Fac"),
  3019. type: "VALUE",
  3020. color: 0xffa1a1a1,
  3021. default_value: f32_array_create_x(0.5),
  3022. min: 0.0,
  3023. max: 1.0,
  3024. precision: 100,
  3025. display: 0
  3026. }
  3027. ],
  3028. outputs: [
  3029. {
  3030. id: 0,
  3031. node_id: 0,
  3032. name: _tr("Color"),
  3033. type: "RGBA",
  3034. color: 0xffc7c729,
  3035. default_value: f32_array_create_xyzw(0.0, 0.0, 0.0, 1.0),
  3036. min: 0.0,
  3037. max: 1.0,
  3038. precision: 100,
  3039. display: 0
  3040. },
  3041. {
  3042. id: 0,
  3043. node_id: 0,
  3044. name: _tr("Alpha"),
  3045. type: "VALUE",
  3046. color: 0xffa1a1a1,
  3047. default_value: f32_array_create_x(0.0),
  3048. min: 0.0,
  3049. max: 1.0,
  3050. precision: 100,
  3051. display: 0
  3052. }
  3053. ],
  3054. buttons: [
  3055. {
  3056. name: "nodes_material_color_ramp_button",
  3057. type: "CUSTOM",
  3058. output: 0,
  3059. // default_value: [f32_array_create_xyzwv(1.0, 1.0, 1.0, 1.0, 0.0)],
  3060. default_value: f32_array_create_xyzwv(1.0, 1.0, 1.0, 1.0, 0.0),
  3061. data: u8_array_create(1),
  3062. min: 0.0,
  3063. max: 1.0,
  3064. precision: 100,
  3065. height: 4.5
  3066. }
  3067. ],
  3068. width: 0
  3069. },
  3070. {
  3071. id: 0,
  3072. name: _tr("Color Mask"),
  3073. type: "COLMASK",
  3074. x: 0,
  3075. y: 0,
  3076. color: 0xff62676d,
  3077. inputs: [
  3078. {
  3079. id: 0,
  3080. node_id: 0,
  3081. name: _tr("Color"),
  3082. type: "RGBA",
  3083. color: 0xffc7c729,
  3084. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  3085. min: 0.0,
  3086. max: 1.0,
  3087. precision: 100,
  3088. display: 0
  3089. },
  3090. {
  3091. id: 0,
  3092. node_id: 0,
  3093. name: _tr("Mask Color"),
  3094. type: "RGBA",
  3095. color: 0xffc7c729,
  3096. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  3097. min: 0.0,
  3098. max: 1.0,
  3099. precision: 100,
  3100. display: 0
  3101. },
  3102. {
  3103. id: 0,
  3104. node_id: 0,
  3105. name: _tr("Radius"),
  3106. type: "VALUE",
  3107. color: 0xffa1a1a1,
  3108. default_value: f32_array_create_x(0.1),
  3109. min: 0.0,
  3110. max: 1.74,
  3111. precision: 100,
  3112. display: 0
  3113. },
  3114. {
  3115. id: 0,
  3116. node_id: 0,
  3117. name: _tr("Fuzziness"),
  3118. type: "VALUE",
  3119. color: 0xffa1a1a1,
  3120. default_value: f32_array_create_x(0.0),
  3121. min: 0.0,
  3122. max: 1.0,
  3123. precision: 100,
  3124. display: 0
  3125. }
  3126. ],
  3127. outputs: [
  3128. {
  3129. id: 0,
  3130. node_id: 0,
  3131. name: _tr("Mask"),
  3132. type: "VALUE",
  3133. color: 0xffa1a1a1,
  3134. default_value: f32_array_create_x(0.0),
  3135. min: 0.0,
  3136. max: 1.0,
  3137. precision: 100,
  3138. display: 0
  3139. }
  3140. ],
  3141. buttons: [],
  3142. width: 0
  3143. },
  3144. {
  3145. id: 0,
  3146. name: _tr("Combine HSV"),
  3147. type: "COMBHSV",
  3148. x: 0,
  3149. y: 0,
  3150. color: 0xff62676d,
  3151. inputs: [
  3152. {
  3153. id: 0,
  3154. node_id: 0,
  3155. name: _tr("H"),
  3156. type: "VALUE",
  3157. color: 0xffa1a1a1,
  3158. default_value: f32_array_create_x(0.0),
  3159. min: 0.0,
  3160. max: 1.0,
  3161. precision: 100,
  3162. display: 0
  3163. },
  3164. {
  3165. id: 0,
  3166. node_id: 0,
  3167. name: _tr("S"),
  3168. type: "VALUE",
  3169. color: 0xffa1a1a1,
  3170. default_value: f32_array_create_x(0.0),
  3171. min: 0.0,
  3172. max: 1.0,
  3173. precision: 100,
  3174. display: 0
  3175. },
  3176. {
  3177. id: 0,
  3178. node_id: 0,
  3179. name: _tr("V"),
  3180. type: "VALUE",
  3181. color: 0xffa1a1a1,
  3182. default_value: f32_array_create_x(0.0),
  3183. min: 0.0,
  3184. max: 1.0,
  3185. precision: 100,
  3186. display: 0
  3187. }
  3188. ],
  3189. outputs: [
  3190. {
  3191. id: 0,
  3192. node_id: 0,
  3193. name: _tr("Color"),
  3194. type: "RGBA",
  3195. color: 0xffc7c729,
  3196. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  3197. min: 0.0,
  3198. max: 1.0,
  3199. precision: 100,
  3200. display: 0
  3201. }
  3202. ],
  3203. buttons: [],
  3204. width: 0
  3205. },
  3206. {
  3207. id: 0,
  3208. name: _tr("Combine RGB"),
  3209. type: "COMBRGB",
  3210. x: 0,
  3211. y: 0,
  3212. color: 0xff62676d,
  3213. inputs: [
  3214. {
  3215. id: 0,
  3216. node_id: 0,
  3217. name: _tr("R"),
  3218. type: "VALUE",
  3219. color: 0xffa1a1a1,
  3220. default_value: f32_array_create_x(0.0),
  3221. min: 0.0,
  3222. max: 1.0,
  3223. precision: 100,
  3224. display: 0
  3225. },
  3226. {
  3227. id: 0,
  3228. node_id: 0,
  3229. name: _tr("G"),
  3230. type: "VALUE",
  3231. color: 0xffa1a1a1,
  3232. default_value: f32_array_create_x(0.0),
  3233. min: 0.0,
  3234. max: 1.0,
  3235. precision: 100,
  3236. display: 0
  3237. },
  3238. {
  3239. id: 0,
  3240. node_id: 0,
  3241. name: _tr("B"),
  3242. type: "VALUE",
  3243. color: 0xffa1a1a1,
  3244. default_value: f32_array_create_x(0.0),
  3245. min: 0.0,
  3246. max: 1.0,
  3247. precision: 100,
  3248. display: 0
  3249. }
  3250. ],
  3251. outputs: [
  3252. {
  3253. id: 0,
  3254. node_id: 0,
  3255. name: _tr("Color"),
  3256. type: "RGBA",
  3257. color: 0xffc7c729,
  3258. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  3259. min: 0.0,
  3260. max: 1.0,
  3261. precision: 100,
  3262. display: 0
  3263. }
  3264. ],
  3265. buttons: [],
  3266. width: 0
  3267. },
  3268. {
  3269. id: 0,
  3270. name: _tr("Combine XYZ"),
  3271. type: "COMBXYZ",
  3272. x: 0,
  3273. y: 0,
  3274. color: 0xff62676d,
  3275. inputs: [
  3276. {
  3277. id: 0,
  3278. node_id: 0,
  3279. name: _tr("X"),
  3280. type: "VALUE",
  3281. color: 0xffa1a1a1,
  3282. default_value: f32_array_create_x(0.0),
  3283. min: 0.0,
  3284. max: 1.0,
  3285. precision: 100,
  3286. display: 0
  3287. },
  3288. {
  3289. id: 0,
  3290. node_id: 0,
  3291. name: _tr("Y"),
  3292. type: "VALUE",
  3293. color: 0xffa1a1a1,
  3294. default_value: f32_array_create_x(0.0),
  3295. min: 0.0,
  3296. max: 1.0,
  3297. precision: 100,
  3298. display: 0
  3299. },
  3300. {
  3301. id: 0,
  3302. node_id: 0,
  3303. name: _tr("Z"),
  3304. type: "VALUE",
  3305. color: 0xffa1a1a1,
  3306. default_value: f32_array_create_x(0.0),
  3307. min: 0.0,
  3308. max: 1.0,
  3309. precision: 100,
  3310. display: 0
  3311. }
  3312. ],
  3313. outputs: [
  3314. {
  3315. id: 0,
  3316. node_id: 0,
  3317. name: _tr("Vector"),
  3318. type: "VECTOR",
  3319. color: 0xff6363c7,
  3320. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  3321. min: 0.0,
  3322. max: 1.0,
  3323. precision: 100,
  3324. display: 0
  3325. }
  3326. ],
  3327. buttons: [],
  3328. width: 0
  3329. },
  3330. {
  3331. id: 0,
  3332. name: _tr("Map Range"),
  3333. type: "MAPRANGE",
  3334. x: 0,
  3335. y: 0,
  3336. color: 0xff62676d,
  3337. inputs: [
  3338. {
  3339. id: 0,
  3340. node_id: 0,
  3341. name: _tr("Value"),
  3342. type: "VALUE",
  3343. color: 0xffa1a1a1,
  3344. default_value: f32_array_create_x(0.5),
  3345. min: 0.0,
  3346. max: 1.0,
  3347. precision: 100,
  3348. display: 0
  3349. },
  3350. {
  3351. id: 0,
  3352. node_id: 0,
  3353. name: _tr("From Min"),
  3354. type: "VALUE",
  3355. color: 0xffa1a1a1,
  3356. default_value: f32_array_create_x(0.0),
  3357. min: 0.0,
  3358. max: 1.0,
  3359. precision: 100,
  3360. display: 0
  3361. },
  3362. {
  3363. id: 0,
  3364. node_id: 0,
  3365. name: _tr("From Max"),
  3366. type: "VALUE",
  3367. color: 0xffa1a1a1,
  3368. default_value: f32_array_create_x(1.0),
  3369. min: 0.0,
  3370. max: 1.0,
  3371. precision: 100,
  3372. display: 0
  3373. },
  3374. {
  3375. id: 0,
  3376. node_id: 0,
  3377. name: _tr("To Min"),
  3378. type: "VALUE",
  3379. color: 0xffa1a1a1,
  3380. default_value: f32_array_create_x(0.0),
  3381. min: 0.0,
  3382. max: 1.0,
  3383. precision: 100,
  3384. display: 0
  3385. },
  3386. {
  3387. id: 0,
  3388. node_id: 0,
  3389. name: _tr("To Max"),
  3390. type: "VALUE",
  3391. color: 0xffa1a1a1,
  3392. default_value: f32_array_create_x(1.0),
  3393. min: 0.0,
  3394. max: 1.0,
  3395. precision: 100,
  3396. display: 0
  3397. }
  3398. ],
  3399. outputs: [
  3400. {
  3401. id: 0,
  3402. node_id: 0,
  3403. name: _tr("Value"),
  3404. type: "VALUE",
  3405. color: 0xffa1a1a1,
  3406. default_value: f32_array_create_x(0.0),
  3407. min: 0.0,
  3408. max: 1.0,
  3409. precision: 100,
  3410. display: 0
  3411. }
  3412. ],
  3413. buttons: [
  3414. {
  3415. name: _tr("use_clamp"),
  3416. type: "BOOL",
  3417. output: 0,
  3418. default_value: f32_array_create_x(0),
  3419. data: null,
  3420. min: 0.0,
  3421. max: 1.0,
  3422. precision: 100,
  3423. height: 0
  3424. }
  3425. ],
  3426. width: 0
  3427. },
  3428. {
  3429. id: 0,
  3430. name: _tr("Math"),
  3431. type: "MATH",
  3432. x: 0,
  3433. y: 0,
  3434. color: 0xff62676d,
  3435. inputs: [
  3436. {
  3437. id: 0,
  3438. node_id: 0,
  3439. name: _tr("Value"),
  3440. type: "VALUE",
  3441. color: 0xffa1a1a1,
  3442. default_value: f32_array_create_x(0.5),
  3443. min: 0.0,
  3444. max: 1.0,
  3445. precision: 100,
  3446. display: 0
  3447. },
  3448. {
  3449. id: 0,
  3450. node_id: 0,
  3451. name: _tr("Value"),
  3452. type: "VALUE",
  3453. color: 0xffa1a1a1,
  3454. default_value: f32_array_create_x(0.5),
  3455. min: 0.0,
  3456. max: 1.0,
  3457. precision: 100,
  3458. display: 0
  3459. }
  3460. ],
  3461. outputs: [
  3462. {
  3463. id: 0,
  3464. node_id: 0,
  3465. name: _tr("Value"),
  3466. type: "VALUE",
  3467. color: 0xffa1a1a1,
  3468. default_value: f32_array_create_x(0.0),
  3469. min: 0.0,
  3470. max: 1.0,
  3471. precision: 100,
  3472. display: 0
  3473. }
  3474. ],
  3475. buttons: [
  3476. {
  3477. name: _tr("operation"),
  3478. type: "ENUM",
  3479. output: 0,
  3480. default_value: f32_array_create_x(0),
  3481. data: u8_array_create_from_string(_tr("Add") + "\0" + _tr("Subtract") + "\0" + _tr("Multiply") + "\0" + _tr("Divide") + "\0" + _tr("Power") + "\0" + _tr("Logarithm") + "\0" + _tr("Square Root") + "\0" + _tr("Inverse Square Root") + "\0" + _tr("Absolute") + "\0" + _tr("Exponent") + "\0" + _tr("Minimum") + "\0" + _tr("Maximum") + "\0" + _tr("Less Than") + "\0" + _tr("Greater Than") + "\0" + _tr("Sign") + "\0" + _tr("Round") + "\0" + _tr("Floor") + "\0" + _tr("Ceil") + "\0" + _tr("Truncate") + "\0" + _tr("Fraction") + "\0" + _tr("Modulo") + "\0" + _tr("Snap") + "\0" + _tr("Ping-Pong") + "\0" + _tr("Sine") + "\0" + _tr("Cosine") + "\0" + _tr("Tangent") + "\0" + _tr("Arcsine") + "\0" + _tr("Arccosine") + "\0" + _tr("Arctangent") + "\0" + _tr("Arctan2") + "\0" + _tr("Hyperbolic Sine") + "\0" + _tr("Hyperbolic Cosine") + "\0" + _tr("Hyperbolic Tangent") + "\0" + _tr("To Radians") + "\0" + _tr("To Degrees")),
  3482. min: 0.0,
  3483. max: 1.0,
  3484. precision: 100,
  3485. height: 0
  3486. },
  3487. {
  3488. name: _tr("use_clamp"),
  3489. type: "BOOL",
  3490. output: 0,
  3491. default_value: f32_array_create_x(0),
  3492. data: null,
  3493. min: 0.0,
  3494. max: 1.0,
  3495. precision: 100,
  3496. height: 0
  3497. }
  3498. ],
  3499. width: 0
  3500. },
  3501. {
  3502. id: 0,
  3503. name: _tr("RGB to BW"),
  3504. type: "RGBTOBW",
  3505. x: 0,
  3506. y: 0,
  3507. color: 0xff62676d,
  3508. inputs: [
  3509. {
  3510. id: 0,
  3511. node_id: 0,
  3512. name: _tr("Color"),
  3513. type: "RGBA",
  3514. color: 0xffc7c729,
  3515. default_value: f32_array_create_xyzw(0.0, 0.0, 0.0, 0.0),
  3516. min: 0.0,
  3517. max: 1.0,
  3518. precision: 100,
  3519. display: 0
  3520. }
  3521. ],
  3522. outputs: [
  3523. {
  3524. id: 0,
  3525. node_id: 0,
  3526. name: _tr("Val"),
  3527. type: "VALUE",
  3528. color: 0xffa1a1a1,
  3529. default_value: f32_array_create_x(0.0),
  3530. min: 0.0,
  3531. max: 1.0,
  3532. precision: 100,
  3533. display: 0
  3534. }
  3535. ],
  3536. buttons: [],
  3537. width: 0
  3538. },
  3539. {
  3540. id: 0,
  3541. name: _tr("Separate HSV"),
  3542. type: "SEPHSV",
  3543. x: 0,
  3544. y: 0,
  3545. color: 0xff62676d,
  3546. inputs: [
  3547. {
  3548. id: 0,
  3549. node_id: 0,
  3550. name: _tr("Color"),
  3551. type: "RGBA",
  3552. color: 0xffc7c729,
  3553. default_value: f32_array_create_xyzw(0.5, 0.5, 0.5, 1.0),
  3554. min: 0.0,
  3555. max: 1.0,
  3556. precision: 100,
  3557. display: 0
  3558. }
  3559. ],
  3560. outputs: [
  3561. {
  3562. id: 0,
  3563. node_id: 0,
  3564. name: _tr("H"),
  3565. type: "VALUE",
  3566. color: 0xffa1a1a1,
  3567. default_value: f32_array_create_x(0.0),
  3568. min: 0.0,
  3569. max: 1.0,
  3570. precision: 100,
  3571. display: 0
  3572. },
  3573. {
  3574. id: 0,
  3575. node_id: 0,
  3576. name: _tr("S"),
  3577. type: "VALUE",
  3578. color: 0xffa1a1a1,
  3579. default_value: f32_array_create_x(0.0),
  3580. min: 0.0,
  3581. max: 1.0,
  3582. precision: 100,
  3583. display: 0
  3584. },
  3585. {
  3586. id: 0,
  3587. node_id: 0,
  3588. name: _tr("V"),
  3589. type: "VALUE",
  3590. color: 0xffa1a1a1,
  3591. default_value: f32_array_create_x(0.0),
  3592. min: 0.0,
  3593. max: 1.0,
  3594. precision: 100,
  3595. display: 0
  3596. }
  3597. ],
  3598. buttons: [],
  3599. width: 0
  3600. },
  3601. {
  3602. id: 0,
  3603. name: _tr("Separate RGB"),
  3604. type: "SEPRGB",
  3605. x: 0,
  3606. y: 0,
  3607. color: 0xff62676d,
  3608. inputs: [
  3609. {
  3610. id: 0,
  3611. node_id: 0,
  3612. name: _tr("Color"),
  3613. type: "RGBA",
  3614. color: 0xffc7c729,
  3615. default_value: f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0),
  3616. min: 0.0,
  3617. max: 1.0,
  3618. precision: 100,
  3619. display: 0
  3620. }
  3621. ],
  3622. outputs: [
  3623. {
  3624. id: 0,
  3625. node_id: 0,
  3626. name: _tr("R"),
  3627. type: "VALUE",
  3628. color: 0xffa1a1a1,
  3629. default_value: f32_array_create_x(0.0),
  3630. min: 0.0,
  3631. max: 1.0,
  3632. precision: 100,
  3633. display: 0
  3634. },
  3635. {
  3636. id: 0,
  3637. node_id: 0,
  3638. name: _tr("G"),
  3639. type: "VALUE",
  3640. color: 0xffa1a1a1,
  3641. default_value: f32_array_create_x(0.0),
  3642. min: 0.0,
  3643. max: 1.0,
  3644. precision: 100,
  3645. display: 0
  3646. },
  3647. {
  3648. id: 0,
  3649. node_id: 0,
  3650. name: _tr("B"),
  3651. type: "VALUE",
  3652. color: 0xffa1a1a1,
  3653. default_value: f32_array_create_x(0.0),
  3654. min: 0.0,
  3655. max: 1.0,
  3656. precision: 100,
  3657. display: 0
  3658. }
  3659. ],
  3660. buttons: [],
  3661. width: 0
  3662. },
  3663. {
  3664. id: 0,
  3665. name: _tr("Separate XYZ"),
  3666. type: "SEPXYZ",
  3667. x: 0,
  3668. y: 0,
  3669. color: 0xff62676d,
  3670. inputs: [
  3671. {
  3672. id: 0,
  3673. node_id: 0,
  3674. name: _tr("Vector"),
  3675. type: "VECTOR",
  3676. color: 0xff6363c7,
  3677. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  3678. min: 0.0,
  3679. max: 1.0,
  3680. precision: 100,
  3681. display: 0
  3682. }
  3683. ],
  3684. outputs: [
  3685. {
  3686. id: 0,
  3687. node_id: 0,
  3688. name: _tr("X"),
  3689. type: "VALUE",
  3690. color: 0xffa1a1a1,
  3691. default_value: f32_array_create_x(0.0),
  3692. min: 0.0,
  3693. max: 1.0,
  3694. precision: 100,
  3695. display: 0
  3696. },
  3697. {
  3698. id: 0,
  3699. node_id: 0,
  3700. name: _tr("Y"),
  3701. type: "VALUE",
  3702. color: 0xffa1a1a1,
  3703. default_value: f32_array_create_x(0.0),
  3704. min: 0.0,
  3705. max: 1.0,
  3706. precision: 100,
  3707. display: 0
  3708. },
  3709. {
  3710. id: 0,
  3711. node_id: 0,
  3712. name: _tr("Z"),
  3713. type: "VALUE",
  3714. color: 0xffa1a1a1,
  3715. default_value: f32_array_create_x(0.0),
  3716. min: 0.0,
  3717. max: 1.0,
  3718. precision: 100,
  3719. display: 0
  3720. }
  3721. ],
  3722. buttons: [],
  3723. width: 0
  3724. },
  3725. {
  3726. id: 0,
  3727. name: _tr("Vector Math"),
  3728. type: "VECT_MATH",
  3729. x: 0,
  3730. y: 0,
  3731. color: 0xff62676d,
  3732. inputs: [
  3733. {
  3734. id: 0,
  3735. node_id: 0,
  3736. name: _tr("Vector"),
  3737. type: "VECTOR",
  3738. color: 0xff6363c7,
  3739. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  3740. min: 0.0,
  3741. max: 1.0,
  3742. precision: 100,
  3743. display: 0
  3744. },
  3745. {
  3746. id: 0,
  3747. node_id: 0,
  3748. name: _tr("Vector"),
  3749. type: "VECTOR",
  3750. color: 0xff6363c7,
  3751. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  3752. min: 0.0,
  3753. max: 1.0,
  3754. precision: 100,
  3755. display: 0
  3756. }
  3757. ],
  3758. outputs: [
  3759. {
  3760. id: 0,
  3761. node_id: 0,
  3762. name: _tr("Vector"),
  3763. type: "VECTOR",
  3764. color: 0xff6363c7,
  3765. default_value: f32_array_create_xyz(0.0, 0.0, 0.0),
  3766. min: 0.0,
  3767. max: 1.0,
  3768. precision: 100,
  3769. display: 0
  3770. },
  3771. {
  3772. id: 0,
  3773. node_id: 0,
  3774. name: _tr("Value"),
  3775. type: "VALUE",
  3776. color: 0xffa1a1a1,
  3777. default_value: f32_array_create_x(0.0),
  3778. min: 0.0,
  3779. max: 1.0,
  3780. precision: 100,
  3781. display: 0
  3782. }
  3783. ],
  3784. buttons: [
  3785. {
  3786. name: _tr("operation"),
  3787. type: "ENUM",
  3788. output: 0,
  3789. default_value: f32_array_create_x(0),
  3790. data: u8_array_create_from_string(_tr("Add") + "\0" + _tr("Subtract") + "\0" + _tr("Multiply") + "\0" + _tr("Divide") + "\0" + _tr("Average") + "\0" + _tr("Cross Product") + "\0" + _tr("Project") + "\0" + _tr("Reflect") + "\0" + _tr("Dot Product") + "\0" + _tr("Distance") + "\0" + _tr("Length") + "\0" + _tr("Scale") + "\0" + _tr("Normalize") + "\0" + _tr("Absolute") + "\0" + _tr("Minimum") + "\0" + _tr("Maximum") + "\0" + _tr("Floor") + "\0" + _tr("Ceil") + "\0" + _tr("Fraction") + "\0" + _tr("Modulo") + "\0" + _tr("Snap") + "\0" + _tr("Sine") + "\0" + _tr("Cosine") + "\0" + _tr("Tangent")),
  3791. min: 0.0,
  3792. max: 1.0,
  3793. precision: 100,
  3794. height: 0
  3795. }
  3796. ],
  3797. width: 0
  3798. }
  3799. ];
  3800. let nodes_material_group: zui_node_t[] = [
  3801. {
  3802. id: 0,
  3803. name: _tr("New Group"),
  3804. type: "GROUP",
  3805. x: 0,
  3806. y: 0,
  3807. color: 0xffb34f5a,
  3808. inputs: [],
  3809. outputs: [],
  3810. buttons: [
  3811. {
  3812. name: "nodes_material_new_group_button",
  3813. type: "CUSTOM",
  3814. output: -1,
  3815. default_value: f32_array_create_x(0),
  3816. data: null,
  3817. min: 0.0,
  3818. max: 1.0,
  3819. precision: 100,
  3820. height: 1
  3821. }
  3822. ],
  3823. width: 0
  3824. }
  3825. ];
  3826. type node_list_t = zui_node_t[];
  3827. let nodes_material_list: node_list_t[] = [
  3828. nodes_material_input,
  3829. nodes_material_texture,
  3830. nodes_material_color,
  3831. nodes_material_vector,
  3832. nodes_material_converter,
  3833. nodes_material_group
  3834. ];
  3835. function nodes_material_vector_curves_button(ui: zui_t, nodes: zui_nodes_t, node: zui_node_t) {
  3836. let but: zui_node_button_t = node.buttons[0];
  3837. let nhandle: zui_handle_t = zui_nest(zui_handle(__ID__), node.id);
  3838. let row: f32[] = [1 / 3, 1 / 3, 1 / 3];
  3839. zui_row(row);
  3840. zui_radio(zui_nest(zui_nest(nhandle, 0), 1), 0, "X");
  3841. zui_radio(zui_nest(zui_nest(nhandle, 0), 1), 1, "Y");
  3842. zui_radio(zui_nest(zui_nest(nhandle, 0), 1), 2, "Z");
  3843. // Preview
  3844. let axis: i32 = zui_nest(zui_nest(nhandle, 0), 1).position;
  3845. let val: f32_array_t[] = null; // but.default_value[axis]; // [ [[x, y], [x, y], ..], [[x, y]], ..]
  3846. let num: i32 = val.length;
  3847. // for (let i: i32 = 0; i < num; ++i) { ui.line(); }
  3848. ui._y += zui_nodes_LINE_H() * 5;
  3849. // Edit
  3850. row = [1 / 5, 1 / 5, 3 / 5];
  3851. zui_row(row);
  3852. if (zui_button("+")) {
  3853. let f32a: f32_array_t = f32_array_create(2);
  3854. f32a[0] = 0; f32a[1] = 0;
  3855. array_push(val, f32a);
  3856. }
  3857. if (zui_button("-")) {
  3858. if (val.length > 2) {
  3859. val.pop();
  3860. }
  3861. }
  3862. let ihandle: zui_handle_t = zui_nest(zui_nest(zui_nest(nhandle, 0), 2), axis);
  3863. if (ihandle.init) {
  3864. ihandle.position = 0;
  3865. }
  3866. let i: i32 = math_floor(zui_slider(ihandle, "Index", 0, num - 1, false, 1, true, zui_align_t.LEFT));
  3867. if (i >= val.length || i < 0) {
  3868. ihandle.value = i = val.length - 1; // Stay in bounds
  3869. }
  3870. row = [1 / 2, 1 / 2];
  3871. zui_row(row);
  3872. zui_nest(zui_nest(nhandle, 0), 3).value = val[i][0];
  3873. zui_nest(zui_nest(nhandle, 0), 4).value = val[i][1];
  3874. let h1: zui_handle_t = zui_nest(zui_nest(nhandle, 0), 3);
  3875. if (h1.init) {
  3876. h1.value = 0.0;
  3877. }
  3878. let h2: zui_handle_t = zui_nest(zui_nest(nhandle, 0), 4);
  3879. if (h2.init) {
  3880. h2.value = 0.0;
  3881. }
  3882. val[i][0] = zui_slider(h1, "X", -1, 1, true, 100, true, zui_align_t.LEFT);
  3883. val[i][1] = zui_slider(h2, "Y", -1, 1, true, 100, true, zui_align_t.LEFT);
  3884. }
  3885. function nodes_material_color_ramp_button(ui: zui_t, nodes: zui_nodes_t, node: zui_node_t) {
  3886. let but: zui_node_button_t = node.buttons[0];
  3887. let nhandle: zui_handle_t = zui_nest(zui_handle(__ID__), node.id);
  3888. let nx: f32 = ui._x;
  3889. let ny: f32 = ui._y;
  3890. // Preview
  3891. let vals: f32_array_t[] = null; // but.default_value; // [[r, g, b, a, pos], ..]
  3892. let sw: f32 = ui._w / zui_nodes_SCALE();
  3893. for (let i: i32 = 0; i < vals.length; ++i) {
  3894. let val: f32_array_t = vals[i];
  3895. let pos: f32 = val[4];
  3896. let col: i32 = color_from_floats(val[0], val[1], val[2], 1.0);
  3897. zui_fill(pos * sw, 0, (1.0 - pos) * sw, zui_nodes_LINE_H() - 2 * zui_nodes_SCALE(), col);
  3898. }
  3899. ui._y += zui_nodes_LINE_H();
  3900. // Edit
  3901. let ihandle: zui_handle_t = zui_nest(zui_nest(nhandle, 0), 2);
  3902. let row: f32[] = [1 / 4, 1 / 4, 2 / 4];
  3903. zui_row(row);
  3904. if (zui_button("+")) {
  3905. let last: f32_array_t = vals[vals.length - 1];
  3906. let f32a: f32_array_t = f32_array_create(5);
  3907. f32a[0] = last[0];
  3908. f32a[1] = last[1];
  3909. f32a[2] = last[2];
  3910. f32a[3] = last[3];
  3911. f32a[4] = 1.0;
  3912. array_push(vals, f32a);
  3913. ihandle.value += 1;
  3914. }
  3915. if (zui_button("-") && vals.length > 1) {
  3916. vals.pop();
  3917. ihandle.value -= 1;
  3918. }
  3919. // but.data = zui_combo(zui_nest(zui_nest(nhandle, 0), 1, { position: but.data }), [tr("Linear"), tr("Constant")], tr("Interpolate"));
  3920. row = [1 / 2, 1 / 2];
  3921. zui_row(row);
  3922. let i: i32 = math_floor(zui_slider(ihandle, "Index", 0, vals.length - 1, false, 1, true, zui_align_t.LEFT));
  3923. if (i >= vals.length || i < 0) {
  3924. ihandle.value = i = vals.length - 1; // Stay in bounds
  3925. }
  3926. let val: f32_array_t = vals[i];
  3927. zui_nest(zui_nest(nhandle, 0), 3).value = val[4];
  3928. val[4] = zui_slider(zui_nest(zui_nest(nhandle, 0), 3), "Pos", 0, 1, true, 100, true, zui_align_t.LEFT);
  3929. if (val[4] > 1.0) {
  3930. val[4] = 1.0; // Stay in bounds
  3931. }
  3932. else if (val[4] < 0.0) {
  3933. val[4] = 0.0;
  3934. }
  3935. let chandle: zui_handle_t = zui_nest(zui_nest(nhandle, 0), 4);
  3936. chandle.color = color_from_floats(val[0], val[1], val[2], 1.0);
  3937. if (zui_text("", zui_align_t.RIGHT, chandle.color) == zui_state_t.STARTED) {
  3938. let rx: f32 = nx + ui._w - zui_nodes_p(37);
  3939. let ry: f32 = ny - zui_nodes_p(5);
  3940. nodes._input_started = ui.input_started = false;
  3941. zui_nodes_rgba_popup(ui, chandle, val, math_floor(rx), math_floor(ry + zui_ELEMENT_H(ui)));
  3942. }
  3943. val[0] = color_get_rb(chandle.color) / 255;
  3944. val[1] = color_get_gb(chandle.color) / 255;
  3945. val[2] = color_get_bb(chandle.color) / 255;
  3946. }
  3947. function nodes_material_new_group_button(ui: zui_t, nodes: zui_nodes_t, node: zui_node_t) {
  3948. if (node.name == "New Group") {
  3949. for (let i: i32 = 1; i < 999; ++i) {
  3950. node.name = tr("Group") + " " + i;
  3951. let found: bool = false;
  3952. for (let i: i32 = 0; i < project_material_groups.length; ++i) {
  3953. let g: node_group_t = project_material_groups[i];
  3954. if (g.canvas.name == node.name) {
  3955. found = true;
  3956. break;
  3957. }
  3958. }
  3959. if (!found) {
  3960. break;
  3961. }
  3962. }
  3963. array_push(zui_node_replace, node);
  3964. let canvas: zui_node_canvas_t = {
  3965. name: node.name,
  3966. nodes: [
  3967. {
  3968. id: 0,
  3969. name: _tr("Group Input"),
  3970. type: "GROUP_INPUT",
  3971. x: 50,
  3972. y: 200,
  3973. color: 0xff448c6d,
  3974. inputs: [],
  3975. outputs: [],
  3976. buttons: [
  3977. {
  3978. name: "nodes_material_group_input_button",
  3979. type: "CUSTOM",
  3980. height: 1
  3981. }
  3982. ]
  3983. },
  3984. {
  3985. id: 1,
  3986. name: _tr("Group Output"),
  3987. type: "GROUP_OUTPUT",
  3988. x: 450,
  3989. y: 200,
  3990. color: 0xff448c6d,
  3991. inputs: [],
  3992. outputs: [],
  3993. buttons: [
  3994. {
  3995. name: "nodes_material_group_output_button",
  3996. type: "CUSTOM",
  3997. height: 1
  3998. }
  3999. ]
  4000. }
  4001. ],
  4002. links: []
  4003. };
  4004. array_push(project_material_groups, { canvas: canvas, nodes: zui_nodes_create() });
  4005. }
  4006. let group: node_group_t = null;
  4007. for (let i: i32 = 0; i < project_material_groups.length; ++i) {
  4008. let g: node_group_t = project_material_groups[i];
  4009. if (g.canvas.name == node.name) {
  4010. group = g;
  4011. break;
  4012. }
  4013. }
  4014. if (zui_button(tr("Nodes"))) {
  4015. array_push(ui_nodes_group_stack, group);
  4016. }
  4017. }
  4018. function nodes_material_group_input_button(ui: zui_t, nodes: zui_nodes_t, node: zui_node_t) {
  4019. nodes_material_add_socket_button(ui, nodes, node, node.outputs);
  4020. }
  4021. function nodes_material_group_output_button(ui: zui_t, nodes: zui_nodes_t, node: zui_node_t) {
  4022. nodes_material_add_socket_button(ui, nodes, node, node.inputs);
  4023. }
  4024. let _nodes_material_nodes: zui_nodes_t;
  4025. let _nodes_material_node: zui_node_t;
  4026. let _nodes_material_sockets: zui_node_socket_t[];
  4027. function nodes_material_add_socket_button(ui: zui_t, nodes: zui_nodes_t, node: zui_node_t, sockets: zui_node_socket_t[]) {
  4028. if (zui_button(tr("Add"))) {
  4029. _nodes_material_nodes = nodes;
  4030. _nodes_material_node = node;
  4031. _nodes_material_sockets = sockets;
  4032. ui_menu_draw(function (ui: zui_t) {
  4033. let nodes: zui_nodes_t = _nodes_material_nodes;
  4034. let node: zui_node_t = _nodes_material_node;
  4035. let sockets: zui_node_socket_t[] = _nodes_material_sockets;
  4036. let group_stack: node_group_t[] = ui_nodes_group_stack;
  4037. let c: zui_node_canvas_t = group_stack[group_stack.length - 1].canvas;
  4038. if (ui_menu_button(ui, tr("RGBA"))) {
  4039. array_push(sockets, nodes_material_create_socket(nodes, node, null, "RGBA", c));
  4040. nodes_material_sync_sockets(node);
  4041. }
  4042. if (ui_menu_button(ui, tr("Vector"))) {
  4043. array_push(sockets, nodes_material_create_socket(nodes, node, null, "VECTOR", c));
  4044. nodes_material_sync_sockets(node);
  4045. }
  4046. if (ui_menu_button(ui, tr("Value"))) {
  4047. array_push(sockets, nodes_material_create_socket(nodes, node, null, "VALUE", c));
  4048. nodes_material_sync_sockets(node);
  4049. }
  4050. }, 3);
  4051. }
  4052. }
  4053. function nodes_material_sync_sockets(node: zui_node_t) {
  4054. let group_stack: node_group_t[] = ui_nodes_group_stack;
  4055. let c: zui_node_canvas_t = group_stack[group_stack.length - 1].canvas;
  4056. for (let i: i32 = 0; i < project_materials.length; ++i) {
  4057. let m: slot_material_t = project_materials[i];
  4058. nodes_material_sync_group_sockets(m.canvas, c.name, node);
  4059. }
  4060. for (let i: i32 = 0; i < project_material_groups.length; ++i) {
  4061. let g: node_group_t = project_material_groups[i];
  4062. nodes_material_sync_group_sockets(g.canvas, c.name, node);
  4063. }
  4064. array_push(zui_node_replace, node);
  4065. }
  4066. function nodes_material_sync_group_sockets(canvas: zui_node_canvas_t, group_name: string, node: zui_node_t) {
  4067. for (let i: i32 = 0; i < canvas.nodes.length; ++i) {
  4068. let n: zui_node_t = canvas.nodes[i];
  4069. if (n.type == "GROUP" && n.name == group_name) {
  4070. let is_inputs: bool = node.name == "Group Input";
  4071. let old_sockets: zui_node_socket_t[] = is_inputs ? n.inputs : n.outputs;
  4072. let sockets: zui_node_socket_t[] = json_parse(json_stringify(is_inputs ? node.outputs : node.inputs));
  4073. is_inputs ? n.inputs = sockets : n.outputs = sockets;
  4074. for (let i: i32 = 0; i < sockets.length; ++i) {
  4075. let s: zui_node_socket_t = sockets[i];
  4076. s.node_id = n.id;
  4077. }
  4078. let num_sockets: i32 = sockets.length < old_sockets.length ? sockets.length : old_sockets.length;
  4079. for (let i: i32 = 0; i < num_sockets; ++i) {
  4080. if (sockets[i].type == old_sockets[i].type) {
  4081. sockets[i].default_value = old_sockets[i].default_value;
  4082. }
  4083. }
  4084. }
  4085. }
  4086. }
  4087. function nodes_material_get_socket_color(type: string): i32 {
  4088. return type == "RGBA" ? 0xffc7c729 : type == "VECTOR" ? 0xff6363c7 : 0xffa1a1a1;
  4089. }
  4090. function nodes_material_get_socket_default_value(type: string): any {
  4091. return type == "RGBA" ? f32_array_create_xyzw(0.8, 0.8, 0.8, 1.0) : type == "VECTOR" ? f32_array_create_xyz(0.0, 0.0, 0.0) : 0.0;
  4092. }
  4093. function nodes_material_get_socket_name(type: string): string {
  4094. return type == "RGBA" ? _tr("Color") : type == "VECTOR" ? _tr("Vector") : _tr("Value");
  4095. }
  4096. function nodes_material_create_socket(nodes: zui_nodes_t, node: zui_node_t, name: string, type: string, canvas: zui_node_canvas_t, min = 0.0, max = 1.0, default_value: any = null): zui_node_socket_t {
  4097. return {
  4098. id: zui_get_socket_id(canvas.nodes),
  4099. node_id: node.id,
  4100. name: name == null ? nodes_material_get_socket_name(type) : name,
  4101. type: type,
  4102. color: nodes_material_get_socket_color(type),
  4103. default_value: default_value == null ? nodes_material_get_socket_default_value(type) : default_value,
  4104. min: min,
  4105. max: max
  4106. }
  4107. }
  4108. function nodes_material_get_node_t(node_type: string): zui_node_t {
  4109. for (let i: i32 = 0; i < nodes_material_list.length; ++i) {
  4110. let c: zui_node_t[] = nodes_material_list[i];
  4111. for (let i: i32 = 0; i < c.length; ++i) {
  4112. let n: zui_node_t = c[i];
  4113. if (n.type == node_type) {
  4114. return n;
  4115. }
  4116. }
  4117. }
  4118. return null;
  4119. }
  4120. function nodes_material_create_node(node_type: string, group: node_group_t = null): zui_node_t {
  4121. let n: zui_node_t = nodes_material_get_node_t(node_type);
  4122. if (n == null) {
  4123. return null;
  4124. }
  4125. let canvas: zui_node_canvas_t = group != null ? group.canvas : context_raw.material.canvas;
  4126. let nodes: zui_nodes_t = group != null ? group.nodes : context_raw.material.nodes;
  4127. let node: zui_node_t = ui_nodes_make_node(n, nodes, canvas);
  4128. array_push(canvas.nodes, node);
  4129. return node;
  4130. }