@dpantani/tdmcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (765) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +413 -0
  3. package/dist/cli/agent.d.ts +466 -0
  4. package/dist/cli/agent.js +1902 -0
  5. package/dist/cli/agent.js.map +1 -0
  6. package/dist/index.d.ts +2 -0
  7. package/dist/index.js +4375 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/knowledge/data/glsl.json +1 -0
  10. package/dist/knowledge/data/meta.json +1 -0
  11. package/dist/knowledge/data/operators/ableton_link_chop.json +1322 -0
  12. package/dist/knowledge/data/operators/accumulate_pop.json +912 -0
  13. package/dist/knowledge/data/operators/actor_comp.json +7477 -0
  14. package/dist/knowledge/data/operators/add_sop.json +946 -0
  15. package/dist/knowledge/data/operators/add_top.json +1653 -0
  16. package/dist/knowledge/data/operators/alembic_sop.json +521 -0
  17. package/dist/knowledge/data/operators/align_sop.json +949 -0
  18. package/dist/knowledge/data/operators/ambient_light_comp.json +1698 -0
  19. package/dist/knowledge/data/operators/analyze_chop.json +710 -0
  20. package/dist/knowledge/data/operators/analyze_pop.json +698 -0
  21. package/dist/knowledge/data/operators/analyze_top.json +1276 -0
  22. package/dist/knowledge/data/operators/angle_chop.json +711 -0
  23. package/dist/knowledge/data/operators/animation_comp.json +2448 -0
  24. package/dist/knowledge/data/operators/annotate_comp.json +2913 -0
  25. package/dist/knowledge/data/operators/anti_alias_top.json +1278 -0
  26. package/dist/knowledge/data/operators/arm_sop.json +1747 -0
  27. package/dist/knowledge/data/operators/art-net_dat.json +472 -0
  28. package/dist/knowledge/data/operators/attribute_chop.json +617 -0
  29. package/dist/knowledge/data/operators/attribute_combine_pop.json +596 -0
  30. package/dist/knowledge/data/operators/attribute_convert_pop.json +462 -0
  31. package/dist/knowledge/data/operators/attribute_create_sop.json +191 -0
  32. package/dist/knowledge/data/operators/attribute_pop.json +1078 -0
  33. package/dist/knowledge/data/operators/attribute_sop.json +429 -0
  34. package/dist/knowledge/data/operators/audio_band_eq_chop.json +1228 -0
  35. package/dist/knowledge/data/operators/audio_binaural_chop.json +711 -0
  36. package/dist/knowledge/data/operators/audio_device_in_chop.json +1793 -0
  37. package/dist/knowledge/data/operators/audio_device_out_chop.json +1840 -0
  38. package/dist/knowledge/data/operators/audio_devices_dat.json +616 -0
  39. package/dist/knowledge/data/operators/audio_dynamics_chop.json +1132 -0
  40. package/dist/knowledge/data/operators/audio_file_in_chop.json +1605 -0
  41. package/dist/knowledge/data/operators/audio_file_out_chop.json +945 -0
  42. package/dist/knowledge/data/operators/audio_filter_chop.json +850 -0
  43. package/dist/knowledge/data/operators/audio_movie_chop.json +851 -0
  44. package/dist/knowledge/data/operators/audio_ndi_chop.json +526 -0
  45. package/dist/knowledge/data/operators/audio_oscillator_chop.json +1087 -0
  46. package/dist/knowledge/data/operators/audio_para_eq_chop.json +1276 -0
  47. package/dist/knowledge/data/operators/audio_play_chop.json +1744 -0
  48. package/dist/knowledge/data/operators/audio_render_chop.json +754 -0
  49. package/dist/knowledge/data/operators/audio_spectrum_chop.json +850 -0
  50. package/dist/knowledge/data/operators/audio_stream_in_chop.json +1039 -0
  51. package/dist/knowledge/data/operators/audio_stream_out_chop.json +806 -0
  52. package/dist/knowledge/data/operators/audio_vst_chop.json +1419 -0
  53. package/dist/knowledge/data/operators/audio_web_render_chop.json +523 -0
  54. package/dist/knowledge/data/operators/base_comp.json +1180 -0
  55. package/dist/knowledge/data/operators/basis_sop.json +805 -0
  56. package/dist/knowledge/data/operators/beat_chop.json +1745 -0
  57. package/dist/knowledge/data/operators/bind_chop.json +613 -0
  58. package/dist/knowledge/data/operators/blacktrax_chop.json +1180 -0
  59. package/dist/knowledge/data/operators/blend_chop.json +616 -0
  60. package/dist/knowledge/data/operators/blend_comp.json +3626 -0
  61. package/dist/knowledge/data/operators/blend_pop.json +618 -0
  62. package/dist/knowledge/data/operators/blend_sop.json +477 -0
  63. package/dist/knowledge/data/operators/blob_track_chop.json +1275 -0
  64. package/dist/knowledge/data/operators/blob_track_top.json +1931 -0
  65. package/dist/knowledge/data/operators/bloom_top.json +1370 -0
  66. package/dist/knowledge/data/operators/blur_top.json +1428 -0
  67. package/dist/knowledge/data/operators/body_track_chop.json +1233 -0
  68. package/dist/knowledge/data/operators/bone_comp.json +3672 -0
  69. package/dist/knowledge/data/operators/bone_group_sop.json +148 -0
  70. package/dist/knowledge/data/operators/boolean_sop.json +336 -0
  71. package/dist/knowledge/data/operators/box_pop.json +827 -0
  72. package/dist/knowledge/data/operators/box_sop.json +994 -0
  73. package/dist/knowledge/data/operators/bridge_sop.json +806 -0
  74. package/dist/knowledge/data/operators/bullet_solver_chop.json +898 -0
  75. package/dist/knowledge/data/operators/bullet_solver_comp.json +3720 -0
  76. package/dist/knowledge/data/operators/button_comp.json +6636 -0
  77. package/dist/knowledge/data/operators/cache_blend_pop.json +292 -0
  78. package/dist/knowledge/data/operators/cache_pop.json +412 -0
  79. package/dist/knowledge/data/operators/cache_select_pop.json +280 -0
  80. package/dist/knowledge/data/operators/cache_select_top.json +946 -0
  81. package/dist/knowledge/data/operators/cache_sop.json +478 -0
  82. package/dist/knowledge/data/operators/cache_top.json +1559 -0
  83. package/dist/knowledge/data/operators/camera_blend_comp.json +4847 -0
  84. package/dist/knowledge/data/operators/camera_comp.json +215 -0
  85. package/dist/knowledge/data/operators/cap_sop.json +527 -0
  86. package/dist/knowledge/data/operators/capture_region_sop.json +568 -0
  87. package/dist/knowledge/data/operators/capture_sop.json +619 -0
  88. package/dist/knowledge/data/operators/carve_sop.json +902 -0
  89. package/dist/knowledge/data/operators/channel_mix_top.json +1088 -0
  90. package/dist/knowledge/data/operators/chop_execute_dat.json +1277 -0
  91. package/dist/knowledge/data/operators/chop_to_dat.json +571 -0
  92. package/dist/knowledge/data/operators/chop_to_pop.json +1236 -0
  93. package/dist/knowledge/data/operators/chop_to_sop.json +714 -0
  94. package/dist/knowledge/data/operators/chop_to_top.json +1231 -0
  95. package/dist/knowledge/data/operators/chroma_key_top.json +1653 -0
  96. package/dist/knowledge/data/operators/circle_pop.json +821 -0
  97. package/dist/knowledge/data/operators/circle_sop.json +991 -0
  98. package/dist/knowledge/data/operators/circle_top.json +2307 -0
  99. package/dist/knowledge/data/operators/clay_sop.json +1231 -0
  100. package/dist/knowledge/data/operators/clip_blender_chop.json +1931 -0
  101. package/dist/knowledge/data/operators/clip_chop.json +1366 -0
  102. package/dist/knowledge/data/operators/clip_dat.json +849 -0
  103. package/dist/knowledge/data/operators/clip_sop.json +475 -0
  104. package/dist/knowledge/data/operators/clock_chop.json +1792 -0
  105. package/dist/knowledge/data/operators/composite_chop.json +1414 -0
  106. package/dist/knowledge/data/operators/composite_top.json +2131 -0
  107. package/dist/knowledge/data/operators/connectivity_pop.json +11 -0
  108. package/dist/knowledge/data/operators/constant_chop.json +1238 -0
  109. package/dist/knowledge/data/operators/constant_mat.json +2727 -0
  110. package/dist/knowledge/data/operators/constant_top.json +1323 -0
  111. package/dist/knowledge/data/operators/constraint_comp.json +2076 -0
  112. package/dist/knowledge/data/operators/container_comp.json +6299 -0
  113. package/dist/knowledge/data/operators/convert_dat.json +569 -0
  114. package/dist/knowledge/data/operators/convert_pop.json +322 -0
  115. package/dist/knowledge/data/operators/convert_sop.json +807 -0
  116. package/dist/knowledge/data/operators/convolve_top.json +1041 -0
  117. package/dist/knowledge/data/operators/copy_chop.json +993 -0
  118. package/dist/knowledge/data/operators/copy_pop.json +1799 -0
  119. package/dist/knowledge/data/operators/copy_sop.json +1887 -0
  120. package/dist/knowledge/data/operators/corner_pin_top.json +1512 -0
  121. package/dist/knowledge/data/operators/count_chop.json +1369 -0
  122. package/dist/knowledge/data/operators/cplusplus_chop.json +569 -0
  123. package/dist/knowledge/data/operators/cplusplus_dat.json +477 -0
  124. package/dist/knowledge/data/operators/cplusplus_pop.json +308 -0
  125. package/dist/knowledge/data/operators/cplusplus_sop.json +195 -0
  126. package/dist/knowledge/data/operators/cplusplus_top.json +1276 -0
  127. package/dist/knowledge/data/operators/creep_sop.json +385 -0
  128. package/dist/knowledge/data/operators/crop_top.json +1323 -0
  129. package/dist/knowledge/data/operators/cross_chop.json +478 -0
  130. package/dist/knowledge/data/operators/cross_top.json +1559 -0
  131. package/dist/knowledge/data/operators/cube_map_top.json +946 -0
  132. package/dist/knowledge/data/operators/curve_pop.json +1525 -0
  133. package/dist/knowledge/data/operators/curveclay_sop.json +618 -0
  134. package/dist/knowledge/data/operators/curvesect_sop.json +665 -0
  135. package/dist/knowledge/data/operators/cycle_chop.json +1040 -0
  136. package/dist/knowledge/data/operators/dat_execute_dat.json +1230 -0
  137. package/dist/knowledge/data/operators/dat_to_chop.json +1510 -0
  138. package/dist/knowledge/data/operators/dat_to_pop.json +756 -0
  139. package/dist/knowledge/data/operators/dat_to_sop.json +902 -0
  140. package/dist/knowledge/data/operators/deform_sop.json +291 -0
  141. package/dist/knowledge/data/operators/delay_chop.json +615 -0
  142. package/dist/knowledge/data/operators/delete_chop.json +1556 -0
  143. package/dist/knowledge/data/operators/delete_pop.json +1422 -0
  144. package/dist/knowledge/data/operators/delete_sop.json +1230 -0
  145. package/dist/knowledge/data/operators/depth_mat.json +1933 -0
  146. package/dist/knowledge/data/operators/depth_top.json +1322 -0
  147. package/dist/knowledge/data/operators/difference_top.json +1647 -0
  148. package/dist/knowledge/data/operators/dimension_pop.json +280 -0
  149. package/dist/knowledge/data/operators/direct_display_out_top.json +997 -0
  150. package/dist/knowledge/data/operators/directx_in_top.json +901 -0
  151. package/dist/knowledge/data/operators/directx_out_top.json +948 -0
  152. package/dist/knowledge/data/operators/displace_top.json +1322 -0
  153. package/dist/knowledge/data/operators/divide_sop.json +713 -0
  154. package/dist/knowledge/data/operators/dmx_fixture_pop.json +772 -0
  155. package/dist/knowledge/data/operators/dmx_in_chop.json +1420 -0
  156. package/dist/knowledge/data/operators/dmx_map_dat.json +11 -0
  157. package/dist/knowledge/data/operators/dmx_out_chop.json +1843 -0
  158. package/dist/knowledge/data/operators/dmx_out_pop.json +668 -0
  159. package/dist/knowledge/data/operators/edge_top.json +1370 -0
  160. package/dist/knowledge/data/operators/emboss_top.json +1275 -0
  161. package/dist/knowledge/data/operators/engine_comp.json +2685 -0
  162. package/dist/knowledge/data/operators/envelope_chop.json +946 -0
  163. package/dist/knowledge/data/operators/environment_light_comp.json +2121 -0
  164. package/dist/knowledge/data/operators/error_dat.json +949 -0
  165. package/dist/knowledge/data/operators/etherdream_dat.json +472 -0
  166. package/dist/knowledge/data/operators/evaluate_dat.json +1650 -0
  167. package/dist/knowledge/data/operators/event_chop.json +1653 -0
  168. package/dist/knowledge/data/operators/examine_dat.json +1182 -0
  169. package/dist/knowledge/data/operators/execute_dat.json +1184 -0
  170. package/dist/knowledge/data/operators/experimental +0 -0
  171. package/dist/knowledge/data/operators/expression_chop.json +617 -0
  172. package/dist/knowledge/data/operators/extend_chop.json +617 -0
  173. package/dist/knowledge/data/operators/extrude_pop.json +316 -0
  174. package/dist/knowledge/data/operators/extrude_sop.json +1081 -0
  175. package/dist/knowledge/data/operators/face_track_chop.json +998 -0
  176. package/dist/knowledge/data/operators/face_track_sop.json +244 -0
  177. package/dist/knowledge/data/operators/facet_pop.json +480 -0
  178. package/dist/knowledge/data/operators/facet_sop.json +619 -0
  179. package/dist/knowledge/data/operators/fan_chop.json +804 -0
  180. package/dist/knowledge/data/operators/fbx_comp.json +4942 -0
  181. package/dist/knowledge/data/operators/feedback_chop.json +664 -0
  182. package/dist/knowledge/data/operators/feedback_pop.json +368 -0
  183. package/dist/knowledge/data/operators/feedback_top.json +191 -0
  184. package/dist/knowledge/data/operators/field_pop.json +2304 -0
  185. package/dist/knowledge/data/operators/fifo_dat.json +711 -0
  186. package/dist/knowledge/data/operators/file_in_chop.json +1181 -0
  187. package/dist/knowledge/data/operators/file_in_dat.json +527 -0
  188. package/dist/knowledge/data/operators/file_in_pop.json +298 -0
  189. package/dist/knowledge/data/operators/file_in_sop.json +289 -0
  190. package/dist/knowledge/data/operators/file_out_chop.json +618 -0
  191. package/dist/knowledge/data/operators/file_out_dat.json +524 -0
  192. package/dist/knowledge/data/operators/fillet_sop.json +949 -0
  193. package/dist/knowledge/data/operators/filter_chop.json +1134 -0
  194. package/dist/knowledge/data/operators/fit_sop.json +1087 -0
  195. package/dist/knowledge/data/operators/fit_top.json +1559 -0
  196. package/dist/knowledge/data/operators/flip_top.json +1040 -0
  197. package/dist/knowledge/data/operators/folder_dat.json +1888 -0
  198. package/dist/knowledge/data/operators/force_comp.json +1701 -0
  199. package/dist/knowledge/data/operators/force_pop.json +878 -0
  200. package/dist/knowledge/data/operators/force_sop.json +429 -0
  201. package/dist/knowledge/data/operators/fractal_sop.json +479 -0
  202. package/dist/knowledge/data/operators/freed_in_chop.json +808 -0
  203. package/dist/knowledge/data/operators/freed_out_chop.json +714 -0
  204. package/dist/knowledge/data/operators/function_chop.json +1086 -0
  205. package/dist/knowledge/data/operators/function_top.json +1558 -0
  206. package/dist/knowledge/data/operators/geo_text_comp.json +7338 -0
  207. package/dist/knowledge/data/operators/geometry_comp.json +199 -0
  208. package/dist/knowledge/data/operators/gesture_chop.json +1133 -0
  209. package/dist/knowledge/data/operators/glsl_advanced_pop.json +3539 -0
  210. package/dist/knowledge/data/operators/glsl_comp.json +6962 -0
  211. package/dist/knowledge/data/operators/glsl_copy_pop.json +2128 -0
  212. package/dist/knowledge/data/operators/glsl_mat.json +3720 -0
  213. package/dist/knowledge/data/operators/glsl_multi_top.json +2922 -0
  214. package/dist/knowledge/data/operators/glsl_pop.json +2317 -0
  215. package/dist/knowledge/data/operators/glsl_select_pop.json +280 -0
  216. package/dist/knowledge/data/operators/glsl_top.json +2922 -0
  217. package/dist/knowledge/data/operators/grid_pop.json +1029 -0
  218. package/dist/knowledge/data/operators/grid_sop.json +1041 -0
  219. package/dist/knowledge/data/operators/group_pop.json +1423 -0
  220. package/dist/knowledge/data/operators/group_sop.json +2075 -0
  221. package/dist/knowledge/data/operators/handle_chop.json +712 -0
  222. package/dist/knowledge/data/operators/handle_comp.json +2171 -0
  223. package/dist/knowledge/data/operators/histogram_pop.json +533 -0
  224. package/dist/knowledge/data/operators/hog_chop.json +620 -0
  225. package/dist/knowledge/data/operators/hokuyo_chop.json +941 -0
  226. package/dist/knowledge/data/operators/hold_chop.json +664 -0
  227. package/dist/knowledge/data/operators/hole_sop.json +291 -0
  228. package/dist/knowledge/data/operators/hsv_adjust_top.json +1370 -0
  229. package/dist/knowledge/data/operators/hsv_to_rgb_top.json +847 -0
  230. package/dist/knowledge/data/operators/import_select_chop.json +1838 -0
  231. package/dist/knowledge/data/operators/import_select_pop.json +808 -0
  232. package/dist/knowledge/data/operators/import_select_sop.json +1463 -0
  233. package/dist/knowledge/data/operators/import_select_top.json +993 -0
  234. package/dist/knowledge/data/operators/impulse_force_comp.json +1415 -0
  235. package/dist/knowledge/data/operators/in_chop.json +572 -0
  236. package/dist/knowledge/data/operators/in_dat.json +386 -0
  237. package/dist/knowledge/data/operators/in_mat.json +1559 -0
  238. package/dist/knowledge/data/operators/in_pop.json +280 -0
  239. package/dist/knowledge/data/operators/in_sop.json +102 -0
  240. package/dist/knowledge/data/operators/in_top.json +903 -0
  241. package/dist/knowledge/data/operators/index.json +1 -0
  242. package/dist/knowledge/data/operators/indices_dat.json +526 -0
  243. package/dist/knowledge/data/operators/info_chop.json +757 -0
  244. package/dist/knowledge/data/operators/info_dat.json +430 -0
  245. package/dist/knowledge/data/operators/insert_dat.json +896 -0
  246. package/dist/knowledge/data/operators/inside_top.json +1652 -0
  247. package/dist/knowledge/data/operators/interpolate_chop.json +711 -0
  248. package/dist/knowledge/data/operators/inverse_curve_chop.json +898 -0
  249. package/dist/knowledge/data/operators/inverse_curve_sop.json +97 -0
  250. package/dist/knowledge/data/operators/inverse_kin_chop.json +850 -0
  251. package/dist/knowledge/data/operators/iso_surface_sop.json +337 -0
  252. package/dist/knowledge/data/operators/join_chop.json +1368 -0
  253. package/dist/knowledge/data/operators/join_sop.json +667 -0
  254. package/dist/knowledge/data/operators/joint_sop.json +573 -0
  255. package/dist/knowledge/data/operators/joystick_chop.json +1558 -0
  256. package/dist/knowledge/data/operators/json_dat.json +619 -0
  257. package/dist/knowledge/data/operators/keyboard_in_chop.json +1041 -0
  258. package/dist/knowledge/data/operators/keyboard_in_dat.json +950 -0
  259. package/dist/knowledge/data/operators/keyframe_chop.json +711 -0
  260. package/dist/knowledge/data/operators/kinect_azure_chop.json +1092 -0
  261. package/dist/knowledge/data/operators/kinect_azure_select_top.json +1187 -0
  262. package/dist/knowledge/data/operators/kinect_azure_top.json +2737 -0
  263. package/dist/knowledge/data/operators/kinect_chop.json +1700 -0
  264. package/dist/knowledge/data/operators/kinect_sop.json +379 -0
  265. package/dist/knowledge/data/operators/kinect_top.json +1700 -0
  266. package/dist/knowledge/data/operators/lag_chop.json +1040 -0
  267. package/dist/knowledge/data/operators/laser_chop.json +1746 -0
  268. package/dist/knowledge/data/operators/laser_device_chop.json +1228 -0
  269. package/dist/knowledge/data/operators/lattice_sop.json +432 -0
  270. package/dist/knowledge/data/operators/layout_top.json +1936 -0
  271. package/dist/knowledge/data/operators/leap_motion_chop.json +1699 -0
  272. package/dist/knowledge/data/operators/leap_motion_top.json +1323 -0
  273. package/dist/knowledge/data/operators/lens_distort_top.json +2262 -0
  274. package/dist/knowledge/data/operators/leuze_rod4_chop.json +1371 -0
  275. package/dist/knowledge/data/operators/level_top.json +2273 -0
  276. package/dist/knowledge/data/operators/lfo_chop.json +1088 -0
  277. package/dist/knowledge/data/operators/light_comp.json +5410 -0
  278. package/dist/knowledge/data/operators/limit_chop.json +1133 -0
  279. package/dist/knowledge/data/operators/limit_pop.json +1243 -0
  280. package/dist/knowledge/data/operators/limit_sop.json +2075 -0
  281. package/dist/knowledge/data/operators/limit_top.json +1557 -0
  282. package/dist/knowledge/data/operators/line_break_pop.json +447 -0
  283. package/dist/knowledge/data/operators/line_divide_pop.json +688 -0
  284. package/dist/knowledge/data/operators/line_mat.json +5551 -0
  285. package/dist/knowledge/data/operators/line_metrics_pop.json +548 -0
  286. package/dist/knowledge/data/operators/line_pop.json +1343 -0
  287. package/dist/knowledge/data/operators/line_smooth_pop.json +1028 -0
  288. package/dist/knowledge/data/operators/line_sop.json +330 -0
  289. package/dist/knowledge/data/operators/line_thick_sop.json +478 -0
  290. package/dist/knowledge/data/operators/list_comp.json +6729 -0
  291. package/dist/knowledge/data/operators/lod_sop.json +431 -0
  292. package/dist/knowledge/data/operators/logic_chop.json +946 -0
  293. package/dist/knowledge/data/operators/lookup_attribute_pop.json +684 -0
  294. package/dist/knowledge/data/operators/lookup_channel_pop.json +1140 -0
  295. package/dist/knowledge/data/operators/lookup_chop.json +992 -0
  296. package/dist/knowledge/data/operators/lookup_dat.json +664 -0
  297. package/dist/knowledge/data/operators/lookup_texture_pop.json +1494 -0
  298. package/dist/knowledge/data/operators/lookup_top.json +1510 -0
  299. package/dist/knowledge/data/operators/lsystem_sop.json +1699 -0
  300. package/dist/knowledge/data/operators/ltc_in_chop.json +760 -0
  301. package/dist/knowledge/data/operators/ltc_out_chop.json +1512 -0
  302. package/dist/knowledge/data/operators/luma_blur_top.json +1316 -0
  303. package/dist/knowledge/data/operators/luma_level_top.json +1746 -0
  304. package/dist/knowledge/data/operators/magnet_sop.json +759 -0
  305. package/dist/knowledge/data/operators/material_sop.json +98 -0
  306. package/dist/knowledge/data/operators/math_chop.json +1193 -0
  307. package/dist/knowledge/data/operators/math_combine_pop.json +4283 -0
  308. package/dist/knowledge/data/operators/math_mix_pop.json +2641 -0
  309. package/dist/knowledge/data/operators/math_pop.json +2163 -0
  310. package/dist/knowledge/data/operators/math_top.json +1885 -0
  311. package/dist/knowledge/data/operators/matte_top.json +994 -0
  312. package/dist/knowledge/data/operators/media_file_info_dat.json +571 -0
  313. package/dist/knowledge/data/operators/merge_chop.json +627 -0
  314. package/dist/knowledge/data/operators/merge_dat.json +620 -0
  315. package/dist/knowledge/data/operators/merge_pop.json +764 -0
  316. package/dist/knowledge/data/operators/merge_sop.json +100 -0
  317. package/dist/knowledge/data/operators/metaball_sop.json +476 -0
  318. package/dist/knowledge/data/operators/midi_event_dat.json +1135 -0
  319. package/dist/knowledge/data/operators/midi_in_chop.json +3297 -0
  320. package/dist/knowledge/data/operators/midi_in_dat.json +1183 -0
  321. package/dist/knowledge/data/operators/midi_in_map_chop.json +946 -0
  322. package/dist/knowledge/data/operators/midi_out_chop.json +1793 -0
  323. package/dist/knowledge/data/operators/mirror_top.json +1271 -0
  324. package/dist/knowledge/data/operators/model_sop.json +52 -0
  325. package/dist/knowledge/data/operators/monitors_dat.json +617 -0
  326. package/dist/knowledge/data/operators/monochrome_top.json +1041 -0
  327. package/dist/knowledge/data/operators/mosys_chop.json +804 -0
  328. package/dist/knowledge/data/operators/mosys_top.json +896 -0
  329. package/dist/knowledge/data/operators/mouse_in_chop.json +1275 -0
  330. package/dist/knowledge/data/operators/mouse_out_chop.json +711 -0
  331. package/dist/knowledge/data/operators/movie_file_in_top.json +3546 -0
  332. package/dist/knowledge/data/operators/movie_file_out_top.json +3390 -0
  333. package/dist/knowledge/data/operators/mpcdi_dat.json +711 -0
  334. package/dist/knowledge/data/operators/mpcdi_top.json +1369 -0
  335. package/dist/knowledge/data/operators/mqtt_client_dat.json +1229 -0
  336. package/dist/knowledge/data/operators/multi_touch_in_dat.json +1185 -0
  337. package/dist/knowledge/data/operators/multiply_top.json +1647 -0
  338. package/dist/knowledge/data/operators/ncam_chop.json +1039 -0
  339. package/dist/knowledge/data/operators/ncam_top.json +1039 -0
  340. package/dist/knowledge/data/operators/ndi_dat.json +478 -0
  341. package/dist/knowledge/data/operators/ndi_in_top.json +1326 -0
  342. package/dist/knowledge/data/operators/ndi_out_top.json +1420 -0
  343. package/dist/knowledge/data/operators/neighbor_pop.json +534 -0
  344. package/dist/knowledge/data/operators/noise_chop.json +2230 -0
  345. package/dist/knowledge/data/operators/noise_pop.json +2107 -0
  346. package/dist/knowledge/data/operators/noise_sop.json +1136 -0
  347. package/dist/knowledge/data/operators/noise_top.json +2356 -0
  348. package/dist/knowledge/data/operators/normal_map_top.json +1182 -0
  349. package/dist/knowledge/data/operators/normal_pop.json +1488 -0
  350. package/dist/knowledge/data/operators/normalize_pop.json +1298 -0
  351. package/dist/knowledge/data/operators/notch_top.json +1511 -0
  352. package/dist/knowledge/data/operators/null_chop.json +673 -0
  353. package/dist/knowledge/data/operators/null_comp.json +2921 -0
  354. package/dist/knowledge/data/operators/null_dat.json +344 -0
  355. package/dist/knowledge/data/operators/null_mat.json +1511 -0
  356. package/dist/knowledge/data/operators/null_pop.json +18 -0
  357. package/dist/knowledge/data/operators/null_sop.json +100 -0
  358. package/dist/knowledge/data/operators/null_top.json +862 -0
  359. package/dist/knowledge/data/operators/nvidia_background_top.json +996 -0
  360. package/dist/knowledge/data/operators/nvidia_denoise_top.json +1089 -0
  361. package/dist/knowledge/data/operators/nvidia_flex_solver_comp.json +5367 -0
  362. package/dist/knowledge/data/operators/nvidia_flex_top.json +995 -0
  363. package/dist/knowledge/data/operators/nvidia_flow_emitter_comp.json +7812 -0
  364. package/dist/knowledge/data/operators/nvidia_flow_top.json +3675 -0
  365. package/dist/knowledge/data/operators/nvidia_upscaler_top.json +1089 -0
  366. package/dist/knowledge/data/operators/oak_device_chop.json +1372 -0
  367. package/dist/knowledge/data/operators/oak_select_chop.json +947 -0
  368. package/dist/knowledge/data/operators/oak_select_top.json +1323 -0
  369. package/dist/knowledge/data/operators/object_chop.json +2356 -0
  370. package/dist/knowledge/data/operators/object_merge_sop.json +194 -0
  371. package/dist/knowledge/data/operators/oculus_audio_chop.json +1371 -0
  372. package/dist/knowledge/data/operators/oculus_rift_chop.json +901 -0
  373. package/dist/knowledge/data/operators/oculus_rift_sop.json +147 -0
  374. package/dist/knowledge/data/operators/oculus_rift_top.json +995 -0
  375. package/dist/knowledge/data/operators/op_execute_dat.json +1463 -0
  376. package/dist/knowledge/data/operators/op_find_dat.json +2827 -0
  377. package/dist/knowledge/data/operators/op_viewer_comp.json +6586 -0
  378. package/dist/knowledge/data/operators/op_viewer_top.json +993 -0
  379. package/dist/knowledge/data/operators/opencolorio_top.json +1980 -0
  380. package/dist/knowledge/data/operators/openvr_chop.json +1135 -0
  381. package/dist/knowledge/data/operators/openvr_sop.json +99 -0
  382. package/dist/knowledge/data/operators/openvr_top.json +900 -0
  383. package/dist/knowledge/data/operators/optical_flow_top.json +1230 -0
  384. package/dist/knowledge/data/operators/optitrack_in_chop.json +854 -0
  385. package/dist/knowledge/data/operators/orbbec_select_top.json +1042 -0
  386. package/dist/knowledge/data/operators/orbbec_top.json +1558 -0
  387. package/dist/knowledge/data/operators/osc_in_chop.json +1371 -0
  388. package/dist/knowledge/data/operators/osc_in_dat.json +1280 -0
  389. package/dist/knowledge/data/operators/osc_out_chop.json +1138 -0
  390. package/dist/knowledge/data/operators/osc_out_dat.json +1280 -0
  391. package/dist/knowledge/data/operators/ouster_select_top.json +1228 -0
  392. package/dist/knowledge/data/operators/ouster_top.json +2404 -0
  393. package/dist/knowledge/data/operators/out_chop.json +476 -0
  394. package/dist/knowledge/data/operators/out_dat.json +386 -0
  395. package/dist/knowledge/data/operators/out_mat.json +1982 -0
  396. package/dist/knowledge/data/operators/out_pop.json +286 -0
  397. package/dist/knowledge/data/operators/out_sop.json +93 -0
  398. package/dist/knowledge/data/operators/out_top.json +903 -0
  399. package/dist/knowledge/data/operators/outside_top.json +1651 -0
  400. package/dist/knowledge/data/operators/over_top.json +1651 -0
  401. package/dist/knowledge/data/operators/override_chop.json +663 -0
  402. package/dist/knowledge/data/operators/pack_top.json +946 -0
  403. package/dist/knowledge/data/operators/pan_tilt_chop.json +11 -0
  404. package/dist/knowledge/data/operators/panel_chop.json +663 -0
  405. package/dist/knowledge/data/operators/panel_execute_dat.json +1182 -0
  406. package/dist/knowledge/data/operators/pangolin_chop.json +1135 -0
  407. package/dist/knowledge/data/operators/parameter_chop.json +803 -0
  408. package/dist/knowledge/data/operators/parameter_comp.json +6962 -0
  409. package/dist/knowledge/data/operators/parameter_dat.json +1698 -0
  410. package/dist/knowledge/data/operators/parameter_execute_dat.json +1371 -0
  411. package/dist/knowledge/data/operators/pargroup_execute_dat.json +1271 -0
  412. package/dist/knowledge/data/operators/particle_pop.json +1130 -0
  413. package/dist/knowledge/data/operators/particle_sop.json +2214 -0
  414. package/dist/knowledge/data/operators/pattern_chop.json +1697 -0
  415. package/dist/knowledge/data/operators/pattern_pop.json +1767 -0
  416. package/dist/knowledge/data/operators/pbr_mat.json +4990 -0
  417. package/dist/knowledge/data/operators/perform_chop.json +1651 -0
  418. package/dist/knowledge/data/operators/perform_dat.json +1184 -0
  419. package/dist/knowledge/data/operators/phaser_chop.json +618 -0
  420. package/dist/knowledge/data/operators/phaser_pop.json +1043 -0
  421. package/dist/knowledge/data/operators/phong_mat.json +5458 -0
  422. package/dist/knowledge/data/operators/photoshop_in_top.json +1418 -0
  423. package/dist/knowledge/data/operators/pipe_in_chop.json +1323 -0
  424. package/dist/knowledge/data/operators/pipe_out_chop.json +1182 -0
  425. package/dist/knowledge/data/operators/point_file_in_pop.json +1246 -0
  426. package/dist/knowledge/data/operators/point_file_in_top.json +3343 -0
  427. package/dist/knowledge/data/operators/point_file_select_top.json +1086 -0
  428. package/dist/knowledge/data/operators/point_generator_pop.json +1407 -0
  429. package/dist/knowledge/data/operators/point_pop.json +752 -0
  430. package/dist/knowledge/data/operators/point_sop.json +2171 -0
  431. package/dist/knowledge/data/operators/point_sprite_mat.json +2920 -0
  432. package/dist/knowledge/data/operators/point_transform_top.json +2779 -0
  433. package/dist/knowledge/data/operators/polygonize_pop.json +386 -0
  434. package/dist/knowledge/data/operators/polyloft_sop.json +759 -0
  435. package/dist/knowledge/data/operators/polypatch_sop.json +761 -0
  436. package/dist/knowledge/data/operators/polyreduce_sop.json +806 -0
  437. package/dist/knowledge/data/operators/polyspline_sop.json +667 -0
  438. package/dist/knowledge/data/operators/polystitch_sop.json +336 -0
  439. package/dist/knowledge/data/operators/pop_to_chop.json +11 -0
  440. package/dist/knowledge/data/operators/pop_to_dat.json +11 -0
  441. package/dist/knowledge/data/operators/pop_to_sop.json +11 -0
  442. package/dist/knowledge/data/operators/pop_to_top.json +11 -0
  443. package/dist/knowledge/data/operators/posistagenet_chop.json +900 -0
  444. package/dist/knowledge/data/operators/prefilter_map_top.json +947 -0
  445. package/dist/knowledge/data/operators/primitive_pop.json +1254 -0
  446. package/dist/knowledge/data/operators/primitive_sop.json +2075 -0
  447. package/dist/knowledge/data/operators/profile_sop.json +756 -0
  448. package/dist/knowledge/data/operators/project_sop.json +1276 -0
  449. package/dist/knowledge/data/operators/projection_pop.json +1060 -0
  450. package/dist/knowledge/data/operators/projection_top.json +1135 -0
  451. package/dist/knowledge/data/operators/proximity_pop.json +505 -0
  452. package/dist/knowledge/data/operators/pulse_chop.json +1744 -0
  453. package/dist/knowledge/data/operators/quantize_pop.json +1052 -0
  454. package/dist/knowledge/data/operators/rails_sop.json +853 -0
  455. package/dist/knowledge/data/operators/ramp_top.json +1899 -0
  456. package/dist/knowledge/data/operators/random_pop.json +1219 -0
  457. package/dist/knowledge/data/operators/raster_sop.json +291 -0
  458. package/dist/knowledge/data/operators/ray_pop.json +497 -0
  459. package/dist/knowledge/data/operators/ray_sop.json +856 -0
  460. package/dist/knowledge/data/operators/realsense_top.json +1608 -0
  461. package/dist/knowledge/data/operators/record_chop.json +1040 -0
  462. package/dist/knowledge/data/operators/rectangle_pop.json +800 -0
  463. package/dist/knowledge/data/operators/rectangle_sop.json +758 -0
  464. package/dist/knowledge/data/operators/rectangle_top.json +2259 -0
  465. package/dist/knowledge/data/operators/refine_sop.json +667 -0
  466. package/dist/knowledge/data/operators/remap_top.json +1182 -0
  467. package/dist/knowledge/data/operators/rename_chop.json +522 -0
  468. package/dist/knowledge/data/operators/render_pass_top.json +3108 -0
  469. package/dist/knowledge/data/operators/render_pick_chop.json +2119 -0
  470. package/dist/knowledge/data/operators/render_pick_dat.json +1840 -0
  471. package/dist/knowledge/data/operators/render_select_top.json +1086 -0
  472. package/dist/knowledge/data/operators/render_top.json +218 -0
  473. package/dist/knowledge/data/operators/renderstream_in_chop.json +617 -0
  474. package/dist/knowledge/data/operators/renderstream_in_top.json +950 -0
  475. package/dist/knowledge/data/operators/renderstream_out_top.json +997 -0
  476. package/dist/knowledge/data/operators/reorder_chop.json +946 -0
  477. package/dist/knowledge/data/operators/reorder_dat.json +711 -0
  478. package/dist/knowledge/data/operators/reorder_top.json +1229 -0
  479. package/dist/knowledge/data/operators/replace_chop.json +568 -0
  480. package/dist/knowledge/data/operators/replicator_comp.json +2208 -0
  481. package/dist/knowledge/data/operators/rerange_pop.json +892 -0
  482. package/dist/knowledge/data/operators/resample_chop.json +1134 -0
  483. package/dist/knowledge/data/operators/resample_sop.json +619 -0
  484. package/dist/knowledge/data/operators/resolution_top.json +892 -0
  485. package/dist/knowledge/data/operators/revolve_pop.json +607 -0
  486. package/dist/knowledge/data/operators/revolve_sop.json +714 -0
  487. package/dist/knowledge/data/operators/rgb_key_top.json +1654 -0
  488. package/dist/knowledge/data/operators/rgb_to_hsv_top.json +853 -0
  489. package/dist/knowledge/data/operators/s_curve_chop.json +1176 -0
  490. package/dist/knowledge/data/operators/scalable_display_top.json +1042 -0
  491. package/dist/knowledge/data/operators/screen_grab_top.json +1465 -0
  492. package/dist/knowledge/data/operators/screen_top.json +1652 -0
  493. package/dist/knowledge/data/operators/script_chop.json +520 -0
  494. package/dist/knowledge/data/operators/script_dat.json +429 -0
  495. package/dist/knowledge/data/operators/script_sop.json +146 -0
  496. package/dist/knowledge/data/operators/script_top.json +947 -0
  497. package/dist/knowledge/data/operators/select_chop.json +899 -0
  498. package/dist/knowledge/data/operators/select_comp.json +5645 -0
  499. package/dist/knowledge/data/operators/select_dat.json +1371 -0
  500. package/dist/knowledge/data/operators/select_mat.json +1977 -0
  501. package/dist/knowledge/data/operators/select_pop.json +347 -0
  502. package/dist/knowledge/data/operators/select_sop.json +100 -0
  503. package/dist/knowledge/data/operators/select_top.json +901 -0
  504. package/dist/knowledge/data/operators/sequence_blend_sop.json +336 -0
  505. package/dist/knowledge/data/operators/serial_chop.json +1182 -0
  506. package/dist/knowledge/data/operators/serial_dat.json +1418 -0
  507. package/dist/knowledge/data/operators/shared_mem_in_chop.json +620 -0
  508. package/dist/knowledge/data/operators/shared_mem_in_comp.json +1323 -0
  509. package/dist/knowledge/data/operators/shared_mem_in_top.json +994 -0
  510. package/dist/knowledge/data/operators/shared_mem_out_chop.json +620 -0
  511. package/dist/knowledge/data/operators/shared_mem_out_comp.json +1372 -0
  512. package/dist/knowledge/data/operators/shared_mem_out_top.json +1137 -0
  513. package/dist/knowledge/data/operators/shift_chop.json +899 -0
  514. package/dist/knowledge/data/operators/shuffle_chop.json +612 -0
  515. package/dist/knowledge/data/operators/sick_top.json +1322 -0
  516. package/dist/knowledge/data/operators/skin_deform_pop.json +972 -0
  517. package/dist/knowledge/data/operators/skin_pop.json +330 -0
  518. package/dist/knowledge/data/operators/skin_sop.json +711 -0
  519. package/dist/knowledge/data/operators/slider_comp.json +6918 -0
  520. package/dist/knowledge/data/operators/slope_chop.json +661 -0
  521. package/dist/knowledge/data/operators/slope_top.json +1370 -0
  522. package/dist/knowledge/data/operators/socketio_dat.json +945 -0
  523. package/dist/knowledge/data/operators/sop_to_chop.json +1137 -0
  524. package/dist/knowledge/data/operators/sop_to_dat.json +622 -0
  525. package/dist/knowledge/data/operators/sop_to_pop.json +409 -0
  526. package/dist/knowledge/data/operators/sort_chop.json +805 -0
  527. package/dist/knowledge/data/operators/sort_dat.json +894 -0
  528. package/dist/knowledge/data/operators/sort_pop.json +1023 -0
  529. package/dist/knowledge/data/operators/sort_sop.json +569 -0
  530. package/dist/knowledge/data/operators/spectrum_top.json +1182 -0
  531. package/dist/knowledge/data/operators/speed_chop.json +1180 -0
  532. package/dist/knowledge/data/operators/sphere_pop.json +1141 -0
  533. package/dist/knowledge/data/operators/sphere_sop.json +1370 -0
  534. package/dist/knowledge/data/operators/splice_chop.json +1226 -0
  535. package/dist/knowledge/data/operators/spring_chop.json +899 -0
  536. package/dist/knowledge/data/operators/spring_sop.json +1463 -0
  537. package/dist/knowledge/data/operators/sprinkle_pop.json +420 -0
  538. package/dist/knowledge/data/operators/sprinkle_sop.json +337 -0
  539. package/dist/knowledge/data/operators/sprite_sop.json +571 -0
  540. package/dist/knowledge/data/operators/ssao_top.json +1510 -0
  541. package/dist/knowledge/data/operators/st2110_device_chop.json +11 -0
  542. package/dist/knowledge/data/operators/stitch_sop.json +807 -0
  543. package/dist/knowledge/data/operators/stretch_chop.json +945 -0
  544. package/dist/knowledge/data/operators/stype_in_chop.json +756 -0
  545. package/dist/knowledge/data/operators/stype_out_chop.json +852 -0
  546. package/dist/knowledge/data/operators/stype_top.json +943 -0
  547. package/dist/knowledge/data/operators/subdivide_pop.json +292 -0
  548. package/dist/knowledge/data/operators/subdivide_sop.json +618 -0
  549. package/dist/knowledge/data/operators/substance_select_top.json +945 -0
  550. package/dist/knowledge/data/operators/substance_top.json +1182 -0
  551. package/dist/knowledge/data/operators/substitute_dat.json +1605 -0
  552. package/dist/knowledge/data/operators/subtract_top.json +1650 -0
  553. package/dist/knowledge/data/operators/superquad_sop.json +1135 -0
  554. package/dist/knowledge/data/operators/surfsect_sop.json +853 -0
  555. package/dist/knowledge/data/operators/sweep_sop.json +947 -0
  556. package/dist/knowledge/data/operators/switch_chop.json +523 -0
  557. package/dist/knowledge/data/operators/switch_dat.json +383 -0
  558. package/dist/knowledge/data/operators/switch_mat.json +1553 -0
  559. package/dist/knowledge/data/operators/switch_pop.json +496 -0
  560. package/dist/knowledge/data/operators/switch_sop.json +101 -0
  561. package/dist/knowledge/data/operators/switch_top.json +959 -0
  562. package/dist/knowledge/data/operators/sync_in_chop.json +617 -0
  563. package/dist/knowledge/data/operators/sync_out_chop.json +993 -0
  564. package/dist/knowledge/data/operators/syphon_spout_in_top.json +946 -0
  565. package/dist/knowledge/data/operators/syphon_spout_out_top.json +948 -0
  566. package/dist/knowledge/data/operators/table_comp.json +7009 -0
  567. package/dist/knowledge/data/operators/table_dat.json +1080 -0
  568. package/dist/knowledge/data/operators/tablet_chop.json +1367 -0
  569. package/dist/knowledge/data/operators/text_comp.json +8981 -0
  570. package/dist/knowledge/data/operators/text_dat.json +675 -0
  571. package/dist/knowledge/data/operators/text_sop.json +1512 -0
  572. package/dist/knowledge/data/operators/text_top.json +4236 -0
  573. package/dist/knowledge/data/operators/texture_3d_top.json +1417 -0
  574. package/dist/knowledge/data/operators/texture_map_pop.json +1744 -0
  575. package/dist/knowledge/data/operators/texture_sop.json +992 -0
  576. package/dist/knowledge/data/operators/threshold_top.json +1227 -0
  577. package/dist/knowledge/data/operators/tile_top.json +1840 -0
  578. package/dist/knowledge/data/operators/time_comp.json +1745 -0
  579. package/dist/knowledge/data/operators/time_machine_top.json +1041 -0
  580. package/dist/knowledge/data/operators/time_slice_chop.json +568 -0
  581. package/dist/knowledge/data/operators/timecode_chop.json +1981 -0
  582. package/dist/knowledge/data/operators/timeline_chop.json +1038 -0
  583. package/dist/knowledge/data/operators/timer_chop.json +4236 -0
  584. package/dist/knowledge/data/operators/top_to_chop.json +2077 -0
  585. package/dist/knowledge/data/operators/top_to_pop.json +2144 -0
  586. package/dist/knowledge/data/operators/topology_pop.json +1526 -0
  587. package/dist/knowledge/data/operators/torus_pop.json +901 -0
  588. package/dist/knowledge/data/operators/torus_sop.json +1368 -0
  589. package/dist/knowledge/data/operators/touch_in_chop.json +1182 -0
  590. package/dist/knowledge/data/operators/touch_in_dat.json +618 -0
  591. package/dist/knowledge/data/operators/touch_in_top.json +1182 -0
  592. package/dist/knowledge/data/operators/touch_out_chop.json +947 -0
  593. package/dist/knowledge/data/operators/touch_out_dat.json +712 -0
  594. package/dist/knowledge/data/operators/touch_out_top.json +1134 -0
  595. package/dist/knowledge/data/operators/trace_sop.json +759 -0
  596. package/dist/knowledge/data/operators/trail_chop.json +901 -0
  597. package/dist/knowledge/data/operators/trail_pop.json +827 -0
  598. package/dist/knowledge/data/operators/trail_sop.json +616 -0
  599. package/dist/knowledge/data/operators/transform_chop.json +2168 -0
  600. package/dist/knowledge/data/operators/transform_pop.json +2659 -0
  601. package/dist/knowledge/data/operators/transform_sop.json +1466 -0
  602. package/dist/knowledge/data/operators/transform_top.json +1803 -0
  603. package/dist/knowledge/data/operators/transform_xyz_chop.json +1369 -0
  604. package/dist/knowledge/data/operators/transpose_dat.json +334 -0
  605. package/dist/knowledge/data/operators/trig_pop.json +1135 -0
  606. package/dist/knowledge/data/operators/trigger_chop.json +2214 -0
  607. package/dist/knowledge/data/operators/trim_chop.json +805 -0
  608. package/dist/knowledge/data/operators/trim_sop.json +336 -0
  609. package/dist/knowledge/data/operators/tristrip_sop.json +194 -0
  610. package/dist/knowledge/data/operators/tube_pop.json +861 -0
  611. package/dist/knowledge/data/operators/tube_sop.json +1323 -0
  612. package/dist/knowledge/data/operators/tuio_in_dat.json +806 -0
  613. package/dist/knowledge/data/operators/twist_pop.json +1127 -0
  614. package/dist/knowledge/data/operators/twist_sop.json +533 -0
  615. package/dist/knowledge/data/operators/udp_in_dat.json +1090 -0
  616. package/dist/knowledge/data/operators/udp_out_dat.json +1280 -0
  617. package/dist/knowledge/data/operators/under_top.json +1652 -0
  618. package/dist/knowledge/data/operators/usd_comp.json +4800 -0
  619. package/dist/knowledge/data/operators/vertex_sop.json +667 -0
  620. package/dist/knowledge/data/operators/video_device_in_top.json +3062 -0
  621. package/dist/knowledge/data/operators/video_device_out_top.json +1936 -0
  622. package/dist/knowledge/data/operators/video_devices_dat.json +616 -0
  623. package/dist/knowledge/data/operators/video_stream_in_top.json +1842 -0
  624. package/dist/knowledge/data/operators/video_stream_out_top.json +2548 -0
  625. package/dist/knowledge/data/operators/vioso_top.json +943 -0
  626. package/dist/knowledge/data/operators/warp_chop.json +570 -0
  627. package/dist/knowledge/data/operators/wave_chop.json +1510 -0
  628. package/dist/knowledge/data/operators/web_client_dat.json +1514 -0
  629. package/dist/knowledge/data/operators/web_render_top.json +1749 -0
  630. package/dist/knowledge/data/operators/web_server_dat.json +714 -0
  631. package/dist/knowledge/data/operators/webrtc_dat.json +851 -0
  632. package/dist/knowledge/data/operators/websocket_dat.json +901 -0
  633. package/dist/knowledge/data/operators/widget_comp.json +6299 -0
  634. package/dist/knowledge/data/operators/window_comp.json +3061 -0
  635. package/dist/knowledge/data/operators/wireframe_mat.json +2165 -0
  636. package/dist/knowledge/data/operators/wireframe_sop.json +338 -0
  637. package/dist/knowledge/data/operators/wrnchai_chop.json +1084 -0
  638. package/dist/knowledge/data/operators/xml_dat.json +1230 -0
  639. package/dist/knowledge/data/operators/zed_chop.json +1840 -0
  640. package/dist/knowledge/data/operators/zed_sop.json +712 -0
  641. package/dist/knowledge/data/operators/zed_top.json +1981 -0
  642. package/dist/knowledge/data/patterns.json +1 -0
  643. package/dist/knowledge/data/python-api/App.json +78 -0
  644. package/dist/knowledge/data/python-api/Attribute.json +43 -0
  645. package/dist/knowledge/data/python-api/Attributes.json +41 -0
  646. package/dist/knowledge/data/python-api/Bounds.json +10 -0
  647. package/dist/knowledge/data/python-api/CHOP.json +683 -0
  648. package/dist/knowledge/data/python-api/COMP.json +1019 -0
  649. package/dist/knowledge/data/python-api/Cell.json +80 -0
  650. package/dist/knowledge/data/python-api/Channel.json +100 -0
  651. package/dist/knowledge/data/python-api/Connector.json +43 -0
  652. package/dist/knowledge/data/python-api/DAT.json +1289 -0
  653. package/dist/knowledge/data/python-api/Dependency.json +10 -0
  654. package/dist/knowledge/data/python-api/Error_DAT.json +9 -0
  655. package/dist/knowledge/data/python-api/Group.json +54 -0
  656. package/dist/knowledge/data/python-api/License.json +25 -0
  657. package/dist/knowledge/data/python-api/MAT.json +621 -0
  658. package/dist/knowledge/data/python-api/MOD.json +83 -0
  659. package/dist/knowledge/data/python-api/Matrix.json +556 -0
  660. package/dist/knowledge/data/python-api/Monitor.json +25 -0
  661. package/dist/knowledge/data/python-api/Network.json +10 -0
  662. package/dist/knowledge/data/python-api/NetworkEditor.json +154 -0
  663. package/dist/knowledge/data/python-api/Node.json +10 -0
  664. package/dist/knowledge/data/python-api/OP.json +621 -0
  665. package/dist/knowledge/data/python-api/OP_Viewer_COMP.json +9 -0
  666. package/dist/knowledge/data/python-api/ObjectCOMP.json +1150 -0
  667. package/dist/knowledge/data/python-api/Page.json +797 -0
  668. package/dist/knowledge/data/python-api/Pane.json +62 -0
  669. package/dist/knowledge/data/python-api/Panel.json +25 -0
  670. package/dist/knowledge/data/python-api/PanelCOMP.json +1167 -0
  671. package/dist/knowledge/data/python-api/PanelValue.json +25 -0
  672. package/dist/knowledge/data/python-api/Par.json +115 -0
  673. package/dist/knowledge/data/python-api/ParGroup.json +101 -0
  674. package/dist/knowledge/data/python-api/Parameter.json +10 -0
  675. package/dist/knowledge/data/python-api/Parent.json +10 -0
  676. package/dist/knowledge/data/python-api/Pattern_CHOP.json +9 -0
  677. package/dist/knowledge/data/python-api/Peer.json +85 -0
  678. package/dist/knowledge/data/python-api/Point.json +32 -0
  679. package/dist/knowledge/data/python-api/Position.json +92 -0
  680. package/dist/knowledge/data/python-api/Prim.json +63 -0
  681. package/dist/knowledge/data/python-api/Project.json +118 -0
  682. package/dist/knowledge/data/python-api/PythonOp.json +140 -0
  683. package/dist/knowledge/data/python-api/Quaternion.json +24 -0
  684. package/dist/knowledge/data/python-api/Replicator_COMP.json +9 -0
  685. package/dist/knowledge/data/python-api/Run.json +32 -0
  686. package/dist/knowledge/data/python-api/Runs.json +10 -0
  687. package/dist/knowledge/data/python-api/SOP.json +642 -0
  688. package/dist/knowledge/data/python-api/ScriptOp.json +119 -0
  689. package/dist/knowledge/data/python-api/Segment.json +25 -0
  690. package/dist/knowledge/data/python-api/Sequence.json +48 -0
  691. package/dist/knowledge/data/python-api/Stype.json +9 -0
  692. package/dist/knowledge/data/python-api/SysInfo.json +25 -0
  693. package/dist/knowledge/data/python-api/TOP.json +724 -0
  694. package/dist/knowledge/data/python-api/Timecode.json +200 -0
  695. package/dist/knowledge/data/python-api/UI.json +73 -0
  696. package/dist/knowledge/data/python-api/Vertex.json +25 -0
  697. package/dist/knowledge/data/python-api/baseCOMP.json +1019 -0
  698. package/dist/knowledge/data/python-api/evaluateDAT.json +1289 -0
  699. package/dist/knowledge/data/python-api/examineDAT.json +1289 -0
  700. package/dist/knowledge/data/python-api/glslTOP.json +724 -0
  701. package/dist/knowledge/data/python-api/index.json +1 -0
  702. package/dist/knowledge/data/python-api/listCOMP.json +1516 -0
  703. package/dist/knowledge/data/python-api/midiinDAT.json +1328 -0
  704. package/dist/knowledge/data/python-api/scriptCHOP.json +24 -0
  705. package/dist/knowledge/data/python-api/scriptDAT.json +1335 -0
  706. package/dist/knowledge/data/python-api/scriptSOP.json +24 -0
  707. package/dist/knowledge/data/python-api/scriptTOP.json +24 -0
  708. package/dist/knowledge/data/python-api/serialDAT.json +1323 -0
  709. package/dist/knowledge/data/python-api/tcpipDAT.json +1357 -0
  710. package/dist/knowledge/data/python-api/td.json +646 -0
  711. package/dist/knowledge/data/python-api/td_Module.json +24 -0
  712. package/dist/knowledge/data/tutorials/anatomy_of_a_chop.json +275 -0
  713. package/dist/knowledge/data/tutorials/build_a_list_comp.json +268 -0
  714. package/dist/knowledge/data/tutorials/index.json +1 -0
  715. package/dist/knowledge/data/tutorials/introduction_to_python_tutorial.json +1598 -0
  716. package/dist/knowledge/data/tutorials/tdbitwig_user_guide.json +1986 -0
  717. package/dist/knowledge/data/tutorials/touchdesigner_video_server_specification_guide.json +555 -0
  718. package/dist/knowledge/data/tutorials/video_streaming_user_guide.json +653 -0
  719. package/dist/knowledge/data/tutorials/write_a_cplusplus_chop.json +139 -0
  720. package/dist/knowledge/data/tutorials/write_a_cplusplus_plugin.json +796 -0
  721. package/dist/knowledge/data/tutorials/write_a_cplusplus_top.json +104 -0
  722. package/dist/knowledge/data/tutorials/write_a_cuda_dll.json +259 -0
  723. package/dist/knowledge/data/tutorials/write_a_glsl_material.json +2353 -0
  724. package/dist/knowledge/data/tutorials/write_a_glsl_top.json +818 -0
  725. package/dist/knowledge/data/tutorials/write_a_shared_memory_chop.json +261 -0
  726. package/dist/knowledge/data/tutorials/write_a_shared_memory_top.json +193 -0
  727. package/dist/recipes/audio_spectrum_bars.json +26 -0
  728. package/dist/recipes/data_sonification.json +37 -0
  729. package/dist/recipes/feedback_tunnel.json +73 -0
  730. package/dist/recipes/kinect_silhouette.json +45 -0
  731. package/dist/recipes/led_strip_mapper.json +32 -0
  732. package/dist/recipes/noise_landscape.json +76 -0
  733. package/dist/recipes/particle_galaxy.json +52 -0
  734. package/dist/recipes/projection_mapping.json +25 -0
  735. package/dist/recipes/reaction_diffusion.json +90 -0
  736. package/dist/recipes/webcam_glitch.json +40 -0
  737. package/package.json +74 -0
  738. package/recipes/audio_spectrum_bars.json +26 -0
  739. package/recipes/data_sonification.json +37 -0
  740. package/recipes/feedback_tunnel.json +73 -0
  741. package/recipes/kinect_silhouette.json +45 -0
  742. package/recipes/led_strip_mapper.json +32 -0
  743. package/recipes/noise_landscape.json +76 -0
  744. package/recipes/particle_galaxy.json +52 -0
  745. package/recipes/projection_mapping.json +25 -0
  746. package/recipes/reaction_diffusion.json +90 -0
  747. package/recipes/webcam_glitch.json +40 -0
  748. package/td/README.md +160 -0
  749. package/td/bootstrap.py +73 -0
  750. package/td/modules/mcp/__init__.py +1 -0
  751. package/td/modules/mcp/controllers/__init__.py +1 -0
  752. package/td/modules/mcp/controllers/api_controller.py +240 -0
  753. package/td/modules/mcp/dev.py +40 -0
  754. package/td/modules/mcp/events.py +25 -0
  755. package/td/modules/mcp/install.py +155 -0
  756. package/td/modules/mcp/services/__init__.py +1 -0
  757. package/td/modules/mcp/services/analysis_service.py +64 -0
  758. package/td/modules/mcp/services/api_service.py +195 -0
  759. package/td/modules/mcp/services/batch_service.py +49 -0
  760. package/td/modules/mcp/services/preview_service.py +40 -0
  761. package/td/modules/utils/__init__.py +1 -0
  762. package/td/modules/utils/version.py +3 -0
  763. package/td/startup.py +34 -0
  764. package/td/templates/webserver_callbacks.py +50 -0
  765. package/td/tests/test_api_controller.py +242 -0
@@ -0,0 +1,2353 @@
1
+ {
2
+ "id": "write_a_glsl_material",
3
+ "name": "Write a GLSL Material",
4
+ "displayName": "Write a GLSL Material",
5
+ "category": "TUTORIAL",
6
+ "subcategory": "GLSL Tutorial",
7
+ "type": "tutorial",
8
+ "description": "This document explains the finer points of writing a GLSL Material in TouchDesigner. It is assumed the reader already has an understanding of the GLSL language. The official GLSL documentation can be found at this address.",
9
+ "summary": "This document explains the finer points of writing a GLSL Material in TouchDesigner. It is assumed the reader already has an understanding of the GLSL language. The official GLSL documentation can be ...",
10
+ "content": {
11
+ "sections": [
12
+ {
13
+ "title": "Contents",
14
+ "level": 2,
15
+ "content": [
16
+ {
17
+ "type": "unordered-list",
18
+ "items": [
19
+ "1 Overview\n1.1 GLSL Version\n1.2 The concept of GLSL Shaders\n1.3 TouchDesigner GLSL conventions",
20
+ "1.1 GLSL Version",
21
+ "1.2 The concept of GLSL Shaders",
22
+ "1.3 TouchDesigner GLSL conventions",
23
+ "2 Shader Stages\n2.1 Vertex Shader\n2.2 Pixel Shader\n2.3 Geometry Shader",
24
+ "2.1 Vertex Shader",
25
+ "2.2 Pixel Shader",
26
+ "2.3 Geometry Shader",
27
+ "3 A Basic Shader\n3.1 Vertex Shader\n3.2 Pixel Shader",
28
+ "3.1 Vertex Shader",
29
+ "3.2 Pixel Shader",
30
+ "4 Working with Geometry Attributes",
31
+ "5 TouchDesigner specific defines",
32
+ "6 TouchDesigner specific Uniforms",
33
+ "7 TouchDesigner specific Functions\n7.1 Vertex Shader Only Functions\n7.2 Geometry Shader Only Functions\n7.3 Pixel Shader Only Functions\n7.3.1 Physically Based (PBR) Lighting\n7.3.2 Phong Lighting\n7.3.3 Common Lighting Functions\n\n7.4 Common Functions\n7.4.1 General functions\n7.4.2 Matrix functions\n7.4.3 Perlin and Simplex noise functions\n7.4.4 HSV Conversion\n7.4.5 Projection Conversions",
34
+ "7.1 Vertex Shader Only Functions",
35
+ "7.2 Geometry Shader Only Functions",
36
+ "7.3 Pixel Shader Only Functions\n7.3.1 Physically Based (PBR) Lighting\n7.3.2 Phong Lighting\n7.3.3 Common Lighting Functions",
37
+ "7.3.1 Physically Based (PBR) Lighting",
38
+ "7.3.2 Phong Lighting",
39
+ "7.3.3 Common Lighting Functions",
40
+ "7.4 Common Functions\n7.4.1 General functions\n7.4.2 Matrix functions\n7.4.3 Perlin and Simplex noise functions\n7.4.4 HSV Conversion\n7.4.5 Projection Conversions",
41
+ "7.4.1 General functions",
42
+ "7.4.2 Matrix functions",
43
+ "7.4.3 Perlin and Simplex noise functions",
44
+ "7.4.4 HSV Conversion",
45
+ "7.4.5 Projection Conversions",
46
+ "8 Working with Lights\n8.1 Custom work with lights\n8.1.1 Knowing which variables correspond to which Light COMPs\n8.1.2 Light Parameters\n8.1.3 Cone Lighting Technique\n8.1.4 Attenuation\n8.1.5 Projection and Shadow Mapping\n8.1.5.1 Projection Mapping\n8.1.5.2 Shadow Mapping",
47
+ "8.1 Custom work with lights\n8.1.1 Knowing which variables correspond to which Light COMPs\n8.1.2 Light Parameters\n8.1.3 Cone Lighting Technique\n8.1.4 Attenuation\n8.1.5 Projection and Shadow Mapping\n8.1.5.1 Projection Mapping\n8.1.5.2 Shadow Mapping",
48
+ "8.1.1 Knowing which variables correspond to which Light COMPs",
49
+ "8.1.2 Light Parameters",
50
+ "8.1.3 Cone Lighting Technique",
51
+ "8.1.4 Attenuation",
52
+ "8.1.5 Projection and Shadow Mapping\n8.1.5.1 Projection Mapping\n8.1.5.2 Shadow Mapping",
53
+ "8.1.5.1 Projection Mapping",
54
+ "8.1.5.2 Shadow Mapping",
55
+ "9 Multiple Render Targets",
56
+ "10 Multi-Camera Rendering",
57
+ "11 Image Outputs",
58
+ "12 Outputting gl_Position",
59
+ "13 Specilization Constants",
60
+ "14 Working with Deforms\n14.1 Skinning Deforms (Bone Deforms)\n14.1.1 Functions\n\n14.2 Instancing\n14.2.1 Instance Index/ID\n14.2.2 Deform Functions\n14.2.3 Attribute Functions\n14.2.4 Instance Texturing",
61
+ "14.1 Skinning Deforms (Bone Deforms)\n14.1.1 Functions",
62
+ "14.1.1 Functions",
63
+ "14.2 Instancing\n14.2.1 Instance Index/ID\n14.2.2 Deform Functions\n14.2.3 Attribute Functions\n14.2.4 Instance Texturing",
64
+ "14.2.1 Instance Index/ID",
65
+ "14.2.2 Deform Functions",
66
+ "14.2.3 Attribute Functions",
67
+ "14.2.4 Instance Texturing",
68
+ "15 Point Sprites",
69
+ "16 Order Independent Transparency",
70
+ "17 Dithering",
71
+ "18 Picking",
72
+ "19 Shadertoy\n19.1 VR Shaders",
73
+ "19.1 VR Shaders",
74
+ "20 Other Notes\n20.1 #version statement\n20.2 #include statements\n20.3 Diagnosing crashes due to GLSL\n20.4 Changes from GLSL 1.20\n20.5 Major changes since TouchDesigner088",
75
+ "20.1 #version statement",
76
+ "20.2 #include statements",
77
+ "20.3 Diagnosing crashes due to GLSL",
78
+ "20.4 Changes from GLSL 1.20",
79
+ "20.5 Major changes since TouchDesigner088",
80
+ "21 Related Articles"
81
+ ]
82
+ },
83
+ {
84
+ "type": "unordered-list",
85
+ "items": [
86
+ "1.1 GLSL Version",
87
+ "1.2 The concept of GLSL Shaders",
88
+ "1.3 TouchDesigner GLSL conventions"
89
+ ]
90
+ },
91
+ {
92
+ "type": "unordered-list",
93
+ "items": [
94
+ "2.1 Vertex Shader",
95
+ "2.2 Pixel Shader",
96
+ "2.3 Geometry Shader"
97
+ ]
98
+ },
99
+ {
100
+ "type": "unordered-list",
101
+ "items": [
102
+ "3.1 Vertex Shader",
103
+ "3.2 Pixel Shader"
104
+ ]
105
+ },
106
+ {
107
+ "type": "unordered-list",
108
+ "items": [
109
+ "7.1 Vertex Shader Only Functions",
110
+ "7.2 Geometry Shader Only Functions",
111
+ "7.3 Pixel Shader Only Functions\n7.3.1 Physically Based (PBR) Lighting\n7.3.2 Phong Lighting\n7.3.3 Common Lighting Functions",
112
+ "7.3.1 Physically Based (PBR) Lighting",
113
+ "7.3.2 Phong Lighting",
114
+ "7.3.3 Common Lighting Functions",
115
+ "7.4 Common Functions\n7.4.1 General functions\n7.4.2 Matrix functions\n7.4.3 Perlin and Simplex noise functions\n7.4.4 HSV Conversion\n7.4.5 Projection Conversions",
116
+ "7.4.1 General functions",
117
+ "7.4.2 Matrix functions",
118
+ "7.4.3 Perlin and Simplex noise functions",
119
+ "7.4.4 HSV Conversion",
120
+ "7.4.5 Projection Conversions"
121
+ ]
122
+ },
123
+ {
124
+ "type": "unordered-list",
125
+ "items": [
126
+ "7.3.1 Physically Based (PBR) Lighting",
127
+ "7.3.2 Phong Lighting",
128
+ "7.3.3 Common Lighting Functions"
129
+ ]
130
+ },
131
+ {
132
+ "type": "unordered-list",
133
+ "items": [
134
+ "7.4.1 General functions",
135
+ "7.4.2 Matrix functions",
136
+ "7.4.3 Perlin and Simplex noise functions",
137
+ "7.4.4 HSV Conversion",
138
+ "7.4.5 Projection Conversions"
139
+ ]
140
+ },
141
+ {
142
+ "type": "unordered-list",
143
+ "items": [
144
+ "8.1 Custom work with lights\n8.1.1 Knowing which variables correspond to which Light COMPs\n8.1.2 Light Parameters\n8.1.3 Cone Lighting Technique\n8.1.4 Attenuation\n8.1.5 Projection and Shadow Mapping\n8.1.5.1 Projection Mapping\n8.1.5.2 Shadow Mapping",
145
+ "8.1.1 Knowing which variables correspond to which Light COMPs",
146
+ "8.1.2 Light Parameters",
147
+ "8.1.3 Cone Lighting Technique",
148
+ "8.1.4 Attenuation",
149
+ "8.1.5 Projection and Shadow Mapping\n8.1.5.1 Projection Mapping\n8.1.5.2 Shadow Mapping",
150
+ "8.1.5.1 Projection Mapping",
151
+ "8.1.5.2 Shadow Mapping"
152
+ ]
153
+ },
154
+ {
155
+ "type": "unordered-list",
156
+ "items": [
157
+ "8.1.1 Knowing which variables correspond to which Light COMPs",
158
+ "8.1.2 Light Parameters",
159
+ "8.1.3 Cone Lighting Technique",
160
+ "8.1.4 Attenuation",
161
+ "8.1.5 Projection and Shadow Mapping\n8.1.5.1 Projection Mapping\n8.1.5.2 Shadow Mapping",
162
+ "8.1.5.1 Projection Mapping",
163
+ "8.1.5.2 Shadow Mapping"
164
+ ]
165
+ },
166
+ {
167
+ "type": "unordered-list",
168
+ "items": [
169
+ "8.1.5.1 Projection Mapping",
170
+ "8.1.5.2 Shadow Mapping"
171
+ ]
172
+ },
173
+ {
174
+ "type": "unordered-list",
175
+ "items": [
176
+ "14.1 Skinning Deforms (Bone Deforms)\n14.1.1 Functions",
177
+ "14.1.1 Functions",
178
+ "14.2 Instancing\n14.2.1 Instance Index/ID\n14.2.2 Deform Functions\n14.2.3 Attribute Functions\n14.2.4 Instance Texturing",
179
+ "14.2.1 Instance Index/ID",
180
+ "14.2.2 Deform Functions",
181
+ "14.2.3 Attribute Functions",
182
+ "14.2.4 Instance Texturing"
183
+ ]
184
+ },
185
+ {
186
+ "type": "unordered-list",
187
+ "items": [
188
+ "14.1.1 Functions"
189
+ ]
190
+ },
191
+ {
192
+ "type": "unordered-list",
193
+ "items": [
194
+ "14.2.1 Instance Index/ID",
195
+ "14.2.2 Deform Functions",
196
+ "14.2.3 Attribute Functions",
197
+ "14.2.4 Instance Texturing"
198
+ ]
199
+ },
200
+ {
201
+ "type": "unordered-list",
202
+ "items": [
203
+ "19.1 VR Shaders"
204
+ ]
205
+ },
206
+ {
207
+ "type": "unordered-list",
208
+ "items": [
209
+ "20.1 #version statement",
210
+ "20.2 #include statements",
211
+ "20.3 Diagnosing crashes due to GLSL",
212
+ "20.4 Changes from GLSL 1.20",
213
+ "20.5 Major changes since TouchDesigner088"
214
+ ]
215
+ }
216
+ ]
217
+ },
218
+ {
219
+ "title": "Overview[edit]",
220
+ "level": 2,
221
+ "content": [
222
+ {
223
+ "type": "paragraph",
224
+ "text": "This document explains the finer points of writing a GLSL Material in TouchDesigner. It is assumed the reader already has an understanding of the GLSL language. The official GLSL documentation can be found at this address."
225
+ },
226
+ {
227
+ "type": "subsection",
228
+ "title": "GLSL Version[edit]",
229
+ "level": 3
230
+ },
231
+ {
232
+ "type": "paragraph",
233
+ "text": "TouchDesigner uses GLSL 3.30 and newer versions as it's language. Many online examples, as well as WebGL shaders, are written against GLSL 1.20. There are some significant language differences between GLSL 1.20 and GLSL 3.30+. For information about some of these differences, please refer to Changes from GLSL 1.20"
234
+ },
235
+ {
236
+ "type": "subsection",
237
+ "title": "The concept of GLSL Shaders[edit]",
238
+ "level": 3
239
+ },
240
+ {
241
+ "type": "paragraph",
242
+ "text": "A GLSL Shader is a program that is applied to geometry as it is being rendered. A GLSL shader is split into two main components, vertex shader and pixel shader."
243
+ },
244
+ {
245
+ "type": "paragraph",
246
+ "text": "Vertex Shader - A vertex shader is a program that is applied to every vertex of the geometry the Material is applied to."
247
+ },
248
+ {
249
+ "type": "paragraph",
250
+ "text": "Pixel Shader - A pixel shader is a program that is applied to every pixel that is drawn. This is often also referred to as a Fragment Shader."
251
+ },
252
+ {
253
+ "type": "paragraph",
254
+ "text": "There is also the Geometry Shader, which is a stage between the vertex and pixel stages, but it isn't used very often. For more information on Geometry Shaders have a look here."
255
+ },
256
+ {
257
+ "type": "subsection",
258
+ "title": "TouchDesigner GLSL conventions[edit]",
259
+ "level": 3
260
+ },
261
+ {
262
+ "type": "paragraph",
263
+ "text": "All functions and uniforms provided by TouchDesigner as augmentations of the GLSL language will follow these conventions."
264
+ },
265
+ {
266
+ "type": "unordered-list",
267
+ "items": [
268
+ "Function names will always start with the letters TD. e.g. TDLighting()."
269
+ ]
270
+ },
271
+ {
272
+ "type": "code",
273
+ "text": "TD",
274
+ "language": "python"
275
+ },
276
+ {
277
+ "type": "code",
278
+ "text": "TDLighting()",
279
+ "language": "python"
280
+ },
281
+ {
282
+ "type": "unordered-list",
283
+ "items": [
284
+ "Uniforms will start with the letters uTD."
285
+ ]
286
+ },
287
+ {
288
+ "type": "code",
289
+ "text": "uTD",
290
+ "language": "python"
291
+ },
292
+ {
293
+ "type": "unordered-list",
294
+ "items": [
295
+ "Samplers will start with the letters sTD."
296
+ ]
297
+ },
298
+ {
299
+ "type": "code",
300
+ "text": "sTD",
301
+ "language": "python"
302
+ },
303
+ {
304
+ "type": "unordered-list",
305
+ "items": [
306
+ "Images will start with the letters mTD."
307
+ ]
308
+ },
309
+ {
310
+ "type": "code",
311
+ "text": "mTD",
312
+ "language": "python"
313
+ },
314
+ {
315
+ "type": "unordered-list",
316
+ "items": [
317
+ "Vertex input attributes will be named the same as they are in the TouchDesigner SOP interface (P, N, uv)."
318
+ ]
319
+ },
320
+ {
321
+ "type": "paragraph",
322
+ "text": "Most uniforms provided by TouchDesigner will be contained in Uniform Blocks. This means instead of accessing a single matrix by uTDMatrixName, the matrices will be stored a single block with many matrices such as uTDMats, which has members such as uTDMats[0].worldCam and uTDMats[0].projInverse."
323
+ },
324
+ {
325
+ "type": "code",
326
+ "text": "uTDMatrixName",
327
+ "language": "python"
328
+ },
329
+ {
330
+ "type": "code",
331
+ "text": "uTDMats",
332
+ "language": "python"
333
+ },
334
+ {
335
+ "type": "code",
336
+ "text": "uTDMats[0].worldCam",
337
+ "language": "python"
338
+ },
339
+ {
340
+ "type": "code",
341
+ "text": "uTDMats[0].projInverse",
342
+ "language": "python"
343
+ }
344
+ ]
345
+ },
346
+ {
347
+ "title": "Shader Stages[edit]",
348
+ "level": 2,
349
+ "content": [
350
+ {
351
+ "type": "subsection",
352
+ "title": "Vertex Shader[edit]",
353
+ "level": 3
354
+ },
355
+ {
356
+ "type": "paragraph",
357
+ "text": "Inside a vertex shader you only have access to one vertex, you don't know the positions of other vertices are or what the output of the vertex shader for other vertices will be."
358
+ },
359
+ {
360
+ "type": "paragraph",
361
+ "text": "The input to a vertex shader is all the data about the particular vertex that the program is running on. Data like the vertex position in SOP space, texture coordinate, color, normal are available. These values are called attributes. Attributes are declared in the vertex shader using the in keyword."
362
+ },
363
+ {
364
+ "type": "code",
365
+ "text": "in",
366
+ "language": "python"
367
+ },
368
+ {
369
+ "type": "paragraph",
370
+ "text": "The vertex shader can output many things. The primary things it will output are the vertex position (after being transformed by the world, camera and projection matrix), color, and texture coordinates. It can output any other values as well using output variables declared using out. Outputs from a vertex shader are linearly interpolated across the surface of the primitive the vertex is a part of. For example, if you output a value of 0.2 at 1st vertex and a value of 0.4 at the 2nd vertex on a line, a pixel drawn half-way between these two points will receive a value of 0.3."
371
+ },
372
+ {
373
+ "type": "code",
374
+ "text": "out",
375
+ "language": "python"
376
+ },
377
+ {
378
+ "type": "subsection",
379
+ "title": "Pixel Shader[edit]",
380
+ "level": 3
381
+ },
382
+ {
383
+ "type": "paragraph",
384
+ "text": "The inputs to a pixel shader are all of the outputs from the vertex shader, and any uniforms that are defined. The outputs from the vertex shader will have been linearly interpolated across the polygon that the vertices created. A pixel shader can output two things: Color and Depth. Color is output through the variable declared as layout(location = 0) out vec4 whateverName. Depth is output through a variable declared as out float depthName. You can name these variables whatever you want. You are required to write out a color value, but you do not need to write out depth (in fact it's best if you don't unless absolutely needed). GLSL will automatically output the correct depth value for you if you don't write out a depth value. If you are outputting to multiple color buffer, you declare more color outputs with the location value set to 1, 2, 3, etc., instead of 0."
385
+ },
386
+ {
387
+ "type": "code",
388
+ "text": "layout(location = 0) out vec4 whateverName",
389
+ "language": "python"
390
+ },
391
+ {
392
+ "type": "code",
393
+ "text": "out float depthName",
394
+ "language": "python"
395
+ },
396
+ {
397
+ "type": "code",
398
+ "text": "location",
399
+ "language": "python"
400
+ },
401
+ {
402
+ "type": "subsection",
403
+ "title": "Geometry Shader[edit]",
404
+ "level": 3
405
+ },
406
+ {
407
+ "type": "paragraph",
408
+ "text": "A geometry shader takes a single point primitive points, line or triangle, and outputs set of points, line strips, or triangle strips. Currently in TouchDesigner the input primitive types you must use to match with what we are rendering is one of:"
409
+ },
410
+ {
411
+ "type": "code",
412
+ "text": "layout(points) in;\n layout(lines_adjacency) in;\n layout(triangles) in;",
413
+ "language": "python"
414
+ },
415
+ {
416
+ "type": "paragraph",
417
+ "text": "Other input types such as lines or triangles_adjacency is not currently supported."
418
+ },
419
+ {
420
+ "type": "code",
421
+ "text": "lines",
422
+ "language": "python"
423
+ },
424
+ {
425
+ "type": "code",
426
+ "text": "triangles_adjacency",
427
+ "language": "python"
428
+ },
429
+ {
430
+ "type": "paragraph",
431
+ "text": "Note - In the 2018.20000 series of builds lines were supported and lines_adjacency were not, so the change to the 2019.10000 that switched the support to lines_adjacency unfortunetely breaks existing geometry shaders."
432
+ },
433
+ {
434
+ "type": "code",
435
+ "text": "lines",
436
+ "language": "python"
437
+ },
438
+ {
439
+ "type": "code",
440
+ "text": "lines_adjacency",
441
+ "language": "python"
442
+ },
443
+ {
444
+ "type": "code",
445
+ "text": "lines_adjacency",
446
+ "language": "python"
447
+ }
448
+ ]
449
+ },
450
+ {
451
+ "title": "A Basic Shader[edit]",
452
+ "level": 2,
453
+ "content": [
454
+ {
455
+ "type": "subsection",
456
+ "title": "Vertex Shader[edit]",
457
+ "level": 3
458
+ },
459
+ {
460
+ "type": "paragraph",
461
+ "text": "This vertex shader will simply transform each vertex correctly and leave it entirely up to the pixel shader to color the pixels:"
462
+ },
463
+ {
464
+ "type": "code",
465
+ "text": "void main()\n{\n\t// P is the position of the current vertex\n\t// TDDeform() will return the deformed P position, in world space.\n\t// Transform it from world space to projection space so it can be rasterized\n\tgl_Position = TDWorldToProj(TDDeform(TDPos()));\n}",
466
+ "language": "python"
467
+ },
468
+ {
469
+ "type": "subsection",
470
+ "title": "Pixel Shader[edit]",
471
+ "level": 3
472
+ },
473
+ {
474
+ "type": "paragraph",
475
+ "text": "This pixel shader simply sets every pixel to red:"
476
+ },
477
+ {
478
+ "type": "code",
479
+ "text": "// We need to declare the name of the output fragment color (this is different from GLSL 1.2 where it was automatically declared as gl_FragColor)\nout vec4 fragColor;\nvoid main()\n{\n\tfragColor = vec4(1, 0, 0, 1);\n}",
480
+ "language": "python"
481
+ }
482
+ ]
483
+ },
484
+ {
485
+ "title": "Working with Geometry Attributes[edit]",
486
+ "level": 2,
487
+ "content": [
488
+ {
489
+ "type": "paragraph",
490
+ "text": "The follow vertex shader attributes (inputs) will always be declared for you to use in your vertex shader. You do not need to declare them yourself."
491
+ },
492
+ {
493
+ "type": "code",
494
+ "text": "vec3 TDPos(); // Vertex position\nvec3 TDNormal(); // normal\nvec3 TDTexCoord(uint coordLayer); // texture coordinate layers",
495
+ "language": "python"
496
+ },
497
+ {
498
+ "type": "paragraph",
499
+ "text": "Other Attributes"
500
+ },
501
+ {
502
+ "type": "paragraph",
503
+ "text": "All other attributes you want to use need to be declared in your shader code. are passed as custom attributes. For forward compatibility with POPs in the future, these attributes should be declared using the 'Attributes' page on the GLSL MAT. The declared attributes can be accessed via a function call to TDAttrib_<attributeName>().\nFor example if you declare a custom attribute called 'life'. You would access it in the shader using TDAttrib_life()."
504
+ },
505
+ {
506
+ "type": "code",
507
+ "text": "TDAttrib_<attributeName>()",
508
+ "language": "python"
509
+ },
510
+ {
511
+ "type": "code",
512
+ "text": "TDAttrib_life()",
513
+ "language": "python"
514
+ },
515
+ {
516
+ "type": "paragraph",
517
+ "text": "For attributes that are larger than 4 values, you should declare them as vec4s with an Array Size larger than 1. If the size isn't a multiple of 4, then the extra values are undefined. For example for the attribute pCapt[6], you would declare it as vec4 with an array size of 2."
518
+ },
519
+ {
520
+ "type": "code",
521
+ "text": "pCapt[6]",
522
+ "language": "python"
523
+ },
524
+ {
525
+ "type": "paragraph",
526
+ "text": "The values TDAttrib_pCapt()[0].x, TDAttrib_pCapt()[0].y, TDAttrib_pCapt()[0].z, TDAttrib_pCapt()[0].w, TDAttrib_pCapt()[1].x and TDAttrib_pCapt()[1].y will have the values from the geometry and TDAttrib_pCapt()[1].z and TDAttrib_pCapt()[1].w will have undefined values."
527
+ },
528
+ {
529
+ "type": "code",
530
+ "text": "TDAttrib_pCapt()[0].x, TDAttrib_pCapt()[0].y, TDAttrib_pCapt()[0].z, TDAttrib_pCapt()[0].w, TDAttrib_pCapt()[1].x",
531
+ "language": "python"
532
+ },
533
+ {
534
+ "type": "code",
535
+ "text": "TDAttrib_pCapt()[1].y",
536
+ "language": "python"
537
+ },
538
+ {
539
+ "type": "code",
540
+ "text": "TDAttrib_pCapt()[1].z",
541
+ "language": "python"
542
+ },
543
+ {
544
+ "type": "code",
545
+ "text": "TDAttrib_pCapt()[1].w",
546
+ "language": "python"
547
+ },
548
+ {
549
+ "type": "paragraph",
550
+ "text": "The attribute pCapt[8] would also be declared using Array Size of 2, since it can fit all of its data in 2 vec4s."
551
+ },
552
+ {
553
+ "type": "code",
554
+ "text": "pCapt[8]",
555
+ "language": "python"
556
+ },
557
+ {
558
+ "type": "paragraph",
559
+ "text": "If your attribute is an integer type, you can use the integer types (ivec2, ivec4) instead."
560
+ },
561
+ {
562
+ "type": "code",
563
+ "text": "ivec2, ivec4",
564
+ "language": "python"
565
+ }
566
+ ]
567
+ },
568
+ {
569
+ "title": "TouchDesigner specific defines[edit]",
570
+ "level": 2,
571
+ "content": [
572
+ {
573
+ "type": "paragraph",
574
+ "text": "Shaders in TouchDesigner are dynamically recompiled based on a few things such as the number and types of lights in the scene or the number of cameras used in this pass (in the case of Multi-Camera Rendering). This is done for optimization purposes since loops with known amounts of iterations are far faster in GLSL. Some defines are provided which allow code written by end-users to be recompiled with different numbers of lights/cameras correct."
575
+ },
576
+ {
577
+ "type": "code",
578
+ "text": "// This define will be defined at compile time, and your shader will be recompiled for each combination\n// of lights in use (if it's is used in multiple light configurations). You can use it for things like a loop\n// counter to loop over all lights in the scene, as you will see if you output example code from the Phong MAT.\n// Environment COMPs are counted separately from regular Light COMPs.\n#define TD_NUM_LIGHTS <defined at compile time>\n#define TD_NUM_ENV_LIGHTS <defined at compile time>",
579
+ "language": "python"
580
+ },
581
+ {
582
+ "type": "code",
583
+ "text": "// On newer hardware multiple cameras can be rendered at the same time. This define will be set to the\n// number of cameras done on this render pass. This may be 1 or more, depending on many factors.\n// Code should be written in a way that should work regardless of what this value is.\n#define TD_NUM_CAMERAS <defined at compiler time>",
584
+ "language": "python"
585
+ },
586
+ {
587
+ "type": "code",
588
+ "text": "// One of these defines will be set depending on which shader stage is being compiled.\n// This allows shaders to use #ifdef <stageName> and #ifndef <stageName> to either include or\n// omit code based on the current shader stage being included. This also allows for single\n// large DATs to contain all the code for all stages, with each portion #ifdef-ed in for\n// each stage.\n#define TD_VERTEX_SHADER\n#define TD_GEOMETRY_SHADER\n#define TD_PIXEL_SHADER\n#define TD_COMPUTE_SHADER",
589
+ "language": "python"
590
+ }
591
+ ]
592
+ },
593
+ {
594
+ "title": "TouchDesigner specific Uniforms[edit]",
595
+ "level": 2,
596
+ "content": [
597
+ {
598
+ "type": "paragraph",
599
+ "text": "These are uniform that TouchDesigner will automatically set for you. You do not need to declare any of these, you can just use them in your shaders."
600
+ },
601
+ {
602
+ "type": "code",
603
+ "text": "// General rendering state info\nstruct TDGeneral {\n vec4 ambientColor; // Ambient light color (sum of all Ambient Light COMPs used)\n vec4 viewport; // viewport info, contains (x, y, 1.0 / w, 1.0 / h). x/y/w/h are in pixel units. \n};\nuniform TDGeneral uTDGeneral;\n// So for example you'd get the ambient color by doing \n// vec4 ambientColor = uTDGeneral.ambientColor;",
604
+ "language": "python"
605
+ },
606
+ {
607
+ "type": "code",
608
+ "text": "// Matrices\nstruct TDMatrix\n{\n\tmat4 world;\t\t\t// world transform matrix, combination of hierarchy of Object COMPs containing the SOP.\n\t\t\t\t\t\t// transforms from SOP space into World Space\n\tmat4 worldInverse;\t// inverse of the world matrix\n\tmat4 worldCam;\t\t// multiplication of the world and the camera matrix. (Cam * World)\n\tmat4 worldCamInverse;\n\tmat4 cam;\t\t\t// camera transform matrix, obtained from the Camera COMP used to render\n\tmat4 camInverse;\n\tmat4 camProj;\t\t// camera transform and the projection matrix from the camera COMP, (Proj * Cam)\n\tmat4 camProjInverse;\n\tmat4 proj;\t\t\t// projection matrix from the Camera COMP. The Z range will be [0,1], Vulkan style.\n\tmat4 projInverse;\n\tmat4 worldCamProj;\t// multiplication of the world, camera and projection matrices. (Proj * Cam * World)\n\t\t\t\t\t\t// takes a vertex in SOP space and puts it into projection space\n\tmat4 worldCamProjInverse;\n\tmat3 worldForNormals;\t// Inverse transpose of the world matrix, use this to transform normals\n\t\t\t\t\t\t\t// from SOP space into world space\n\tmat3 camForNormals;\t\t// Inverse transpose of the camera matrix, use this to transform normals\n\t\t\t\t\t\t\t// from world space into camera space\n\tmat3 worldCamForNormals;\t// Inverse transpose of the worldCam matrix, use this to transform normals\n\t\t\t\t\t\t\t\t// from SOP space into camera space inverse(transpose(Cam * World))\n\t \n};\nuniform TDMatrix uTDMats[TD_NUM_CAMERAS];\n// For example you'd transform the vertex in SOP space into camera space with this line of code\n// vec4 camSpaceVert = uTDMats[TDCameraIndex()].worldCam * vec4(TDPos(), 1.0);",
609
+ "language": "python"
610
+ },
611
+ {
612
+ "type": "code",
613
+ "text": "struct TDCameraInfo\n{\n\tvec4 nearFar;\t\t\t// near/far plane info, contains (near, far, far - near, 1.0 / (far - near))\n\tvec4 fog;\t\t\t\t// fog info, as defined in the Camera COMP\n\t\t\t\t\t\t\t// contains (fogStart, fogEnd, 1.0 / (fogEnd - fogStart), fogDensity)\n\tvec4 fogColor;\t\t\t// Fog Color as defined in the Camera COMP\n\tint renderTOPCameraIndex;\t// Says which camera from the Render TOP's 'Cameras' parameter this particular camera is.\n};\nuniform TDCameraInfo uTDCamInfos[TD_NUM_CAMERAS];",
614
+ "language": "python"
615
+ },
616
+ {
617
+ "type": "paragraph",
618
+ "text": "In general you don't need to do anything with any of these light uniforms/samplers, as it's all done for you in the TDLighting(), TDLightingPBR() and, TDEnvLightingPBR() functions. Only if you are doing custom lighting will you need to worry about these."
619
+ },
620
+ {
621
+ "type": "code",
622
+ "text": "TDLighting(), TDLightingPBR() and, TDEnvLightingPBR()",
623
+ "language": "python"
624
+ },
625
+ {
626
+ "type": "code",
627
+ "text": "struct TDLight\n{\n\tvec4 position;\t\t// the light's position in world space\n\tvec3 direction;\t\t// the light's direction in world space\n\tvec3 diffuse;\t\t// the light's diffuse color\n\tvec4 nearFar;\t\t// the near and far settings from the light's View page\n\t\t\t\t\t\t// contains (near, far, far - near, 1.0 / (far - near)\n\tvec4 lightSize;\t\t// values from the light's Light Size parameter\n\t\t\t\t\t\t// containers (light width, light height, light width / light projection width, light height / light projection height)\n\tvec4 misc;\t\t\t// misc parameters values, right now it contains\n\t\t\t\t\t\t// (Max shadow softness, 0, 0, 0)\n\tvec4 coneLookupScaleBias;\t// applied to a cone light's contribution to create the spot lit area\n\t\t\t\t\t\t\t\t// contains (coneLookupScale, coneLookupBias, 1.0, 0.0).\n // If the light is not a cone light, this will contain (0.0, 0.0, 0.0, 0.0).\n\tvec4 attenScaleBiasRoll;\t// applied to the light's distance from the point to get an attenuation value\n\t\t\t\t\t\t\t\t// contains (attenuation scale, attenuation bias, attenuation rolloff, 0)\n\tmat4 shadowMapMatrix;\t\t// transforms a point in world space into the projection space of the shadow mapped light\n\t\t\t\t\t\t\t\t// also rescales projection space from [-1, 1] to [0, 1], so the value can be used\n\t\t\t\t\t\t\t\t// to lookup into a shadow map\n\tmat4 shadowMapCamMatrix;\t// transforms a point in world space into the camera space of the shadow mapped light\n\tvec4 shadowMapRes;\t\t\t// the resolution of the shadow map associated with this light\n\t\t\t\t\t\t\t\t// contains (1.0 / width, 1.0 / height, width, height)\n\t\t\t\t\t\t\t\t// filled with 0s if the light isn't shadow mapped\n\tmat4 projMapMatrix;\t\t\t// transforms a point in world space into the projection map space of the light\n\t\t\t\t\t\t\t\t// used when using textureProj() function for projection mapping\n} \nuniform TDLight uTDLights[TD_NUM_LIGHTS];",
628
+ "language": "python"
629
+ },
630
+ {
631
+ "type": "code",
632
+ "text": "struct TDEnvLight\n{\n\tvec3 color;\t\t\t\t\t// Color of the env light (not counting it's environment map)\n\tmat3 rotate;\t\t\t\t// Rotation to be applied to the env light.\n};\nuniform TDEnvLight uTDEnvLights[TD_NUM_ENV_LIGHTS];",
633
+ "language": "python"
634
+ },
635
+ {
636
+ "type": "code",
637
+ "text": "// This one is held differently since it's backed by a storage buffer object and not a uniform buffer object.\nbuffer TDEnvLightBuffer\n{\n\tvec3 shCoeffs[9]; // Spherical harmonic coefficients calculated from the environment map. Used for diffuse PBR lighting.\n} uTDEnvLightBuffers[TD_ENV_LIGHTS_ARRAY_SIZE];",
638
+ "language": "python"
639
+ },
640
+ {
641
+ "type": "paragraph",
642
+ "text": "When using sampler3D created using a Texture 3D TOP, it can sometimes be useful to know which slice is the 'newest' slice in the array, when using the Texture 3D TOP as a circular cache. The P-coordinate location of where the newest slice will provided by a uniform named the same as your sampler, with the suffix 'POffset'. For example if you have a uniform named sColorMap, you can declare a matching sColorMapPOffset uniform and it will automatically be filled in for you."
643
+ },
644
+ {
645
+ "type": "code",
646
+ "text": "sColorMapPOffset",
647
+ "language": "python"
648
+ },
649
+ {
650
+ "type": "code",
651
+ "text": "uniform float sColorMapPOffset; // P offset to newest slice in sampler3D named sColorMap",
652
+ "language": "python"
653
+ }
654
+ ]
655
+ },
656
+ {
657
+ "title": "TouchDesigner specific Functions[edit]",
658
+ "level": 2,
659
+ "content": [
660
+ {
661
+ "type": "paragraph",
662
+ "text": "Further details about each of these functions are given in the sections following this."
663
+ },
664
+ {
665
+ "type": "subsection",
666
+ "title": "Vertex Shader Only Functions[edit]",
667
+ "level": 3
668
+ },
669
+ {
670
+ "type": "code",
671
+ "text": "// Transforms a point from world space to projection space. \n// These functions should always be used to output to gl_Position, allowing TouchDesigner to do custom manipulations\n// of the values as needed for special operations and projections.\n// The extra manipulations that are currently done are:\n// 1. Conversions to other projections such as FishEye\n// 2. Conversions to Quad Reprojection using TDQuadReproject()\n// 3. Adjustments needed for picking using TDPickAdjust().\n// When using this function you should not call the above functions, since it will do those for you.\n// Both the vec4 and vec3 version of TDWorldToProj() treat the xyz as a point, not a vector.\nvec4 TDWorldToProj(vec4 v);\nvec4 TDWorldToProj(vec3 v);\n\n\n// These ones take an extra 'uv' coordinate, which is used when UV Unwrapping is done in the Render TOP.\n// If the version without the uv is used, then TDInstanceTexCoord(TDUVUnwrapCoord()) will be used to get the texture coord.\nvec4 TDWorldToProj(vec4 v, vec3 uv);\nvec4 TDWorldToProj(vec3 v, vec3 uv);",
672
+ "language": "python"
673
+ },
674
+ {
675
+ "type": "code",
676
+ "text": "// Returns the color for this vertex/point, including handling alpha-premultiplication correctly.\n// This replaces accessing it directly via 'Cd', as was done in the past.\nvec4 TDPointColor();",
677
+ "language": "python"
678
+ },
679
+ {
680
+ "type": "code",
681
+ "text": "// Returns the instance ID for the current instance. This should always be used, not gl_InstanceID directly.\n// For more information look at the Instancing section of this document.\nint TDInstanceID();",
682
+ "language": "python"
683
+ },
684
+ {
685
+ "type": "code",
686
+ "text": "// Returns the index of the camera for this particular vertex, within this batch. Needed to support Multi-Camera Rendering.\n// This is always 0-based, and it does not reflect which camera is being currently being used from the Render TOP.\n// Due to multiple batches being needed for split up larger amounts of cameras, this number resets to be 0 each batch.\n// To get the actual camera index as it's listed in the Render TOP, use the uTDCamInfos[TDCameraIndex()].renderTOPCameraIndex\n// or, in builds 2022.32790 and later TDTrueCameraIndex().\nint TDCameraIndex();",
687
+ "language": "python"
688
+ },
689
+ {
690
+ "type": "code",
691
+ "text": "// Available in builds 2022.32790 and later.\n// Returns the index of the camera as it's listed in the Render TOP.\nint TDTrueCameraIndex();",
692
+ "language": "python"
693
+ },
694
+ {
695
+ "type": "code",
696
+ "text": "// Deforms a point or vector using instancing and skinned deforms. The returned result is in World Space.\n// Be sure to use the *Vec version in the case of vectors to get correct results.\n// Also use the *Norm version when deforming a normal, to make sure it still matches the surface correctly.\n/// These functions will internally call TDSkinnedDeform() and TDInstanceDeform().\nvec4 TDDeform(vec4 pos);\nvec4 TDDeform(vec3 pos);\nvec3 TDDeformVec(vec3 v);\nvec3 TDDeformNorm(vec3 n);",
697
+ "language": "python"
698
+ },
699
+ {
700
+ "type": "code",
701
+ "text": "// These versions allow you to control the instanceID used for the deform.\nvec4 TDDeform(int instanceID, vec3 pos);\nvec3 TDDeformVec(int instanceID, vec3 v);\nvec3 TDDeformNorm(int instanceID, vec3 n);",
702
+ "language": "python"
703
+ },
704
+ {
705
+ "type": "code",
706
+ "text": "// ** In general you don't need to call any of the below functions, just calling TDDeform or TDDeformVec will\n// do all the work for you\n// Just the skinning or instancing portion of the deforms\n// Returned position/vector is in SOP space for the *Skinned* version, and world space for the *Instance* version.\nvec4 TDSkinnedDeform(vec4 pos);\nvec3 TDSkinnedDeformVec(vec3 vec);\nvec4 TDInstanceDeform(vec4 pos);\nvec3 TDInstanceDeformVec(vec3 vec);",
707
+ "language": "python"
708
+ },
709
+ {
710
+ "type": "code",
711
+ "text": "// You also don't need to call these usually, but are available for special cases\n// For instancing functions, if you don't provide an index, it will use TDInstanceID().\nmat4 TDBoneMat(int boneIndex);\nmat4 TDInstanceMat(int instanceID);\nmat4 TDInstanceMat();\n// Returns a 3x3 matrix only. Useful if you are only working with vectors, not positions.\n// If you are using both, it is faster to just call TDInstanceMat(), and cast the result to a mat3\n// when required.\nmat3 TDInstanceMat3(int instanceID);\nmat3 TDInstanceMat3();",
712
+ "language": "python"
713
+ },
714
+ {
715
+ "type": "code",
716
+ "text": "// To calculate the texture coordinates for your instance (if used in the Geometry COMP's parameters), use these functions\n// For texture coordinates the passed in variable 't' is the current texture coordinate to be modified/replaced\nvec3 TDInstanceTexCoord(int instanceID, vec3 t);\nvec3 TDInstanceTexCoord(vec3 t);",
717
+ "language": "python"
718
+ },
719
+ {
720
+ "type": "code",
721
+ "text": "// TDWorldToProj() will already apply the Quad Reproject feature if used by the [[Camera COMP]].\n// However in same cases you may be doing custom operations that require it to be applied manually.\n// This function just returns the point unchanged if Quad Reproject isn't being used.\nvec4 TDQuadReproject(vec4 v, int camIndex);",
722
+ "language": "python"
723
+ },
724
+ {
725
+ "type": "code",
726
+ "text": "// Available in builds 2019.32020 or later.\n// TDWorldToProj() will already apply the Picking adjustment if required (when picking is occuring).\n// However in same cases you may be doing custom operations that require it to be applied manually.\n// This function should be given the position after it's been transformed into projection space.\n// This function just returns the point unchanged if picking isn't active for this render.\nvec4 TDPickAdjust(vec4 v, int camIndex);",
727
+ "language": "python"
728
+ },
729
+ {
730
+ "type": "code",
731
+ "text": "// Returns the uv coordinate that was selected for UV unwrapping in the Render TOP\nvec3 TDUVUnwrapCoord();",
732
+ "language": "python"
733
+ },
734
+ {
735
+ "type": "subsection",
736
+ "title": "Geometry Shader Only Functions[edit]",
737
+ "level": 3
738
+ },
739
+ {
740
+ "type": "code",
741
+ "text": "// Similar to th ones in the vertex shader, but require a camera index since it\n// needs to be passed through to the geometry shader via a input variable.\nvec4 TDWorldToProj(vec4 v, vec3 uv, int cameraIndex);\\n\";\nvec4 TDWorldToProj(vec3 v, vec3 uv, int cameraIndex);\\n\";\nvec4 TDWorldToProj(vec4 v, int cameraIndex);\\n\";\nvec4 TDWorldToProj(vec3 v, int cameraIndex);\\n\";\nvec4 TDQuadReproject(vec4 v, int camIndex);",
742
+ "language": "python"
743
+ },
744
+ {
745
+ "type": "subsection",
746
+ "title": "Pixel Shader Only Functions[edit]",
747
+ "level": 3
748
+ },
749
+ {
750
+ "type": "code",
751
+ "text": "// This function is provided as a wrapper for gl_FrontFacing.\n// It is required since some GPUs (Intel on macOS mainly) have broken\n// functionality for gl_FrontFacing.\n// On most GPUs this just returns gl_FrontFacing. On GPUs where the behavior\n// is broken, an alternative method using position and normal is used to \n// determine if the pixel is front or back facing.\n// Position and normal should be in the same space, and normal must be normalized.\nbool TDFrontFacing(vec3 position, vec3 normal);",
752
+ "language": "python"
753
+ },
754
+ {
755
+ "type": "code",
756
+ "text": "// Call this function to give TouchDesigner a chance to discard some pixels if appropriate.\n// This is used in things such as order-indepdendent transparency and dual-paraboloid rendering.\n// For best performance call it at the start of the pixel shader.\n// It will do nothing if no features that require it are active, so it's safe to always call it.\nvoid TDCheckDiscard();",
757
+ "language": "python"
758
+ },
759
+ {
760
+ "type": "code",
761
+ "text": "// Obtain the texture coordinate for point sprite primitives.\n// This must be used instead of gl_PointCoord, otherwise the coordinates may be flipped vertically\n// in some cases.\nvec2 TDPointCoord();",
762
+ "language": "python"
763
+ },
764
+ {
765
+ "type": "code",
766
+ "text": "// Obtain the modified color for this pixel. Pass in the interpolated point color from the vertex shader.\n// This function usually just returns back the passed argument, but when doing Geo Text COMP rendering,\n// it is needed to create the text glyphs.\nvec4 TDPixelColor(vec4 c);",
767
+ "language": "python"
768
+ },
769
+ {
770
+ "type": "code",
771
+ "text": "// Call this function to apply the alpha test to the current pixel. This function will do nothing\n// if the alpha test is disabled, so it can be safely always called\nvoid TDAlphaTest(float alphaValue);",
772
+ "language": "python"
773
+ },
774
+ {
775
+ "type": "code",
776
+ "text": "// Call this to apply the Camera COMPs fog to the passed color. Requires the world space vertex position also\n// This function will do nothing if fog is disabled, so it's safe to always call it at the end of your shader\n// there would be no performance impact from calling it if fog is disabled\n// the cameraIndex should be passed through from the vertex shader using a varying, sourced from TDCameraIndex()\nvec4 TDFog(vec4 curColor, vec3 worldSpacePos, int cameraIndex);",
777
+ "language": "python"
778
+ },
779
+ {
780
+ "type": "code",
781
+ "text": "// Call this at the end of your shadow to apply a dither to your final color. This function does nothing\n// if dithering is disabled in the Render TOPs parameters\nvec4 TDDither(vec4 curColor);",
782
+ "language": "python"
783
+ },
784
+ {
785
+ "type": "code",
786
+ "text": "// Pass any color value through this function before writing it out to a color buffer.\n// This is needed to ensure that color channels are output to the correct channels\n// in the color buffer, based on hardware limitation that may store alpha-only\n// textures as red-only internally, for example\nvec4 TDOutputSwizzle(vec4 curColor);",
787
+ "language": "python"
788
+ },
789
+ {
790
+ "type": "paragraph",
791
+ "text": "The TDLighting() functions are called per light to determine that light's diffuse and specular contributions.\nShadowing, projection mapping are all automatically handled for you inside this functions."
792
+ },
793
+ {
794
+ "type": "unordered-list",
795
+ "items": [
796
+ "The TDPBRResult or TDPhongResult return structure will be filled with the results.",
797
+ "lightIndex is the light index to calculate",
798
+ "worldSpacePos is the world space vertex position",
799
+ "shadowStrength is a scalar on the shadow to increase or decrease its effect for example a value of 0.5 would give a maximum 50% shadow.",
800
+ "worldSpaceNorm is the normalized world space normal",
801
+ "vertToCamVec is the normalized vector from the vertex position to the camera position.",
802
+ "shininess is the specular shininess exponent."
803
+ ]
804
+ },
805
+ {
806
+ "type": "code",
807
+ "text": "TDPBRResult or TDPhongResult",
808
+ "language": "python"
809
+ },
810
+ {
811
+ "type": "code",
812
+ "text": "lightIndex",
813
+ "language": "python"
814
+ },
815
+ {
816
+ "type": "code",
817
+ "text": "worldSpacePos",
818
+ "language": "python"
819
+ },
820
+ {
821
+ "type": "code",
822
+ "text": "shadowStrength",
823
+ "language": "python"
824
+ },
825
+ {
826
+ "type": "code",
827
+ "text": "worldSpaceNorm",
828
+ "language": "python"
829
+ },
830
+ {
831
+ "type": "code",
832
+ "text": "vertToCamVec",
833
+ "language": "python"
834
+ },
835
+ {
836
+ "type": "code",
837
+ "text": "shininess",
838
+ "language": "python"
839
+ },
840
+ {
841
+ "type": "subsection",
842
+ "title": "Physically Based (PBR) Lighting[edit]",
843
+ "level": 4
844
+ },
845
+ {
846
+ "type": "code",
847
+ "text": "// Will be filled with the results of the lighting calculations\nstruct TDPBRResult\n{\n\tvec3 diffuse;\n\tvec3 specular;\n // Contains how much the pixel is inside a shadow for this light. 0 means no shadow, 1 means fully shadowed.\n\tfloat shadowStrength;\n};",
848
+ "language": "python"
849
+ },
850
+ {
851
+ "type": "code",
852
+ "text": "// For all regular lights. Should be called in a loop from 0 to TD_NUM_LIGHTS\nTDPBRResult TDLightingPBR(\n\tint lightIndex,\n\tvec3 diffuseColor,\n\tvec3 specularColor,\n\tvec3 worldSpacePos,\n\tvec3 worldSpaceNormal,\n\tfloat shadowStrength,\n\tvec3 shadowColor,\n\tvec3 vertToCamVec,\n\tfloat roughness);",
853
+ "language": "python"
854
+ },
855
+ {
856
+ "type": "code",
857
+ "text": "// For environment lights. Should be called in a loop from 0 to TD_NUM_ENV_LIGHTS\nTDPBRResult TDEnvLightingPBR(\n\tinout vec3 diffuseContrib,\n\tinout vec3 specularContrib,\n\tint lightIndex,\n\tvec3 diffuseColor,\n\tvec3 specularColor,\n\tvec3 worldSpaceNormal,\n\tvec3 vertToCamVec,\n\tfloat roughness,\n\tfloat ambientOcclusion);",
858
+ "language": "python"
859
+ },
860
+ {
861
+ "type": "subsection",
862
+ "title": "Phong Lighting[edit]",
863
+ "level": 4
864
+ },
865
+ {
866
+ "type": "code",
867
+ "text": "// Will be filled with the results of the lighting calculations\nstruct TDPhongResult\n{\n\tvec3 diffuse;\n\tvec3 specular;\n\tvec3 specular2;\n\t// Contains how much the pixel is inside a shadow for this light. 0 means no shadow, 1 means fully shadowed.\n\tfloat shadowStrength;\n};",
868
+ "language": "python"
869
+ },
870
+ {
871
+ "type": "code",
872
+ "text": "TDPhongResult TDLighting(\n\tint lightIndex,\n\tvec3 worldSpacePos,\n\tvec3 worldSpaceNorm,\n\tfloat shadowStrength,\n\tvec3 shadowColor,\n\tvec3 vertToCamVec,\n\tfloat shininess,\n\tfloat shininess2\n);",
873
+ "language": "python"
874
+ },
875
+ {
876
+ "type": "subsection",
877
+ "title": "Common Lighting Functions[edit]",
878
+ "level": 4
879
+ },
880
+ {
881
+ "type": "code",
882
+ "text": "// In general you don't need to use these functions, they are called for you in the TDLighting() functions.\n// These functions return the shadow strength at the current pixel for light at the given index.\n// Also requires the world space vertex position to do its calculations\n// returns undefined results if the shadow isn't mapped using the chosen shadow type\n// The returned value is 0 for no shadow, 1 for 100% shadowed\n// Due to percentage closer filtering, hard shadows can still have values between 0 and 1 at the edges of the shadow\nfloat TDHardShadow(int lightIndex, vec3 worldSpacePos);\n// This one will apply soft shadows with both 25 search steps done, and 25 filter samples.\nfloat TDSoftShadow(int lightIndex, vec3 worldSpacePos);\n// Allows for control of search steps and filter samples.\nfloat TDSoftShadow(int lightIndex, vec3 worldSpacePos, int samples, int searchSteps);",
883
+ "language": "python"
884
+ },
885
+ {
886
+ "type": "code",
887
+ "text": "// Gets the projection map color for the given world space vertex position.\n// No other lighting calculations are applied to the returned color\n// If the given light index is not using a projection map, then 'defaultColor' is returned.\nvec4 TDProjMap(int lightIndex, vec3 worldSpacePosition, vec4 defaultColor);",
888
+ "language": "python"
889
+ },
890
+ {
891
+ "type": "code",
892
+ "text": "// Directly access environment maps for the env lights. Will be black for lights that don't have a map\n// of that particular dimensionality.\n// For the 2D map based env lights.\nvec4 TDEnvLightTextureLod(int lightIndex, vec2 coord, float mipLevel);\n// For the Cube map based env lights.\nvec4 TDEnvLightTextureLod(int lightIndex, vec3 coord, float mipLevel);",
893
+ "language": "python"
894
+ },
895
+ {
896
+ "type": "code",
897
+ "text": "// For directly accessing the shadow maps. All of these access the same maps (per index), but are setup in compare or sampling mode.\n// A returned value of 1 means it's fully in the shadow, 0 means it's not in the shadow.\n// For lights indices that aren't generating shadows, these functions will return 0.\n// These two first one is used in the function texture(sampler2DShadow, vec3) or textureProj(sampler2DShadow, vec4)\n// for automatic depth comparison and hardware percentage closer filtering.\nfloat TDCompareShadowTexture(int lightIndex, vec2 coord, float depth);\nfloat TDCompareShadowTextureProj(int lightIndex, vec4 coord);\n\n// These ones is used for directly getting the depth from the shadow map using\n// texture(sampler2D, vec2) or textureProj(sampler2D, vec3).\n// If using hard shadows the values are in [0, 1] post-projection depth units.\n// If using soft shadows the values are in camera space of the light (not the camera being rendered from).\nfloat TDShadowTexture(int lightIndex, vec2 coord);\nfloat TDShadowTextureProj(int lightIndex, vec3 coord);",
898
+ "language": "python"
899
+ },
900
+ {
901
+ "type": "code",
902
+ "text": "// The projection maps defined in the Projection Map parameter of the Light COMP.\n// The map will return black if the light doesn't have a projection map defined.\nvec4 TDProjTexture(int lightIndex, vec2 coord, float mipMapBias);\n// Samples the texture using the same rules as textureProj().\nvec4 TDProjTextureProj(int lightIndex, vec3 coord);",
903
+ "language": "python"
904
+ },
905
+ {
906
+ "type": "code",
907
+ "text": "// The falloff ramp from when the cone light starts to fade out until it reaches black.\n// Used in combination with uTDLights[].coneLookupScaleBias.\n// Will return 1.0 when the light is not a cone light.\nfloat TDConeLookup(int lightIndex, float coord);",
908
+ "language": "python"
909
+ },
910
+ {
911
+ "type": "subsection",
912
+ "title": "Common Functions[edit]",
913
+ "level": 3
914
+ },
915
+ {
916
+ "type": "paragraph",
917
+ "text": "Available in all shader stages."
918
+ },
919
+ {
920
+ "type": "subsection",
921
+ "title": "General functions[edit]",
922
+ "level": 4
923
+ },
924
+ {
925
+ "type": "code",
926
+ "text": "// A function that gives a half-sine ramp from 0 to 1.\n// Sampling it with a coordinate outside the (0, 1) range will return 0 for anything below 0 and 1 for anything above 1.\n// It's possibly faster than using the GLSL sin() function, depending on the hardware.\nfloat TDSineLookup(float coord);",
927
+ "language": "python"
928
+ },
929
+ {
930
+ "type": "subsection",
931
+ "title": "Matrix functions[edit]",
932
+ "level": 4
933
+ },
934
+ {
935
+ "type": "code",
936
+ "text": "// Creates a translation matrix for the given 3 translation values.\nmat4 TDTranslate(float x, float y, float z);\n\n// Creates a rotation matrix that rotates around the +X, +Y and +Z axis repectively.\nmat3 TDRotateX(float radians);\nmat3 TDRotateY(float radians);\nmat3 TDRotateZ(float radians);\n\n// Creates a rotation matrix that rotates around the 'axis', the given number of 'radians'\n// The 'axis' vector must already be normalized before being passed to this function.\nmat3 TDRotateOnAxis(float radians, vec3 axis);\n\n// Creates a scale matrix for the given 3 scale values.\nmat3 TDScale(float x, float y, float z);\n\n// Creates a rotation matrix that rotates starting from looking down +Z, to the 'forward' vector direction.\n// The 'forward' and 'up' vectors passed to this function do not need to be normalized.\nmat3 TDRotateToVector(vec3 forward, vec3 up);\n\n// Creates a rotation matrix to rotate from vector 'from' to vector 'to'. The solution isn't particularly stable, but useful in some cases.\n// The 'from' and 'to' vectors must already be normalized before being passed to this function.\nmat3 TDCreateRotMatrix(vec3 from, vec3 to);",
937
+ "language": "python"
938
+ },
939
+ {
940
+ "type": "code",
941
+ "text": "// Takes a surface normal, the tangent to the surface, and a handedness value (either -1 or 1)\n// Returns a matrix that will convert vectors from tangent space, to the space the normal and tangent are in\n// Both the normal and the tangent must be normalized before this function is called.\n// The w coordinate of the T attribute created by the [[Attribute Create SOP]] contains the handedness\n// that should be passed in as-is.\nmat3 TDCreateTBNMatrix(vec3 normal, vec3 tangent, float handedness);",
942
+ "language": "python"
943
+ },
944
+ {
945
+ "type": "subsection",
946
+ "title": "Perlin and Simplex noise functions[edit]",
947
+ "level": 4
948
+ },
949
+ {
950
+ "type": "code",
951
+ "text": "// Noise functions\n// These will return the same result for the same input\n// Results are between -1 and 1\n// Can be slow so just be aware when using them. \n// Different dimensionality selected by passing vec2, vec3 or vec4. \nfloat TDPerlinNoise(vec2 v);\nfloat TDPerlinNoise(vec3 v);\nfloat TDPerlinNoise(vec4 v);\nfloat TDSimplexNoise(vec2 v);\nfloat TDSimplexNoise(vec3 v);\nfloat TDSimplexNoise(vec4 v);",
952
+ "language": "python"
953
+ },
954
+ {
955
+ "type": "subsection",
956
+ "title": "HSV Conversion[edit]",
957
+ "level": 4
958
+ },
959
+ {
960
+ "type": "code",
961
+ "text": "// Converts between RGB and HSV color space\nvec3 TDHSVToRGB(vec3 c);\nvec3 TDRGBToHSV(vec3 c);",
962
+ "language": "python"
963
+ },
964
+ {
965
+ "type": "subsection",
966
+ "title": "Projection Conversions[edit]",
967
+ "level": 4
968
+ },
969
+ {
970
+ "type": "code",
971
+ "text": "// Converts a 0-1 equirectangular texture coordinate into cubemap coordinates.\n// A 0 for the U coordinate corresponds to the middle of the +X face. So along the vec3(1, Y, 0) plane.\n// As U rises, equirectangular coordinates rotate from +X, to +Z, then -X and -Z.\nvec3 TDEquirectangularToCubeMap(vec2 equiCoord);",
972
+ "language": "python"
973
+ },
974
+ {
975
+ "type": "code",
976
+ "text": "// Converts from cubemap coordinates to equirectangular\n// cubemapCoord MUST be normalized before calling this function.\nvec2 TDCubeMapToEquirectangular(vec3 cubemapCoord);\n\n// Available in builds 2019.18140\n// This version will also output a mipmap bias float. This float should be passed in the 'bias'\n// parameter of texture(), to help select the mipmap level. This helps avoids seams at the edge\n// of equirectangular map.\nvec2 TDCubeMapToEquirectangular(vec3 cubemapCoord, out float mipMapBias);",
977
+ "language": "python"
978
+ }
979
+ ]
980
+ },
981
+ {
982
+ "title": "Working with Lights[edit]",
983
+ "level": 2,
984
+ "content": [
985
+ {
986
+ "type": "paragraph",
987
+ "text": "To help shaders be as fast as possible, a lot of the logic to calculate lights is hard-coded into the shader depending on what features are enabled and what the light type is. Shaders written for the GLSL MAT will be recompiled with different implementation of TDLightingPBR(), TDLighting() etc depending on the number and types of lights in the scene. This allows the same GLSL MAT to be used in multiple different scenes without needing to be changed based on the number of lights in the scene. These compilations are cached, so each permutation of lighting settings will only cause one compilation to occur, each time TD is run."
988
+ },
989
+ {
990
+ "type": "paragraph",
991
+ "text": "TIP: Geometry viewers have built-in lighting separate from your scene's lighting objects. For information on how to duplicate that lighting, see the Geometry Viewer article."
992
+ },
993
+ {
994
+ "type": "subsection",
995
+ "title": "Custom work with lights[edit]",
996
+ "level": 3
997
+ },
998
+ {
999
+ "type": "paragraph",
1000
+ "text": "If you decide to do custom lighting work, this section describes how a lot of the light values are used in our shader."
1001
+ },
1002
+ {
1003
+ "type": "subsection",
1004
+ "title": "Knowing which variables correspond to which Light COMPs[edit]",
1005
+ "level": 4
1006
+ },
1007
+ {
1008
+ "type": "paragraph",
1009
+ "text": "The variables will be indexed to differentiate the lights, starting at 0. Light 0 will be the first light listed in the Render TOP, Light 1 will be the 2nd light listed and so on. In the event that lights are selected using a wildcard such as light*, the lights gathered from this wildcard will be sorted alpha-numerically."
1010
+ },
1011
+ {
1012
+ "type": "paragraph",
1013
+ "text": "For example, say the Render TOP has \"/light3 /container1/light* /alight1\" listed in its Light parameter, and /container1/ has two light COMPs, named light1 and light2. In this case the lights would correspond to the following indices: \n/light3 would be index 0 \n/container1/light1 would be index 1 \n/container1/light2 would be index 2 \n/alight1 would be index 3"
1014
+ },
1015
+ {
1016
+ "type": "subsection",
1017
+ "title": "Light Parameters[edit]",
1018
+ "level": 4
1019
+ },
1020
+ {
1021
+ "type": "paragraph",
1022
+ "text": "All of the parameters for the lights are defined in the uTDLights structure, defined here."
1023
+ },
1024
+ {
1025
+ "type": "subsection",
1026
+ "title": "Cone Lighting Technique[edit]",
1027
+ "level": 4
1028
+ },
1029
+ {
1030
+ "type": "paragraph",
1031
+ "text": "TouchDesigner's built-in shaders use a custom cone-lighting technique that you can mimic in your shader. The intensity of the cone light is pre-computed into a 1D texture (a lookup table) to reduce the workload in the shader. The start of the 1D texture (texture coordinate 0.0) is the intensity of the light at the edge of the cone angle (the first pixel is always 0). The end of the 1D texture (texture coordinate 1.0) is the intensity of the light at the center of the cone. This lookup table is accessed via:"
1032
+ },
1033
+ {
1034
+ "type": "code",
1035
+ "text": "float TDConeLookup(int lightIndex, float coord);",
1036
+ "language": "python"
1037
+ },
1038
+ {
1039
+ "type": "paragraph",
1040
+ "text": "A second helper uniform is also given to the shader to make looking up in the 1D texture easier:"
1041
+ },
1042
+ {
1043
+ "type": "code",
1044
+ "text": "uTDLights[i].coneLookupScaleBias;",
1045
+ "language": "python"
1046
+ },
1047
+ {
1048
+ "type": "paragraph",
1049
+ "text": "To correctly look into this lookup table the following algorithm should be used:"
1050
+ },
1051
+ {
1052
+ "type": "code",
1053
+ "text": "// 'spot' is the spot vector\n// 'lightV' is the vector coming from the light position, pointing towards\n// the point on the geometry we are shading.\n// It doesn't matter which space these vectors are in (camera space, object space), \n// as long as they are both in the same space.\n// Determine the cosine of the angle between the two vectors, will be between [-1, 1]\nfloat spotEffect = dot(spot, lightV);\n// Now rescale the value using the special helper uniform so that value is between [0,1]\n// A value of 0 will mean the angle between the two vectors is the same as the total \n// cone angle + cone delta of the light\nspotEffect = (spotEffect * uTDLights[i].coneLookupScaleBias.x) + uTDLights[i].coneLookupScaleBias.y;\n// Finally lookup into the lookup table\nfloat dimmer = TDConeLookup(i, spotEffect);\n// You can now multiply the strength of the light by 'dimmer' to create the correct\n// light intensity based on this pixels position in or outside the cone light's area of\n// influence",
1054
+ "language": "python"
1055
+ },
1056
+ {
1057
+ "type": "subsection",
1058
+ "title": "Attenuation[edit]",
1059
+ "level": 4
1060
+ },
1061
+ {
1062
+ "type": "paragraph",
1063
+ "text": "Attenuation is handled for you in the TDLighting() function, but if you want to add it yourself this section describes how."
1064
+ },
1065
+ {
1066
+ "type": "paragraph",
1067
+ "text": "To determine the attenuation from the light to a point in space, use this function. lightDist is the distance from the vertex to the light."
1068
+ },
1069
+ {
1070
+ "type": "code",
1071
+ "text": "lightDist",
1072
+ "language": "python"
1073
+ },
1074
+ {
1075
+ "type": "code",
1076
+ "text": "// Will return 1 if there is no attenuation, 0 if the light is fully attenuated, and something in between if it's in the fade-off region.\nfloat TDAttenuateLight(int lightIndex, float lightDist);",
1077
+ "language": "python"
1078
+ },
1079
+ {
1080
+ "type": "paragraph",
1081
+ "text": "The math behind TDAttenutateLight is as follows:"
1082
+ },
1083
+ {
1084
+ "type": "paragraph",
1085
+ "text": "TouchDesigner's built-in shaders use a custom attenuation technique. Like the cone lighting, a pre-calculated scale and bias is provided for you that will allow you to get the correct attenuated intensity of the light. The uniform is:"
1086
+ },
1087
+ {
1088
+ "type": "code",
1089
+ "text": "uTDLights[i].attenScaleBiasRoll // Contains (1 / -(attenEnd - attenStart), attenEnd / (attenEnd - attenStart), attenRolloff)",
1090
+ "language": "python"
1091
+ },
1092
+ {
1093
+ "type": "paragraph",
1094
+ "text": "TDAttenutateLight is defined as:"
1095
+ },
1096
+ {
1097
+ "type": "code",
1098
+ "text": "float TDAttenuateLight(int lightIndex, float lightDist)\n{\n float lightAtten = lightDist * uTDLights[lightIndex].attenScaleBiasRoll.x;\n lightAtten += uTDLights[lightIndex].attenScaleBiasRoll.y;\n lightAtten = clamp(lightAtten, 0.0, 1.0) * 1.57073963\n lightAtten = sin(lightAtten);\n lightAtten = pow(lightAtten, uTDLights[lightIndex].attenScaleBiasRoll.z);\n return lightAtten;\n}",
1099
+ "language": "python"
1100
+ },
1101
+ {
1102
+ "type": "subsection",
1103
+ "title": "Projection and Shadow Mapping[edit]",
1104
+ "level": 4
1105
+ },
1106
+ {
1107
+ "type": "paragraph",
1108
+ "text": "Projection mapping and shadowing mapping are handled for you in the TDLighting() functions, but you can do it yourself if you want using the below information."
1109
+ },
1110
+ {
1111
+ "type": "paragraph",
1112
+ "text": "Projection and Shadow mapping are very similar operations. The only difference is a projection map will be used to color the surface, while a shadow map will be used to decide if that surface receives lighting from a certain light."
1113
+ },
1114
+ {
1115
+ "type": "paragraph",
1116
+ "text": "Use the TDProjMap() function, which will give you back the projection map color, including handling different projection types."
1117
+ },
1118
+ {
1119
+ "type": "code",
1120
+ "text": "TDProjMap()",
1121
+ "language": "python"
1122
+ },
1123
+ {
1124
+ "type": "paragraph",
1125
+ "text": "Use TDHardShadow() or TDSoftShadow() to manually get the shadow value."
1126
+ },
1127
+ {
1128
+ "type": "code",
1129
+ "text": "TDHardShadow()",
1130
+ "language": "python"
1131
+ },
1132
+ {
1133
+ "type": "code",
1134
+ "text": "TDSoftShadow()",
1135
+ "language": "python"
1136
+ }
1137
+ ]
1138
+ },
1139
+ {
1140
+ "title": "Multiple Render Targets[edit]",
1141
+ "level": 2,
1142
+ "content": [
1143
+ {
1144
+ "type": "paragraph",
1145
+ "text": "Using the '# Of Color Buffers' parameter in the Render TOP along with the Render Select TOP, you can write GLSL shaders that output multiple color values per pixel. This is done by declaring and writing to pixel shader outputs declare like this:"
1146
+ },
1147
+ {
1148
+ "type": "code",
1149
+ "text": "layout(location = 0) vec4 fragColor[TD_NUM_COLOR_BUFFERS];",
1150
+ "language": "python"
1151
+ },
1152
+ {
1153
+ "type": "paragraph",
1154
+ "text": "The constant TD_NUM_COLOR_BUFFERS with automatically be set for you based on the render settings. Ensure you are not writing beyond the number of buffers provided, or corruption/GPU crashes may occur."
1155
+ }
1156
+ ]
1157
+ },
1158
+ {
1159
+ "title": "Multi-Camera Rendering[edit]",
1160
+ "level": 2,
1161
+ "content": [
1162
+ {
1163
+ "type": "paragraph",
1164
+ "text": "Multi-Camera Rendering is rendering multiple cameras in a single rendering pass, all looking at the same scene. This means the scene-graph is only traversed once, which avoids many calls to the graphics driver. Lights, textures, material and draw calls only need to be done once for the entire set of cameras being rendered. This feature is supported by Nvidia Pascal (Geforce 1000, Quadro P-Series) or AMD Polaris (Radeon R9, Radeon Pro WX) and newer GPUs. This feature is important for VR rendering, as well as things such as rendering a Cube Map in a single pass (instead of one pass per side)."
1165
+ },
1166
+ {
1167
+ "type": "paragraph",
1168
+ "text": "Multi-Camera Rendering will not function if the Cameras have different light masks. The cameras will be rendered one pass at a time in that case."
1169
+ },
1170
+ {
1171
+ "type": "paragraph",
1172
+ "text": "This feature is used by the Render TOP when multiple cameras are listed in the 'Cameras' parameter. The 'Multi-Camera Hint' parameter can help control how this feature is used for that particular Render TOP. The results of each camera's render can be obtained using Render Select TOP."
1173
+ },
1174
+ {
1175
+ "type": "paragraph",
1176
+ "text": "Nvidia calls this feature 'Simultaneous Multi-Projection'."
1177
+ },
1178
+ {
1179
+ "type": "paragraph",
1180
+ "text": "The multi-camera functionality on these GPUs is not general and requires some tricks to function properly. Because of this it's important all of your shaders make use of the TD* functions such as TDWorldToProj(), TDInstanceID() instead of doing those things manually and using built-in GLSL functionality. Functions such as TDFog() also require a camera index to be passed to it to apply fog for the correct camera."
1181
+ }
1182
+ ]
1183
+ },
1184
+ {
1185
+ "title": "Image Outputs[edit]",
1186
+ "level": 2,
1187
+ "content": [
1188
+ {
1189
+ "type": "paragraph",
1190
+ "text": "In the Render TOP you can allocate extra image outputs that can be accessed during rendering. These outputs are arbitrarily sized images that can be written and read from at any location (similar to the Compute shader workflow for the GLSL TOP), using imageStore() and imageLoad(). The images will automatically be declared for you inside of the shader, you should not declare them yourself (as you do for other uniforms). This is because there is a lot of extra decoration required for the image uniforms. Currently when compiling in the GLSL MAT itself your code will result in an error, since the images are not available there. However when you apply your MAT to a geometry and render it via the Render TOP, a new version of your shader will be included that has that image declared."
1191
+ },
1192
+ {
1193
+ "type": "code",
1194
+ "text": "imageStore()",
1195
+ "language": "python"
1196
+ },
1197
+ {
1198
+ "type": "code",
1199
+ "text": "imageLoad()",
1200
+ "language": "python"
1201
+ },
1202
+ {
1203
+ "type": "paragraph",
1204
+ "text": "If you set the array size to 0, then the image will not be allocated as an array, so it should not have [] included in it's access. E.g an image named sTestOutput would be written to via:"
1205
+ },
1206
+ {
1207
+ "type": "code",
1208
+ "text": "imageStore(sTestOutput, ivec2(0, 0), vec4(0.0));",
1209
+ "language": "python"
1210
+ },
1211
+ {
1212
+ "type": "paragraph",
1213
+ "text": "If the array size is 1 or more, then instead you'd use []:"
1214
+ },
1215
+ {
1216
+ "type": "code",
1217
+ "text": "imageStore(sTestOutput[0], ivec2(0, 0), vec4(0.0));",
1218
+ "language": "python"
1219
+ }
1220
+ ]
1221
+ },
1222
+ {
1223
+ "title": "Outputting gl_Position[edit]",
1224
+ "level": 2,
1225
+ "content": [
1226
+ {
1227
+ "type": "paragraph",
1228
+ "text": "Although in general you can transform your points/vectors using the built-in model/view and projection matrices at will, when outputting to gl_Position you should use the built-in functions. These functions allow TouchDesigner to do some manipulation of the values for final output, depending on the rendering setup. For example for doing optimized Multi-Camera Rendering, the position will need to be multiplied by the correct camera for this execution of the vertex shader. To give TouchDesigner a chance to do this manipulation, you should call the built-in functions to transform your vertex position:"
1229
+ },
1230
+ {
1231
+ "type": "code",
1232
+ "text": "vec4 TDWorldToProj(vec4 v);\nvec4 TDWorldToProj(vec3 v);",
1233
+ "language": "python"
1234
+ },
1235
+ {
1236
+ "type": "paragraph",
1237
+ "text": "So for example at the end of your shader you would do:"
1238
+ },
1239
+ {
1240
+ "type": "code",
1241
+ "text": "gl_Position = TDWorldToProj(worldSpacePosition);",
1242
+ "language": "python"
1243
+ }
1244
+ ]
1245
+ },
1246
+ {
1247
+ "title": "Specilization Constants[edit]",
1248
+ "level": 2,
1249
+ "content": [
1250
+ {
1251
+ "type": "paragraph",
1252
+ "text": "Specialization Constants are a new feature in Vulkan that allow code to be re-optimized based on integer constant values, without doing a full recompilation of the shader code. These are useful to set the value for rarely changing values such as 'modes' in shader, or selection of particular code paths that are doing via a switch() or if() statement. In the past this may have been done with a #define statement, or a uniform.\nA specialized version of a shader will be cached and re-used, but takes up GPU resources. So they should not be used for constantly changing values, but instead for values that are only changed sometimes, within a limited range of values."
1253
+ },
1254
+ {
1255
+ "type": "code",
1256
+ "text": "#define",
1257
+ "language": "python"
1258
+ },
1259
+ {
1260
+ "type": "code",
1261
+ "text": "uniform",
1262
+ "language": "python"
1263
+ },
1264
+ {
1265
+ "type": "paragraph",
1266
+ "text": "To define a specialization constant, declare a constant with an extra layout() qualifier."
1267
+ },
1268
+ {
1269
+ "type": "code",
1270
+ "text": "layout(constant_id = 0) const int SomeMode = 0;",
1271
+ "language": "python"
1272
+ },
1273
+ {
1274
+ "type": "paragraph",
1275
+ "text": "Then you can use SomeMode just as you would any other variable. If you don't want it to be = 0, you can assign a different value on the 'Constants' page of the GLSL TOP, GLSL MAT etc.\nYou can declare multiple specialization constants, you just need to give each one it's own unique constant_id value (0, 1, 2, etc.)."
1276
+ },
1277
+ {
1278
+ "type": "code",
1279
+ "text": "SomeMode",
1280
+ "language": "python"
1281
+ },
1282
+ {
1283
+ "type": "code",
1284
+ "text": "constant_id",
1285
+ "language": "python"
1286
+ }
1287
+ ]
1288
+ },
1289
+ {
1290
+ "title": "Working with Deforms[edit]",
1291
+ "level": 2,
1292
+ "content": [
1293
+ {
1294
+ "type": "paragraph",
1295
+ "text": "Currently there are two different types deformations that can be applied to geometry: skinned deforms and instanced transforms."
1296
+ },
1297
+ {
1298
+ "type": "paragraph",
1299
+ "text": "TouchDesigner automatically encapsulates all of the work for both of these deforms in the GLSL functions.\nUse the *Vec version when deforming vectors.These functions always return the point/vector in World space, not model/SOP."
1300
+ },
1301
+ {
1302
+ "type": "code",
1303
+ "text": "vec4 TDDeform(vec4 p);\nvec3 TDDeform(vec3 p);\nvec3 TDDeformVec(vec3 v);\nvec3 TDDeformNorm(vec3 v);",
1304
+ "language": "python"
1305
+ },
1306
+ {
1307
+ "type": "paragraph",
1308
+ "text": "As the shader writer, it's your job to manipulate the vertex attributes such as the position and normal (since there's no place for TouchDesigner to do it if you're the one writing the shader), so it's up to you to call the TDDeform() function. In general you will simply call it simply like this:"
1309
+ },
1310
+ {
1311
+ "type": "code",
1312
+ "text": "vec4 worldSpaceVert = TDDeform(vec4(TDPos(), 1.0)); \nvec3 worldSpaceNorm = TDDeformNorm(TDNormal()));",
1313
+ "language": "python"
1314
+ },
1315
+ {
1316
+ "type": "paragraph",
1317
+ "text": "However you can use the below declared functions directly."
1318
+ },
1319
+ {
1320
+ "type": "subsection",
1321
+ "title": "Skinning Deforms (Bone Deforms)[edit]",
1322
+ "level": 3
1323
+ },
1324
+ {
1325
+ "type": "paragraph",
1326
+ "text": "When you enable the Deform feature in the GLSL MAT, TouchDesigner will automatically declare some attributes, varyings, uniforms and functions for you to use to deform your geometry in the same way that other MATs deform geometry. It's important you don't re-use any of these reserved words when using deforms to avoid name conflicts when compiling the shader. Even when not using deforms though, the below listed functions will be declared anyway so shader code will run correctly both when deforms are turned on and off. The functions do nothing when deforms are off (and have no cost to the shader speed). The bone matrices for deforms are built by using the pCaptPath and pCaptData detail attributes along with the the bone's current position based on the skeleton at that frame. The indices in pCapt match up with the array index of the matrices for the bones. More information on how Skinning Deforms work can be found here:\nDeforming Geometry (Skinning)"
1327
+ },
1328
+ {
1329
+ "type": "subsection",
1330
+ "title": "Functions[edit]",
1331
+ "level": 4
1332
+ },
1333
+ {
1334
+ "type": "paragraph",
1335
+ "text": "You generally will not need to call these directly, they are called by the TDDeform() function."
1336
+ },
1337
+ {
1338
+ "type": "code",
1339
+ "text": "TDDeform()",
1340
+ "language": "python"
1341
+ },
1342
+ {
1343
+ "type": "paragraph",
1344
+ "text": "In the vertex shader:"
1345
+ },
1346
+ {
1347
+ "type": "code",
1348
+ "text": "vec4 TDSkinnedDeform(vec4 pos);\nvec3 TDSkinnedDeformVec(vec3 vec);",
1349
+ "language": "python"
1350
+ },
1351
+ {
1352
+ "type": "paragraph",
1353
+ "text": "You can get the bone matrix for the given matrix index with this function:"
1354
+ },
1355
+ {
1356
+ "type": "code",
1357
+ "text": "mat4 TDBoneMat(int boneIndex);",
1358
+ "language": "python"
1359
+ },
1360
+ {
1361
+ "type": "subsection",
1362
+ "title": "Instancing[edit]",
1363
+ "level": 3
1364
+ },
1365
+ {
1366
+ "type": "paragraph",
1367
+ "text": "When you enable instancing on the Instance page of the Geometry COMP the TDDeform() functions will automatically call the correct lower level function that will transform the instance, based on the channels given in the XForm CHOP parameter. If you don't specify a CHOP, then all of the instances will be drawn at the same spot, unless you transform them yourself."
1368
+ },
1369
+ {
1370
+ "type": "subsection",
1371
+ "title": "Instance Index/ID[edit]",
1372
+ "level": 4
1373
+ },
1374
+ {
1375
+ "type": "paragraph",
1376
+ "text": "To calculate the instance ID, use the provided TDInstanceID() function. Do not use gl_InstanceID directly because the number of instances being rendered may be larger than requested due to Multi-Camera Rendering. Shader writers familiar with TouchDesigner088 may also remember the uTDInstanceIDOffset that had to be used, this does not need to be used with TDInstance();"
1377
+ },
1378
+ {
1379
+ "type": "code",
1380
+ "text": "uTDInstanceIDOffset",
1381
+ "language": "python"
1382
+ },
1383
+ {
1384
+ "type": "code",
1385
+ "text": "int TDInstanceID();",
1386
+ "language": "python"
1387
+ },
1388
+ {
1389
+ "type": "paragraph",
1390
+ "text": "Since this function is only available in the vertex shader, you will need to pass it onwards to the pixel shader through an out/in, if you require it in the pixel shader."
1391
+ },
1392
+ {
1393
+ "type": "code",
1394
+ "text": "// In the vertex shader, declare something like this, and assign vInstanceID = TDInstanceID() in the main()\nflat out int vInstanceID;\nvoid main()\n{\n\tvInstanceID = TDInstanceID();\n\t// other main vertex function stuff\n\t// ....\n}",
1395
+ "language": "python"
1396
+ },
1397
+ {
1398
+ "type": "paragraph",
1399
+ "text": "And in the pixel shader you can read this value if it's declared like this:"
1400
+ },
1401
+ {
1402
+ "type": "code",
1403
+ "text": "// Pixel shader\nflat in int vInstanceID;",
1404
+ "language": "python"
1405
+ },
1406
+ {
1407
+ "type": "paragraph",
1408
+ "text": "This is declared as flat since int variable types can not be interpolated across a primitive."
1409
+ },
1410
+ {
1411
+ "type": "code",
1412
+ "text": "flat",
1413
+ "language": "python"
1414
+ },
1415
+ {
1416
+ "type": "code",
1417
+ "text": "int",
1418
+ "language": "python"
1419
+ },
1420
+ {
1421
+ "type": "subsection",
1422
+ "title": "Deform Functions[edit]",
1423
+ "level": 4
1424
+ },
1425
+ {
1426
+ "type": "paragraph",
1427
+ "text": "You generally will not need to call any of these directly, they are called by the TDDeform() function. These functions are only available in the vertex shader."
1428
+ },
1429
+ {
1430
+ "type": "paragraph",
1431
+ "text": "In the vertex shader:"
1432
+ },
1433
+ {
1434
+ "type": "code",
1435
+ "text": "vec4 TDInstanceDeform(vec4 pos);\nvec3 TDInstanceDeformVec(vec3 vec);",
1436
+ "language": "python"
1437
+ },
1438
+ {
1439
+ "type": "paragraph",
1440
+ "text": "For the transform, access these matrices using the functions:"
1441
+ },
1442
+ {
1443
+ "type": "code",
1444
+ "text": "mat4 TDInstanceMat(int instanceIndex);\nmat4 TDInstanceMat();",
1445
+ "language": "python"
1446
+ },
1447
+ {
1448
+ "type": "paragraph",
1449
+ "text": "These matrices will contain the entire transform, including TX, TY, TZ, SX, SY, SZ as well as Rotate To."
1450
+ },
1451
+ {
1452
+ "type": "subsection",
1453
+ "title": "Attribute Functions[edit]",
1454
+ "level": 4
1455
+ },
1456
+ {
1457
+ "type": "paragraph",
1458
+ "text": "When modifying the texture coordinates, these functions do the texture coordinate modifications per instance. t is the texture coordinate to modify. The version without instanceIndex will use the current value for gl_InstanceID automatically."
1459
+ },
1460
+ {
1461
+ "type": "code",
1462
+ "text": "vec3 TDInstanceTexCoord(int instanceIndex, vec3 t);\nvec3 TDInstanceTexCoord(vec3 t);",
1463
+ "language": "python"
1464
+ },
1465
+ {
1466
+ "type": "paragraph",
1467
+ "text": "To modify diffuse color, these functions will replace/add/subtract from the original diffuse color. In general you'll want to pass in the result of TDPointColor() into these functions to have them modify it. If instance color is not in use, this function will just return the passed in color, unmodified."
1468
+ },
1469
+ {
1470
+ "type": "code",
1471
+ "text": "vec4 TDInstanceColor(vec4 curColor);\nvec4 TDInstanceColor(int instanceIndex, vec4 curColor);",
1472
+ "language": "python"
1473
+ },
1474
+ {
1475
+ "type": "paragraph",
1476
+ "text": "Custom instance attributes can be retrieved using these functions:"
1477
+ },
1478
+ {
1479
+ "type": "code",
1480
+ "text": "vec4 TDInstanceCustomAttrib0();\nvec4 TDInstanceCustomAttrib0(int instanceIndex);\nvec4 TDInstanceCustomAttrib1();\nvec4 TDInstanceCustomAttrib1(int instanceIndex);\nvec4 TDInstanceCustomAttrib2();\nvec4 TDInstanceCustomAttrib2(int instanceIndex);\nvec4 TDInstanceCustomAttrib3();\nvec4 TDInstanceCustomAttrib3(int instanceIndex);",
1481
+ "language": "python"
1482
+ },
1483
+ {
1484
+ "type": "subsection",
1485
+ "title": "Instance Texturing[edit]",
1486
+ "level": 4
1487
+ },
1488
+ {
1489
+ "type": "paragraph",
1490
+ "text": "Instance texturing allows mapping larger number of individual textures onto instances. The number of textures available to be used in a single render varies by GPU. The resolution/pixel format of each texture can be different. It avoids needing to use a 2D Texture Array to map multiple images onto instances. Only one type of texture dimension is supported at a time (2D, Cube etc). Access the textures is a two step process. First you need to get the texture index for the current instance you are outputting. This is achieved through TDInstanceTextureIndex(). Then you can use that texture index in a call to TDInstanceTexture() to obtain the sampled texture color at the passed coordinates. There are a few variations of these functions. In the vertex shader there are versions that can implicitly know the current instance index and output using that. In both vertex/pixel shaders there is also versions that allow you to manually specify the instance index via a parameter. You will typically be sampling the texture in the pixel shader, in which case you want to obtain the texture index in the vertex shader, then pass it through to the pixel shader via a flat uint in/out variable."
1491
+ },
1492
+ {
1493
+ "type": "code",
1494
+ "text": "TDInstanceTextureIndex()",
1495
+ "language": "python"
1496
+ },
1497
+ {
1498
+ "type": "code",
1499
+ "text": "TDInstanceTexture()",
1500
+ "language": "python"
1501
+ },
1502
+ {
1503
+ "type": "code",
1504
+ "text": "flat uint",
1505
+ "language": "python"
1506
+ },
1507
+ {
1508
+ "type": "code",
1509
+ "text": "// AVAILABLE IN THE VERTEX SHADER ONLY\n// Implicitly uses the current instance. Returns the texture index for this instance.\nuint TDInstanceTextureIndex();\n// Returns the texture color at the given 'uv', implicitly using the current instance index to determine which texture to sample.\n// You will not usually be using these versions of TDInstanceTexture(), since they are only available in the vertex shader.\nvec4 TDInstanceTexture(vec2 uv);\nvec4 TDInstanceTexture(vec3 uv);",
1510
+ "language": "python"
1511
+ },
1512
+ {
1513
+ "type": "paragraph",
1514
+ "text": "If you require more custom control of which instance texture you which to use, you can use these functions instead:"
1515
+ },
1516
+ {
1517
+ "type": "code",
1518
+ "text": "// AVAILABLE IN ALL SHADER STAAGES\n// Gives to you the textureIndex for the given instanceIndex.\nuint TDInstanceTextureIndex(int instanceIndex);\n// Samples the texture 'texIndex' at the given 'uv'.\nvec4 TDInstanceTexture(uint texIndex, vec3 uv);\nvec4 TDInstanceTexture(uint texIndex, vec2 uv);",
1519
+ "language": "python"
1520
+ },
1521
+ {
1522
+ "type": "paragraph",
1523
+ "text": "The best way to see this code being used in a live example is to output a shader from the Phong MAT that is doing instance texturing."
1524
+ }
1525
+ ]
1526
+ },
1527
+ {
1528
+ "title": "Point Sprites[edit]",
1529
+ "level": 2,
1530
+ "content": [
1531
+ {
1532
+ "type": "paragraph",
1533
+ "text": "Point Sprites must now use vec2 TDPointCoord() instead of gl_PointCoord to obtain the texture coordinates for the sprite. Using gl_PointCoord will result in the texture coordinates being flipped vertically in some cases."
1534
+ },
1535
+ {
1536
+ "type": "code",
1537
+ "text": "vec2 TDPointCoord()",
1538
+ "language": "python"
1539
+ },
1540
+ {
1541
+ "type": "code",
1542
+ "text": "gl_PointCoord",
1543
+ "language": "python"
1544
+ },
1545
+ {
1546
+ "type": "paragraph",
1547
+ "text": "When rendering point sprites primitives you are required to write to the vertex shader output gl_PointSize. This output variable determines how large the point sprite is (in pixels) when it is rendered. If you don't write to the output then your point sizes are undefined."
1548
+ },
1549
+ {
1550
+ "type": "code",
1551
+ "text": "gl_PointSize",
1552
+ "language": "python"
1553
+ },
1554
+ {
1555
+ "type": "paragraph",
1556
+ "text": "Each point sprite will be rendered as a square of pixels gl_PointSize pixels wide. The square of pixels will receive textures coordinates from 0-1 over the entire square in the pixel shader, obtained via TDPointCoord()."
1557
+ },
1558
+ {
1559
+ "type": "code",
1560
+ "text": "gl_PointSize",
1561
+ "language": "python"
1562
+ },
1563
+ {
1564
+ "type": "code",
1565
+ "text": "TDPointCoord()",
1566
+ "language": "python"
1567
+ }
1568
+ ]
1569
+ },
1570
+ {
1571
+ "title": "Order Independent Transparency[edit]",
1572
+ "level": 2,
1573
+ "content": [
1574
+ {
1575
+ "type": "paragraph",
1576
+ "text": "You can make your shader support Order Independent Transparency by simply adding this line at the start of your pixel shader's main() function. If Order Independent Transparency isn't enabled in the Render TOP, then this function will do nothing."
1577
+ },
1578
+ {
1579
+ "type": "code",
1580
+ "text": "TDCheckOrderIndTrans();",
1581
+ "language": "python"
1582
+ }
1583
+ ]
1584
+ },
1585
+ {
1586
+ "title": "Dithering[edit]",
1587
+ "level": 2,
1588
+ "content": [
1589
+ {
1590
+ "type": "paragraph",
1591
+ "text": "If dithering is enabled in the Render TOP, you can have this dithering applied to your color by simply calling:"
1592
+ },
1593
+ {
1594
+ "type": "code",
1595
+ "text": "finalColor = TDDither(finalColor);",
1596
+ "language": "python"
1597
+ },
1598
+ {
1599
+ "type": "paragraph",
1600
+ "text": "You generally want to do this right at the end of the shader, just before you write the value to your output color. If dithering is disabled in the Render TOP this function will still be available (to avoid compiler errors), but it will leave the color unchanged."
1601
+ }
1602
+ ]
1603
+ },
1604
+ {
1605
+ "title": "Picking[edit]",
1606
+ "level": 2,
1607
+ "content": [
1608
+ {
1609
+ "type": "paragraph",
1610
+ "text": "The Render Pick DAT and CHOP do their work with a render operation, so they need to interact with the shader to do their work. If you export a Phong MAT shader you will see the following lines in it"
1611
+ },
1612
+ {
1613
+ "type": "code",
1614
+ "text": "#ifndef TD_PICKING_ACTIVE\n\t// All the typical shader code\n#else\n\tTDWritePickingValues();\n#endif",
1615
+ "language": "python"
1616
+ },
1617
+ {
1618
+ "type": "paragraph",
1619
+ "text": "The key thing that is occurring here is that when picking is occuring, the define TD_PICKING_ACTIVE is set and only the code inside the #else block is executed. The function:"
1620
+ },
1621
+ {
1622
+ "type": "code",
1623
+ "text": "void TDWritePickingValues();",
1624
+ "language": "python"
1625
+ },
1626
+ {
1627
+ "type": "paragraph",
1628
+ "text": "Will write default values for picking, which the Render Pick DAT/CHOP will read. If you have a custom shader that changes vertex positions in a non standard way, or if you want to output different kinds of information (like a color other than TDPointColor()), you can replace the values that have been written by this function afterwards. The values available to you are:"
1629
+ },
1630
+ {
1631
+ "type": "code",
1632
+ "text": "TDPickVertex {\n\tvec3 sopSpacePosition;\n\tvec3 worldSpacePosition;\n\tvec3 camSpacePosition;\n\tvec3 sopSpaceNormal;\n\tvec3 worldSpaceNormal;\n\tvec3 camSpaceNormal;\n\tvec3 uv[1];\n\tflat int instanceId;\n\tvec4 color;\n} vTDPickVert;",
1633
+ "language": "python"
1634
+ },
1635
+ {
1636
+ "type": "paragraph",
1637
+ "text": "So for example if you modifying the vertex position in a way different from the standard TDDeform() way, you could write these newly calculated values to like this:\n Be sure to do this AFTER the call to TDWritePickingValues(), otherwise that call will overwrite your values ."
1638
+ },
1639
+ {
1640
+ "type": "code",
1641
+ "text": "TDWritePickingValues();\nvTDPickVert.sopSpacePosition = newPosition;\nvTDPickVert.worldSpacePosition = uTDMats[TDCameraIndex()].world * vec4(newPosition, 1.0);\nvTDPickVert.camSpacePosition = uTDMats[TDCameraIndex()].worldCam * vec4(newPosition, 1.0);",
1642
+ "language": "python"
1643
+ },
1644
+ {
1645
+ "type": "paragraph",
1646
+ "text": "You do not have to write to all the entries in this structure, but you can for completeness. Only the values that are being read by the Render Pick CHOP/DAT (selected in their parameters) must be filled in."
1647
+ },
1648
+ {
1649
+ "type": "paragraph",
1650
+ "text": "For custom attributes that you set for picking in the Render Pick CHOP or Render Pick DAT, the attributes are available in vTDCustomPickVert with the name and size as defined in the Render Pick node."
1651
+ },
1652
+ {
1653
+ "type": "code",
1654
+ "text": "vTDCustomPickVert",
1655
+ "language": "python"
1656
+ }
1657
+ ]
1658
+ },
1659
+ {
1660
+ "title": "Shadertoy[edit]",
1661
+ "level": 2,
1662
+ "content": [
1663
+ {
1664
+ "type": "subsection",
1665
+ "title": "VR Shaders[edit]",
1666
+ "level": 3
1667
+ },
1668
+ {
1669
+ "type": "paragraph",
1670
+ "text": "Shaders that come from Shadertoy that support VR rendering will have a mainVR function defined. Re-creating the fragRayOri and fragRayDir variables that function uses inside of TD is simple. In the vertex shader:"
1671
+ },
1672
+ {
1673
+ "type": "code",
1674
+ "text": "mainVR",
1675
+ "language": "python"
1676
+ },
1677
+ {
1678
+ "type": "code",
1679
+ "text": "fragRayOri",
1680
+ "language": "python"
1681
+ },
1682
+ {
1683
+ "type": "code",
1684
+ "text": "fragRayDir",
1685
+ "language": "python"
1686
+ },
1687
+ {
1688
+ "type": "code",
1689
+ "text": "vec4 worldSpaceVert = TDDeform(TDPos());\nvec4 worldSpaceCamPos = uTDMat.camInverse[3]; // The last column of the camera transform is it's position\n\nvec3 fragRayOri = worldSpaceCamPos.xyz;\nvec3 fragRayDir = worldSpaceVert.xyz - worldSpaceCamPos.xyz;\n// Pass these variables to the pixel shader using 'out' variables named of your choosing",
1690
+ "language": "python"
1691
+ },
1692
+ {
1693
+ "type": "paragraph",
1694
+ "text": "And in the pixel shader you just need to normalize whatever variable the fragRayDir was went through. The variable that came from fragRayOri and be used as-is."
1695
+ },
1696
+ {
1697
+ "type": "code",
1698
+ "text": "fragRayDir",
1699
+ "language": "python"
1700
+ },
1701
+ {
1702
+ "type": "code",
1703
+ "text": "fragRayOri",
1704
+ "language": "python"
1705
+ },
1706
+ {
1707
+ "type": "paragraph",
1708
+ "text": "To support these shaders, which are usually raymarching shaders, you'll want to render geometry that covers the entire viewport, such as putting a sphere around your camera."
1709
+ }
1710
+ ]
1711
+ },
1712
+ {
1713
+ "title": "Other Notes[edit]",
1714
+ "level": 2,
1715
+ "content": [
1716
+ {
1717
+ "type": "subsection",
1718
+ "title": "#version statement[edit]",
1719
+ "level": 3
1720
+ },
1721
+ {
1722
+ "type": "paragraph",
1723
+ "text": "The #version statement will be added to the code automatically for you. Your code should not have a #version statement, otherwise compile errors may occur."
1724
+ },
1725
+ {
1726
+ "type": "subsection",
1727
+ "title": "#include statements[edit]",
1728
+ "level": 3
1729
+ },
1730
+ {
1731
+ "type": "paragraph",
1732
+ "text": "You can use an #include statement in one DAT to include code from another DAT. The path can be absolute or relative."
1733
+ },
1734
+ {
1735
+ "type": "code",
1736
+ "text": "#include </project1/text1>\n #include <../../geo1/text2>\n #include \"text2\"",
1737
+ "language": "python"
1738
+ },
1739
+ {
1740
+ "type": "subsection",
1741
+ "title": "Diagnosing crashes due to GLSL[edit]",
1742
+ "level": 3
1743
+ },
1744
+ {
1745
+ "type": "paragraph",
1746
+ "text": "If you are experiencing a full application crash when writing GLSL code, you may want to refer to this article for tips on diagnosing these issues."
1747
+ },
1748
+ {
1749
+ "type": "subsection",
1750
+ "title": "Changes from GLSL 1.20[edit]",
1751
+ "level": 3
1752
+ },
1753
+ {
1754
+ "type": "paragraph",
1755
+ "text": "Shaders written for 1.20 will not compile as 3.30 shaders. The language received a large overhaul, changing the name of many key functions and replacing a lot of functionality. All of the changes can be seen in the official GLSL documentation linked to earlier. Some of the more important changes are:"
1756
+ },
1757
+ {
1758
+ "type": "unordered-list",
1759
+ "items": [
1760
+ "Removed texture1D(sampler1D, float), texture2D(sampler2D, vec2), etc. All texture sampling is done with identical function names, regardless of the dimensionality of the texture. e.g. texture(sampler1D, float), or texture(sampler2D, vec2)."
1761
+ ]
1762
+ },
1763
+ {
1764
+ "type": "code",
1765
+ "text": "texture1D(sampler1D, float), texture2D(sampler2D, vec2), etc.",
1766
+ "language": "python"
1767
+ },
1768
+ {
1769
+ "type": "code",
1770
+ "text": "texture(sampler1D, float), or texture(sampler2D, vec2)",
1771
+ "language": "python"
1772
+ },
1773
+ {
1774
+ "type": "unordered-list",
1775
+ "items": [
1776
+ "Removed the keyword varying. Instead use in and out (depending on if the value is getting outputted from the shader or inputted from a previous shader stage). Examples later on in the article."
1777
+ ]
1778
+ },
1779
+ {
1780
+ "type": "code",
1781
+ "text": "varying",
1782
+ "language": "python"
1783
+ },
1784
+ {
1785
+ "type": "code",
1786
+ "text": "in",
1787
+ "language": "python"
1788
+ },
1789
+ {
1790
+ "type": "code",
1791
+ "text": "out",
1792
+ "language": "python"
1793
+ },
1794
+ {
1795
+ "type": "unordered-list",
1796
+ "items": [
1797
+ "Removed the keyword attribute. Instead just use in in your vertex shader."
1798
+ ]
1799
+ },
1800
+ {
1801
+ "type": "code",
1802
+ "text": "attribute",
1803
+ "language": "python"
1804
+ },
1805
+ {
1806
+ "type": "code",
1807
+ "text": "in",
1808
+ "language": "python"
1809
+ },
1810
+ {
1811
+ "type": "unordered-list",
1812
+ "items": [
1813
+ "Removed built-in varyings gl_TexCoord[]. You'll need to always declare your own variables that get output/input between shader stages."
1814
+ ]
1815
+ },
1816
+ {
1817
+ "type": "code",
1818
+ "text": "gl_TexCoord[]",
1819
+ "language": "python"
1820
+ },
1821
+ {
1822
+ "type": "unordered-list",
1823
+ "items": [
1824
+ "Removed gl_FragColor and gl_FragData[]. Instead you name your own color outputs using the syntax layout(location = 0) vec4 oFragColor[TD_NUM_COLOR_BUFFERS]."
1825
+ ]
1826
+ },
1827
+ {
1828
+ "type": "code",
1829
+ "text": "gl_FragColor",
1830
+ "language": "python"
1831
+ },
1832
+ {
1833
+ "type": "code",
1834
+ "text": "gl_FragData[]",
1835
+ "language": "python"
1836
+ },
1837
+ {
1838
+ "type": "code",
1839
+ "text": "layout(location = 0) vec4 oFragColor[TD_NUM_COLOR_BUFFERS]",
1840
+ "language": "python"
1841
+ },
1842
+ {
1843
+ "type": "unordered-list",
1844
+ "items": [
1845
+ "Removed all built-in attributes such as gl_Vertex, gl_MultiTexCoord0, gl_Normal. In TouchDesigner these attributes will be accessible through automatically declared attributes such as in vec3 TDPos(); in vec3 TDTexCoord(uint coordLayer); in vec3 TDNormal(); vec4 TDPointColor(). More details on this later."
1846
+ ]
1847
+ },
1848
+ {
1849
+ "type": "code",
1850
+ "text": "gl_Vertex, gl_MultiTexCoord0, gl_Normal",
1851
+ "language": "python"
1852
+ },
1853
+ {
1854
+ "type": "code",
1855
+ "text": "in vec3 TDPos(); in vec3 TDTexCoord(uint coordLayer); in vec3 TDNormal(); vec4 TDPointColor()",
1856
+ "language": "python"
1857
+ },
1858
+ {
1859
+ "type": "unordered-list",
1860
+ "items": [
1861
+ "Removed almost all built-in uniforms such as matrices (gl_ModelViewMatrix, gl_ProjectionMatrix), light information (gl_LightSource[]), fog information (gl_Fog). All of this data will be available through new means provided by TouchDesigner, detailed later."
1862
+ ]
1863
+ },
1864
+ {
1865
+ "type": "code",
1866
+ "text": "gl_ModelViewMatrix, gl_ProjectionMatrix",
1867
+ "language": "python"
1868
+ },
1869
+ {
1870
+ "type": "code",
1871
+ "text": "gl_LightSource[]",
1872
+ "language": "python"
1873
+ },
1874
+ {
1875
+ "type": "code",
1876
+ "text": "gl_Fog",
1877
+ "language": "python"
1878
+ },
1879
+ {
1880
+ "type": "unordered-list",
1881
+ "items": [
1882
+ "Arrays of samplers are now supported, and are used extensively in TouchDesigner when appropriate. There are limitations on how these samplers are indexed though, detailed in the GLSL spec for the particular version you are using (3.30 has different rules from 4.10, for example)."
1883
+ ]
1884
+ },
1885
+ {
1886
+ "type": "subsection",
1887
+ "title": "Major changes since TouchDesigner088[edit]",
1888
+ "level": 3
1889
+ },
1890
+ {
1891
+ "type": "paragraph",
1892
+ "text": "A lot of changes have been done to TouchDesigner's GLSL API in 099. Most of these changes were done to better facilitate Multi-Camera Rendering. A summary of most of these changes is:"
1893
+ },
1894
+ {
1895
+ "type": "unordered-list",
1896
+ "items": [
1897
+ "Lighting and other work is now done in World space instead of Camera space. This makes code cleaner since the shaders would need to do their work in multiple different camera spaces for multiple cameras. Legacy GLSL shaders are supported with the GLSL TOPs 'Lighting Space' parameter which will be set to Camera Space for older shaders.",
1898
+ "TDInstanceID() should be used instead of gl_InstanceID/uTDInstanceIDOffset.",
1899
+ "uTDMat has been removed when lighting in World Space, use the array uTDMats[] instead.",
1900
+ "Some values from the uTDGeneral structure have been moved to uTDCamInfos[], since that info is camera specific.",
1901
+ "A notion of camera index (obtained in the vertex shader using TDCameraIndex()), is needed for some functions such as TDFog().",
1902
+ "TDAlphaTest(float) must be called to apply the alpha test. It can be safely called when the alpha test is disabled on the MAT, it'll do nothing in that case.",
1903
+ "Before writing any color to a output color buffer, it should be passed through vec4 TDOutputSwizzle(vec4). This ensures the channels are in the correct place depending on how the channels are stored in the output texture. For example Alpha-only textures may be stored in a 'Red-only' texture internally, so the alpha value will need to be swizzled over to the red channel before output."
1904
+ ]
1905
+ },
1906
+ {
1907
+ "type": "code",
1908
+ "text": "TDInstanceID()",
1909
+ "language": "python"
1910
+ },
1911
+ {
1912
+ "type": "code",
1913
+ "text": "gl_InstanceID/uTDInstanceIDOffset",
1914
+ "language": "python"
1915
+ },
1916
+ {
1917
+ "type": "code",
1918
+ "text": "uTDMat",
1919
+ "language": "python"
1920
+ },
1921
+ {
1922
+ "type": "code",
1923
+ "text": "uTDMats[]",
1924
+ "language": "python"
1925
+ },
1926
+ {
1927
+ "type": "code",
1928
+ "text": "uTDGeneral",
1929
+ "language": "python"
1930
+ },
1931
+ {
1932
+ "type": "code",
1933
+ "text": "uTDCamInfos[]",
1934
+ "language": "python"
1935
+ },
1936
+ {
1937
+ "type": "code",
1938
+ "text": "TDCameraIndex()",
1939
+ "language": "python"
1940
+ },
1941
+ {
1942
+ "type": "code",
1943
+ "text": "TDFog()",
1944
+ "language": "python"
1945
+ },
1946
+ {
1947
+ "type": "code",
1948
+ "text": "TDAlphaTest(float)",
1949
+ "language": "python"
1950
+ },
1951
+ {
1952
+ "type": "code",
1953
+ "text": "vec4 TDOutputSwizzle(vec4)",
1954
+ "language": "python"
1955
+ }
1956
+ ]
1957
+ },
1958
+ {
1959
+ "title": "Related Articles[edit]",
1960
+ "level": 2,
1961
+ "content": [
1962
+ {
1963
+ "type": "paragraph",
1964
+ "text": "MATs or Materials are an Operator Family that applies a Shader to a SOP or 3D Geometry Object for rendering textured surfaces with lighting."
1965
+ },
1966
+ {
1967
+ "type": "paragraph",
1968
+ "text": "A sequence of vertices form a Polygon in a SOP. Each vertex is an integer index into the Point List, and each Point holds an XYZ position and attributes like Normals and Texture Coordinates."
1969
+ },
1970
+ {
1971
+ "type": "paragraph",
1972
+ "text": "The OpenGL (pre-2022) or Vulkan (2022-) code that runs on the GPU and creates rendered images from polygons and textures. A shader is programmed in Text DATs and referenced by a GLSL Material or a GLSL TOP. Shaders are composed of up to three parts: Vertex Shader, Pixel Shader and Compute Shader."
1973
+ },
1974
+ {
1975
+ "type": "paragraph",
1976
+ "text": "A Operator Family that reads, creates and modifies 3D points, polygons, lines, particles, surfaces, spheres and meatballs. Particles and point clouds are now done primarily on the GPU using TOPs."
1977
+ },
1978
+ {
1979
+ "type": "paragraph",
1980
+ "text": "Information associated with SOP geometry. Points and primitives (polygons, NURBS, etc.) can have any number of attributes - position (P) is standard, and built-in optional attributes are normals (N), texture coordinates (uv), color (Cd), etc."
1981
+ },
1982
+ {
1983
+ "type": "paragraph",
1984
+ "text": "MATs or Materials are an Operator Family that applies a Shader to a SOP or 3D Geometry Object for rendering textured surfaces with lighting."
1985
+ },
1986
+ {
1987
+ "type": "paragraph",
1988
+ "text": "An Operator Family that contains its own Network. There are sixteen 3D Object Component and ten 2D Panel Component types. See also Network Path."
1989
+ },
1990
+ {
1991
+ "type": "paragraph",
1992
+ "text": "An Operator Family that creates, composites and modifies images, and reads/writes images and movies to/from files and the network. TOPs run on the graphics card's GPU."
1993
+ },
1994
+ {
1995
+ "type": "paragraph",
1996
+ "text": "Quad Reprojection renders pixel-perfect perspective-correct images for flat TVs and LED panels hung at any orientation."
1997
+ },
1998
+ {
1999
+ "type": "paragraph",
2000
+ "text": "Rendering is the creation of a 3D image with the Render TOP. Rendering is also used more generally to include the compositing (with TOPs) to generate an output image."
2001
+ },
2002
+ {
2003
+ "type": "paragraph",
2004
+ "text": "(1) A Geometry Component can instance and render its SOP geometry many times: once for each sample in a CHOP, row of a DAT table, pixel in a TOP, or point of a SOP, (2) An instance is an OP that doesn't actually have its own data, but rather just refers to an OP (or has an input) whose data it uses. This includes Null OPs, Switch OPs and in some cases Select OPs."
2005
+ },
2006
+ {
2007
+ "type": "paragraph",
2008
+ "text": "A technique or workflow that allows for displaying content on often irregular shapes and surfaces."
2009
+ },
2010
+ {
2011
+ "type": "paragraph",
2012
+ "text": "The Graphics Processing Unit. This is the high-speed, many-core processor of the graphics card/chip that takes geometry, images and data from the CPU and creates images and processed data."
2013
+ },
2014
+ {
2015
+ "type": "paragraph",
2016
+ "text": "An Operator Family which operate on Channels (a sequence of numbers (Samples)) which are used for animation, audio, mathematics, simulation, logic, UI construction, and data streamed from/to devices and protocols."
2017
+ },
2018
+ {
2019
+ "type": "paragraph",
2020
+ "text": "Each SOP has a list of Points. Each point has an XYZ 3D position value plus other optional attributes. Each polygon Primitive is defined by a vertex list, which is list of point numbers."
2021
+ },
2022
+ {
2023
+ "type": "paragraph",
2024
+ "text": "An Operator Family that manipulates text strings: multi-line text or tables. Multi-line text is often a python Script or GLSL Shader, but can be any multi-line text. Tables are rows and columns of cells, each containing a text string."
2025
+ },
2026
+ {
2027
+ "type": "unordered-list",
2028
+ "items": [
2029
+ "Touch Glossary",
2030
+ "Rendering",
2031
+ "TDPages",
2032
+ "TouchDesigner Tips",
2033
+ "Materials",
2034
+ "GLSL",
2035
+ "Programming in TouchDesigner"
2036
+ ]
2037
+ }
2038
+ ]
2039
+ },
2040
+ {
2041
+ "title": "Navigation menu",
2042
+ "level": 2,
2043
+ "content": [
2044
+ {
2045
+ "type": "subsection",
2046
+ "title": "Personal tools",
2047
+ "level": 3
2048
+ },
2049
+ {
2050
+ "type": "unordered-list",
2051
+ "items": [
2052
+ "Log in"
2053
+ ]
2054
+ },
2055
+ {
2056
+ "type": "subsection",
2057
+ "title": "Namespaces",
2058
+ "level": 3
2059
+ },
2060
+ {
2061
+ "type": "unordered-list",
2062
+ "items": [
2063
+ "Page",
2064
+ "Discussion",
2065
+ "Experimental"
2066
+ ]
2067
+ },
2068
+ {
2069
+ "type": "subsection",
2070
+ "title": "Views",
2071
+ "level": 3
2072
+ },
2073
+ {
2074
+ "type": "unordered-list",
2075
+ "items": [
2076
+ "Read",
2077
+ "View source",
2078
+ "View history"
2079
+ ]
2080
+ },
2081
+ {
2082
+ "type": "subsection",
2083
+ "title": "Search",
2084
+ "level": 3
2085
+ },
2086
+ {
2087
+ "type": "subsection",
2088
+ "title": "TouchDesigner",
2089
+ "level": 3
2090
+ },
2091
+ {
2092
+ "type": "unordered-list",
2093
+ "items": [
2094
+ "Main Page",
2095
+ "Categories",
2096
+ "Learn TouchDesigner",
2097
+ "Tutorials",
2098
+ "Interoperability",
2099
+ "Glossary",
2100
+ "Operators",
2101
+ "Python",
2102
+ "Python Class Reference",
2103
+ "Palette",
2104
+ "FAQ",
2105
+ "Recent Doc Edits",
2106
+ "Release Notes"
2107
+ ]
2108
+ },
2109
+ {
2110
+ "type": "subsection",
2111
+ "title": "Downloads",
2112
+ "level": 3
2113
+ },
2114
+ {
2115
+ "type": "unordered-list",
2116
+ "items": [
2117
+ "TouchDesigner",
2118
+ "Shared Examples"
2119
+ ]
2120
+ },
2121
+ {
2122
+ "type": "subsection",
2123
+ "title": "Tools",
2124
+ "level": 3
2125
+ },
2126
+ {
2127
+ "type": "unordered-list",
2128
+ "items": [
2129
+ "What links here",
2130
+ "Related changes",
2131
+ "Special pages",
2132
+ "Printable version",
2133
+ "Permanent link",
2134
+ "Page information",
2135
+ "Page values"
2136
+ ]
2137
+ },
2138
+ {
2139
+ "type": "unordered-list",
2140
+ "items": [
2141
+ "This page was last edited on 17 October 2024, at 16:07."
2142
+ ]
2143
+ },
2144
+ {
2145
+ "type": "unordered-list",
2146
+ "items": [
2147
+ "Privacy policy",
2148
+ "About Derivative",
2149
+ "Disclaimers"
2150
+ ]
2151
+ },
2152
+ {
2153
+ "type": "unordered-list",
2154
+ "items": [
2155
+ ""
2156
+ ]
2157
+ }
2158
+ ]
2159
+ }
2160
+ ],
2161
+ "tableOfContents": [
2162
+ {
2163
+ "number": "1",
2164
+ "text": "Contents",
2165
+ "href": "#Contents"
2166
+ },
2167
+ {
2168
+ "number": "2",
2169
+ "text": "Overview[edit]",
2170
+ "href": "#Overview[edit]"
2171
+ },
2172
+ {
2173
+ "number": "3",
2174
+ "text": "Shader Stages[edit]",
2175
+ "href": "#Shader_Stages[edit]"
2176
+ },
2177
+ {
2178
+ "number": "4",
2179
+ "text": "A Basic Shader[edit]",
2180
+ "href": "#A_Basic_Shader[edit]"
2181
+ },
2182
+ {
2183
+ "number": "5",
2184
+ "text": "Working with Geometry Attributes[edit]",
2185
+ "href": "#Working_with_Geometry_Attributes[edit]"
2186
+ },
2187
+ {
2188
+ "number": "6",
2189
+ "text": "TouchDesigner specific defines[edit]",
2190
+ "href": "#TouchDesigner_specific_defines[edit]"
2191
+ },
2192
+ {
2193
+ "number": "7",
2194
+ "text": "TouchDesigner specific Uniforms[edit]",
2195
+ "href": "#TouchDesigner_specific_Uniforms[edit]"
2196
+ },
2197
+ {
2198
+ "number": "8",
2199
+ "text": "TouchDesigner specific Functions[edit]",
2200
+ "href": "#TouchDesigner_specific_Functions[edit]"
2201
+ },
2202
+ {
2203
+ "number": "9",
2204
+ "text": "Working with Lights[edit]",
2205
+ "href": "#Working_with_Lights[edit]"
2206
+ },
2207
+ {
2208
+ "number": "10",
2209
+ "text": "Multiple Render Targets[edit]",
2210
+ "href": "#Multiple_Render_Targets[edit]"
2211
+ },
2212
+ {
2213
+ "number": "11",
2214
+ "text": "Multi-Camera Rendering[edit]",
2215
+ "href": "#Multi-Camera_Rendering[edit]"
2216
+ },
2217
+ {
2218
+ "number": "12",
2219
+ "text": "Image Outputs[edit]",
2220
+ "href": "#Image_Outputs[edit]"
2221
+ },
2222
+ {
2223
+ "number": "13",
2224
+ "text": "Outputting gl_Position[edit]",
2225
+ "href": "#Outputting_gl_Position[edit]"
2226
+ },
2227
+ {
2228
+ "number": "14",
2229
+ "text": "Specilization Constants[edit]",
2230
+ "href": "#Specilization_Constants[edit]"
2231
+ },
2232
+ {
2233
+ "number": "15",
2234
+ "text": "Working with Deforms[edit]",
2235
+ "href": "#Working_with_Deforms[edit]"
2236
+ },
2237
+ {
2238
+ "number": "16",
2239
+ "text": "Point Sprites[edit]",
2240
+ "href": "#Point_Sprites[edit]"
2241
+ },
2242
+ {
2243
+ "number": "17",
2244
+ "text": "Order Independent Transparency[edit]",
2245
+ "href": "#Order_Independent_Transparency[edit]"
2246
+ },
2247
+ {
2248
+ "number": "18",
2249
+ "text": "Dithering[edit]",
2250
+ "href": "#Dithering[edit]"
2251
+ },
2252
+ {
2253
+ "number": "19",
2254
+ "text": "Picking[edit]",
2255
+ "href": "#Picking[edit]"
2256
+ },
2257
+ {
2258
+ "number": "20",
2259
+ "text": "Shadertoy[edit]",
2260
+ "href": "#Shadertoy[edit]"
2261
+ },
2262
+ {
2263
+ "number": "21",
2264
+ "text": "Other Notes[edit]",
2265
+ "href": "#Other_Notes[edit]"
2266
+ },
2267
+ {
2268
+ "number": "22",
2269
+ "text": "Related Articles[edit]",
2270
+ "href": "#Related_Articles[edit]"
2271
+ },
2272
+ {
2273
+ "number": "23",
2274
+ "text": "Navigation menu",
2275
+ "href": "#Navigation_menu"
2276
+ }
2277
+ ],
2278
+ "relatedLinks": [
2279
+ {
2280
+ "text": "Shader",
2281
+ "href": "./Shader.htm"
2282
+ },
2283
+ {
2284
+ "text": "Texture 3D TOP",
2285
+ "href": "./Texture_3D_TOP.htm"
2286
+ },
2287
+ {
2288
+ "text": "Texture 3D TOP",
2289
+ "href": "./Texture_3D_TOP.htm"
2290
+ },
2291
+ {
2292
+ "text": "Geometry Viewer",
2293
+ "href": "./Geometry_Viewer.htm"
2294
+ },
2295
+ {
2296
+ "text": "Render TOP",
2297
+ "href": "./Render_TOP.htm"
2298
+ },
2299
+ {
2300
+ "text": "Render TOP",
2301
+ "href": "./Render_TOP.htm"
2302
+ },
2303
+ {
2304
+ "text": "Render TOP",
2305
+ "href": "./Render_TOP.htm"
2306
+ },
2307
+ {
2308
+ "text": "Render Select TOP",
2309
+ "href": "./Render_Select_TOP.htm"
2310
+ },
2311
+ {
2312
+ "text": "Render TOP",
2313
+ "href": "./Render_TOP.htm"
2314
+ },
2315
+ {
2316
+ "text": "Render Select TOP",
2317
+ "href": "./Render_Select_TOP.htm"
2318
+ }
2319
+ ],
2320
+ "images": [
2321
+ {
2322
+ "src": "./resources/assets/poweredby_mediawiki_88x31.png",
2323
+ "alt": "Powered by MediaWiki",
2324
+ "caption": "Powered by MediaWiki"
2325
+ }
2326
+ ]
2327
+ },
2328
+ "keywords": [
2329
+ "write",
2330
+ "a",
2331
+ "glsl",
2332
+ "material",
2333
+ "tutorial",
2334
+ "this",
2335
+ "document",
2336
+ "explains",
2337
+ "finer",
2338
+ "points",
2339
+ "writing",
2340
+ "touchdesigner.",
2341
+ "assumed"
2342
+ ],
2343
+ "tags": [
2344
+ "Tutorial",
2345
+ "TouchDesigner",
2346
+ "Write a GLSL Material"
2347
+ ],
2348
+ "searchWeight": 2,
2349
+ "lastUpdated": "2025-08-13T01:17:18.946Z",
2350
+ "sourceFile": "C:\\Program Files\\Derivative\\TouchDesigner\\Samples\\Learn\\OfflineHelp\\https.docs.derivative.ca\\Write_a_GLSL_Material.htm",
2351
+ "isValid": true,
2352
+ "validationErrors": []
2353
+ }