@triforge/shader-core 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 (297) hide show
  1. package/README.md +90 -0
  2. package/dist/bundle.js +5578 -0
  3. package/dist/core/CompileContext.d.ts +60 -0
  4. package/dist/core/CompileContext.d.ts.map +1 -0
  5. package/dist/core/CompileContext.js +276 -0
  6. package/dist/core/InputNode.d.ts +11 -0
  7. package/dist/core/InputNode.d.ts.map +1 -0
  8. package/dist/core/InputNode.js +13 -0
  9. package/dist/core/InputSocket.d.ts +21 -0
  10. package/dist/core/InputSocket.d.ts.map +1 -0
  11. package/dist/core/InputSocket.js +23 -0
  12. package/dist/core/OutputNode.d.ts +30 -0
  13. package/dist/core/OutputNode.d.ts.map +1 -0
  14. package/dist/core/OutputNode.js +60 -0
  15. package/dist/core/OutputSocket.d.ts +18 -0
  16. package/dist/core/OutputSocket.d.ts.map +1 -0
  17. package/dist/core/OutputSocket.js +16 -0
  18. package/dist/core/ProcessNode.d.ts +8 -0
  19. package/dist/core/ProcessNode.d.ts.map +1 -0
  20. package/dist/core/ProcessNode.js +7 -0
  21. package/dist/core/ShaderConfig.d.ts +13 -0
  22. package/dist/core/ShaderConfig.d.ts.map +1 -0
  23. package/dist/core/ShaderConfig.js +11 -0
  24. package/dist/core/ShaderNode.d.ts +114 -0
  25. package/dist/core/ShaderNode.d.ts.map +1 -0
  26. package/dist/core/ShaderNode.js +156 -0
  27. package/dist/core/ShaderNodeError.d.ts +32 -0
  28. package/dist/core/ShaderNodeError.d.ts.map +1 -0
  29. package/dist/core/ShaderNodeError.js +61 -0
  30. package/dist/core/SocketType.d.ts +12 -0
  31. package/dist/core/SocketType.d.ts.map +1 -0
  32. package/dist/core/SocketType.js +7 -0
  33. package/dist/index.d.ts +164 -0
  34. package/dist/index.d.ts.map +1 -0
  35. package/dist/index.js +108 -0
  36. package/dist/nodes/input/Attribute.d.ts +45 -0
  37. package/dist/nodes/input/Attribute.d.ts.map +1 -0
  38. package/dist/nodes/input/Attribute.js +58 -0
  39. package/dist/nodes/input/CameraData.d.ts +21 -0
  40. package/dist/nodes/input/CameraData.d.ts.map +1 -0
  41. package/dist/nodes/input/CameraData.js +33 -0
  42. package/dist/nodes/input/ColorAttribute.d.ts +28 -0
  43. package/dist/nodes/input/ColorAttribute.d.ts.map +1 -0
  44. package/dist/nodes/input/ColorAttribute.js +32 -0
  45. package/dist/nodes/input/Geometry.d.ts +23 -0
  46. package/dist/nodes/input/Geometry.d.ts.map +1 -0
  47. package/dist/nodes/input/Geometry.js +38 -0
  48. package/dist/nodes/input/HairInfo.d.ts +38 -0
  49. package/dist/nodes/input/HairInfo.d.ts.map +1 -0
  50. package/dist/nodes/input/HairInfo.js +50 -0
  51. package/dist/nodes/input/LayerWeight.d.ts +26 -0
  52. package/dist/nodes/input/LayerWeight.d.ts.map +1 -0
  53. package/dist/nodes/input/LayerWeight.js +35 -0
  54. package/dist/nodes/input/LightPath.d.ts +60 -0
  55. package/dist/nodes/input/LightPath.d.ts.map +1 -0
  56. package/dist/nodes/input/LightPath.js +112 -0
  57. package/dist/nodes/input/ObjectInfo.d.ts +22 -0
  58. package/dist/nodes/input/ObjectInfo.d.ts.map +1 -0
  59. package/dist/nodes/input/ObjectInfo.js +41 -0
  60. package/dist/nodes/input/OceanAttribute.d.ts +32 -0
  61. package/dist/nodes/input/OceanAttribute.d.ts.map +1 -0
  62. package/dist/nodes/input/OceanAttribute.js +38 -0
  63. package/dist/nodes/input/ParticleInfo.d.ts +31 -0
  64. package/dist/nodes/input/ParticleInfo.d.ts.map +1 -0
  65. package/dist/nodes/input/ParticleInfo.js +44 -0
  66. package/dist/nodes/input/RGB.d.ts +19 -0
  67. package/dist/nodes/input/RGB.d.ts.map +1 -0
  68. package/dist/nodes/input/RGB.js +23 -0
  69. package/dist/nodes/input/ScreenCamera.d.ts +37 -0
  70. package/dist/nodes/input/ScreenCamera.d.ts.map +1 -0
  71. package/dist/nodes/input/ScreenCamera.js +59 -0
  72. package/dist/nodes/input/Tangent.d.ts +21 -0
  73. package/dist/nodes/input/Tangent.d.ts.map +1 -0
  74. package/dist/nodes/input/Tangent.js +30 -0
  75. package/dist/nodes/input/TextureCoordinate.d.ts +17 -0
  76. package/dist/nodes/input/TextureCoordinate.d.ts.map +1 -0
  77. package/dist/nodes/input/TextureCoordinate.js +24 -0
  78. package/dist/nodes/input/UVMap.d.ts +20 -0
  79. package/dist/nodes/input/UVMap.d.ts.map +1 -0
  80. package/dist/nodes/input/UVMap.js +23 -0
  81. package/dist/nodes/input/Value.d.ts +19 -0
  82. package/dist/nodes/input/Value.d.ts.map +1 -0
  83. package/dist/nodes/input/Value.js +22 -0
  84. package/dist/nodes/input/Wireframe.d.ts +25 -0
  85. package/dist/nodes/input/Wireframe.d.ts.map +1 -0
  86. package/dist/nodes/input/Wireframe.js +30 -0
  87. package/dist/nodes/output/Displacement.d.ts +28 -0
  88. package/dist/nodes/output/Displacement.d.ts.map +1 -0
  89. package/dist/nodes/output/Displacement.js +34 -0
  90. package/dist/nodes/output/MaterialOutput.d.ts +43 -0
  91. package/dist/nodes/output/MaterialOutput.d.ts.map +1 -0
  92. package/dist/nodes/output/MaterialOutput.js +118 -0
  93. package/dist/nodes/output/ScreenOutput.d.ts +38 -0
  94. package/dist/nodes/output/ScreenOutput.d.ts.map +1 -0
  95. package/dist/nodes/output/ScreenOutput.js +88 -0
  96. package/dist/nodes/process/AddShader.d.ts +30 -0
  97. package/dist/nodes/process/AddShader.d.ts.map +1 -0
  98. package/dist/nodes/process/AddShader.js +36 -0
  99. package/dist/nodes/process/AnimatedNoiseTexture.d.ts +39 -0
  100. package/dist/nodes/process/AnimatedNoiseTexture.d.ts.map +1 -0
  101. package/dist/nodes/process/AnimatedNoiseTexture.js +93 -0
  102. package/dist/nodes/process/Blackbody.d.ts +29 -0
  103. package/dist/nodes/process/Blackbody.d.ts.map +1 -0
  104. package/dist/nodes/process/Blackbody.js +50 -0
  105. package/dist/nodes/process/BrickTexture.d.ts +36 -0
  106. package/dist/nodes/process/BrickTexture.d.ts.map +1 -0
  107. package/dist/nodes/process/BrickTexture.js +71 -0
  108. package/dist/nodes/process/BrightContrast.d.ts +30 -0
  109. package/dist/nodes/process/BrightContrast.d.ts.map +1 -0
  110. package/dist/nodes/process/BrightContrast.js +41 -0
  111. package/dist/nodes/process/Bump.d.ts +31 -0
  112. package/dist/nodes/process/Bump.d.ts.map +1 -0
  113. package/dist/nodes/process/Bump.js +65 -0
  114. package/dist/nodes/process/CheckerTexture.d.ts +30 -0
  115. package/dist/nodes/process/CheckerTexture.d.ts.map +1 -0
  116. package/dist/nodes/process/CheckerTexture.js +48 -0
  117. package/dist/nodes/process/Clamp.d.ts +32 -0
  118. package/dist/nodes/process/Clamp.d.ts.map +1 -0
  119. package/dist/nodes/process/Clamp.js +37 -0
  120. package/dist/nodes/process/ColorRamp.d.ts +28 -0
  121. package/dist/nodes/process/ColorRamp.d.ts.map +1 -0
  122. package/dist/nodes/process/ColorRamp.js +49 -0
  123. package/dist/nodes/process/CombineColor.d.ts +34 -0
  124. package/dist/nodes/process/CombineColor.d.ts.map +1 -0
  125. package/dist/nodes/process/CombineColor.js +69 -0
  126. package/dist/nodes/process/CombineRGB.d.ts +29 -0
  127. package/dist/nodes/process/CombineRGB.d.ts.map +1 -0
  128. package/dist/nodes/process/CombineRGB.js +33 -0
  129. package/dist/nodes/process/CombineXYZ.d.ts +29 -0
  130. package/dist/nodes/process/CombineXYZ.d.ts.map +1 -0
  131. package/dist/nodes/process/CombineXYZ.js +33 -0
  132. package/dist/nodes/process/DiffuseBSDF.d.ts +30 -0
  133. package/dist/nodes/process/DiffuseBSDF.d.ts.map +1 -0
  134. package/dist/nodes/process/DiffuseBSDF.js +43 -0
  135. package/dist/nodes/process/Emission.d.ts +30 -0
  136. package/dist/nodes/process/Emission.d.ts.map +1 -0
  137. package/dist/nodes/process/Emission.js +36 -0
  138. package/dist/nodes/process/EnvironmentTexture.d.ts +41 -0
  139. package/dist/nodes/process/EnvironmentTexture.d.ts.map +1 -0
  140. package/dist/nodes/process/EnvironmentTexture.js +65 -0
  141. package/dist/nodes/process/FloatCurve.d.ts +34 -0
  142. package/dist/nodes/process/FloatCurve.d.ts.map +1 -0
  143. package/dist/nodes/process/FloatCurve.js +46 -0
  144. package/dist/nodes/process/Fresnel.d.ts +36 -0
  145. package/dist/nodes/process/Fresnel.d.ts.map +1 -0
  146. package/dist/nodes/process/Fresnel.js +53 -0
  147. package/dist/nodes/process/Gamma.d.ts +29 -0
  148. package/dist/nodes/process/Gamma.d.ts.map +1 -0
  149. package/dist/nodes/process/Gamma.js +35 -0
  150. package/dist/nodes/process/GlassBSDF.d.ts +31 -0
  151. package/dist/nodes/process/GlassBSDF.d.ts.map +1 -0
  152. package/dist/nodes/process/GlassBSDF.js +51 -0
  153. package/dist/nodes/process/GlossyBSDF.d.ts +30 -0
  154. package/dist/nodes/process/GlossyBSDF.d.ts.map +1 -0
  155. package/dist/nodes/process/GlossyBSDF.js +50 -0
  156. package/dist/nodes/process/GradientTexture.d.ts +31 -0
  157. package/dist/nodes/process/GradientTexture.d.ts.map +1 -0
  158. package/dist/nodes/process/GradientTexture.js +49 -0
  159. package/dist/nodes/process/HashValue.d.ts +30 -0
  160. package/dist/nodes/process/HashValue.d.ts.map +1 -0
  161. package/dist/nodes/process/HashValue.js +34 -0
  162. package/dist/nodes/process/HueSaturationValue.d.ts +32 -0
  163. package/dist/nodes/process/HueSaturationValue.d.ts.map +1 -0
  164. package/dist/nodes/process/HueSaturationValue.js +58 -0
  165. package/dist/nodes/process/ImageTexture.d.ts +34 -0
  166. package/dist/nodes/process/ImageTexture.d.ts.map +1 -0
  167. package/dist/nodes/process/ImageTexture.js +53 -0
  168. package/dist/nodes/process/InvertColor.d.ts +29 -0
  169. package/dist/nodes/process/InvertColor.d.ts.map +1 -0
  170. package/dist/nodes/process/InvertColor.js +35 -0
  171. package/dist/nodes/process/MagicTexture.d.ts +30 -0
  172. package/dist/nodes/process/MagicTexture.d.ts.map +1 -0
  173. package/dist/nodes/process/MagicTexture.js +54 -0
  174. package/dist/nodes/process/MapRange.d.ts +38 -0
  175. package/dist/nodes/process/MapRange.d.ts.map +1 -0
  176. package/dist/nodes/process/MapRange.js +52 -0
  177. package/dist/nodes/process/Mapping.d.ts +37 -0
  178. package/dist/nodes/process/Mapping.d.ts.map +1 -0
  179. package/dist/nodes/process/Mapping.js +57 -0
  180. package/dist/nodes/process/Math.d.ts +40 -0
  181. package/dist/nodes/process/Math.d.ts.map +1 -0
  182. package/dist/nodes/process/Math.js +100 -0
  183. package/dist/nodes/process/MixRGB.d.ts +35 -0
  184. package/dist/nodes/process/MixRGB.d.ts.map +1 -0
  185. package/dist/nodes/process/MixRGB.js +63 -0
  186. package/dist/nodes/process/MixShader.d.ts +35 -0
  187. package/dist/nodes/process/MixShader.d.ts.map +1 -0
  188. package/dist/nodes/process/MixShader.js +47 -0
  189. package/dist/nodes/process/MusgraveTexture.d.ts +36 -0
  190. package/dist/nodes/process/MusgraveTexture.d.ts.map +1 -0
  191. package/dist/nodes/process/MusgraveTexture.js +70 -0
  192. package/dist/nodes/process/NoiseTexture.d.ts +31 -0
  193. package/dist/nodes/process/NoiseTexture.d.ts.map +1 -0
  194. package/dist/nodes/process/NoiseTexture.js +78 -0
  195. package/dist/nodes/process/Normal.d.ts +30 -0
  196. package/dist/nodes/process/Normal.d.ts.map +1 -0
  197. package/dist/nodes/process/Normal.js +38 -0
  198. package/dist/nodes/process/NormalMap.d.ts +34 -0
  199. package/dist/nodes/process/NormalMap.d.ts.map +1 -0
  200. package/dist/nodes/process/NormalMap.js +54 -0
  201. package/dist/nodes/process/PrincipledBSDF.d.ts +32 -0
  202. package/dist/nodes/process/PrincipledBSDF.d.ts.map +1 -0
  203. package/dist/nodes/process/PrincipledBSDF.js +75 -0
  204. package/dist/nodes/process/PrincipledHair.d.ts +63 -0
  205. package/dist/nodes/process/PrincipledHair.d.ts.map +1 -0
  206. package/dist/nodes/process/PrincipledHair.js +137 -0
  207. package/dist/nodes/process/PrincipledVolume.d.ts +37 -0
  208. package/dist/nodes/process/PrincipledVolume.d.ts.map +1 -0
  209. package/dist/nodes/process/PrincipledVolume.js +67 -0
  210. package/dist/nodes/process/RGBCurves.d.ts +45 -0
  211. package/dist/nodes/process/RGBCurves.d.ts.map +1 -0
  212. package/dist/nodes/process/RGBCurves.js +81 -0
  213. package/dist/nodes/process/RGBtoBW.d.ts +28 -0
  214. package/dist/nodes/process/RGBtoBW.d.ts.map +1 -0
  215. package/dist/nodes/process/RGBtoBW.js +31 -0
  216. package/dist/nodes/process/RefractionBSDF.d.ts +32 -0
  217. package/dist/nodes/process/RefractionBSDF.d.ts.map +1 -0
  218. package/dist/nodes/process/RefractionBSDF.js +46 -0
  219. package/dist/nodes/process/SchwarzschildMarch.d.ts +56 -0
  220. package/dist/nodes/process/SchwarzschildMarch.d.ts.map +1 -0
  221. package/dist/nodes/process/SchwarzschildMarch.js +306 -0
  222. package/dist/nodes/process/SeparateColor.d.ts +33 -0
  223. package/dist/nodes/process/SeparateColor.d.ts.map +1 -0
  224. package/dist/nodes/process/SeparateColor.js +79 -0
  225. package/dist/nodes/process/SeparateRGB.d.ts +27 -0
  226. package/dist/nodes/process/SeparateRGB.d.ts.map +1 -0
  227. package/dist/nodes/process/SeparateRGB.js +31 -0
  228. package/dist/nodes/process/SeparateXYZ.d.ts +27 -0
  229. package/dist/nodes/process/SeparateXYZ.d.ts.map +1 -0
  230. package/dist/nodes/process/SeparateXYZ.js +31 -0
  231. package/dist/nodes/process/ShaderScript.d.ts +95 -0
  232. package/dist/nodes/process/ShaderScript.d.ts.map +1 -0
  233. package/dist/nodes/process/ShaderScript.js +119 -0
  234. package/dist/nodes/process/ShaderToRGB.d.ts +28 -0
  235. package/dist/nodes/process/ShaderToRGB.d.ts.map +1 -0
  236. package/dist/nodes/process/ShaderToRGB.js +33 -0
  237. package/dist/nodes/process/SheenBSDF.d.ts +31 -0
  238. package/dist/nodes/process/SheenBSDF.d.ts.map +1 -0
  239. package/dist/nodes/process/SheenBSDF.js +49 -0
  240. package/dist/nodes/process/SpecularBSDF.d.ts +32 -0
  241. package/dist/nodes/process/SpecularBSDF.d.ts.map +1 -0
  242. package/dist/nodes/process/SpecularBSDF.js +54 -0
  243. package/dist/nodes/process/SubsurfaceScattering.d.ts +33 -0
  244. package/dist/nodes/process/SubsurfaceScattering.d.ts.map +1 -0
  245. package/dist/nodes/process/SubsurfaceScattering.js +46 -0
  246. package/dist/nodes/process/ToonBSDF.d.ts +31 -0
  247. package/dist/nodes/process/ToonBSDF.d.ts.map +1 -0
  248. package/dist/nodes/process/ToonBSDF.js +44 -0
  249. package/dist/nodes/process/TranslucentBSDF.d.ts +29 -0
  250. package/dist/nodes/process/TranslucentBSDF.d.ts.map +1 -0
  251. package/dist/nodes/process/TranslucentBSDF.js +39 -0
  252. package/dist/nodes/process/VectorCurves.d.ts +42 -0
  253. package/dist/nodes/process/VectorCurves.d.ts.map +1 -0
  254. package/dist/nodes/process/VectorCurves.js +71 -0
  255. package/dist/nodes/process/VectorMath.d.ts +38 -0
  256. package/dist/nodes/process/VectorMath.d.ts.map +1 -0
  257. package/dist/nodes/process/VectorMath.js +105 -0
  258. package/dist/nodes/process/VectorRotate.d.ts +34 -0
  259. package/dist/nodes/process/VectorRotate.d.ts.map +1 -0
  260. package/dist/nodes/process/VectorRotate.js +52 -0
  261. package/dist/nodes/process/VectorTransform.d.ts +36 -0
  262. package/dist/nodes/process/VectorTransform.d.ts.map +1 -0
  263. package/dist/nodes/process/VectorTransform.js +48 -0
  264. package/dist/nodes/process/VolumeAbsorption.d.ts +30 -0
  265. package/dist/nodes/process/VolumeAbsorption.d.ts.map +1 -0
  266. package/dist/nodes/process/VolumeAbsorption.js +36 -0
  267. package/dist/nodes/process/VolumeScatter.d.ts +31 -0
  268. package/dist/nodes/process/VolumeScatter.d.ts.map +1 -0
  269. package/dist/nodes/process/VolumeScatter.js +42 -0
  270. package/dist/nodes/process/VoronoiTexture.d.ts +38 -0
  271. package/dist/nodes/process/VoronoiTexture.d.ts.map +1 -0
  272. package/dist/nodes/process/VoronoiTexture.js +123 -0
  273. package/dist/nodes/process/WaveTexture.d.ts +39 -0
  274. package/dist/nodes/process/WaveTexture.d.ts.map +1 -0
  275. package/dist/nodes/process/WaveTexture.js +77 -0
  276. package/dist/nodes/process/Wavelength.d.ts +28 -0
  277. package/dist/nodes/process/Wavelength.d.ts.map +1 -0
  278. package/dist/nodes/process/Wavelength.js +43 -0
  279. package/dist/nodes/process/WhiteNoise.d.ts +27 -0
  280. package/dist/nodes/process/WhiteNoise.d.ts.map +1 -0
  281. package/dist/nodes/process/WhiteNoise.js +44 -0
  282. package/dist/nodes/shader/AmbientOcclusion.d.ts +47 -0
  283. package/dist/nodes/shader/AmbientOcclusion.d.ts.map +1 -0
  284. package/dist/nodes/shader/AmbientOcclusion.js +128 -0
  285. package/dist/nodes/shader/RayPortal.d.ts +57 -0
  286. package/dist/nodes/shader/RayPortal.d.ts.map +1 -0
  287. package/dist/nodes/shader/RayPortal.js +56 -0
  288. package/dist/shaders/color.d.ts +12 -0
  289. package/dist/shaders/color.d.ts.map +1 -0
  290. package/dist/shaders/color.js +42 -0
  291. package/dist/shaders/noise.d.ts +12 -0
  292. package/dist/shaders/noise.d.ts.map +1 -0
  293. package/dist/shaders/noise.js +70 -0
  294. package/dist/types/shader.d.ts +17 -0
  295. package/dist/types/shader.d.ts.map +1 -0
  296. package/dist/types/shader.js +1 -0
  297. package/package.json +44 -0
package/dist/index.js ADDED
@@ -0,0 +1,108 @@
1
+ // ── Config & Errors ───────────────────────────────────────────────────────────
2
+ export { ShaderConfig } from './core/ShaderConfig.js';
3
+ export { ShaderNodeError } from './core/ShaderNodeError.js';
4
+ // ── Core abstracts ────────────────────────────────────────────────────────────
5
+ export { ShaderNode } from './core/ShaderNode.js';
6
+ export { InputNode } from './core/InputNode.js';
7
+ export { OutputNode } from './core/OutputNode.js';
8
+ export { ProcessNode } from './core/ProcessNode.js';
9
+ // ── Sockets ───────────────────────────────────────────────────────────────────
10
+ export { InputSocket } from './core/InputSocket.js';
11
+ export { OutputSocket } from './core/OutputSocket.js';
12
+ export { SOCKET_GLSL_TYPE } from './core/SocketType.js';
13
+ // ── Compiler ──────────────────────────────────────────────────────────────────
14
+ export { CompileContext } from './core/CompileContext.js';
15
+ // ── Input nodes ───────────────────────────────────────────────────────────────
16
+ export { TextureCoordinate } from './nodes/input/TextureCoordinate.js';
17
+ export { Value } from './nodes/input/Value.js';
18
+ export { RGB } from './nodes/input/RGB.js';
19
+ export { Geometry } from './nodes/input/Geometry.js';
20
+ export { LayerWeight } from './nodes/input/LayerWeight.js';
21
+ export { CameraData } from './nodes/input/CameraData.js';
22
+ export { UVMap } from './nodes/input/UVMap.js';
23
+ export { Tangent } from './nodes/input/Tangent.js';
24
+ export { ColorAttribute } from './nodes/input/ColorAttribute.js';
25
+ export { Attribute } from './nodes/input/Attribute.js';
26
+ export { Wireframe } from './nodes/input/Wireframe.js';
27
+ export { ObjectInfo } from './nodes/input/ObjectInfo.js';
28
+ export { OceanAttribute } from './nodes/input/OceanAttribute.js';
29
+ export { HairInfo } from './nodes/input/HairInfo.js';
30
+ export { ParticleInfo } from './nodes/input/ParticleInfo.js';
31
+ export { LightPath } from './nodes/input/LightPath.js';
32
+ // ── Output nodes ──────────────────────────────────────────────────────────────
33
+ export { MaterialOutput } from './nodes/output/MaterialOutput.js';
34
+ export { Displacement } from './nodes/output/Displacement.js';
35
+ // ── Process nodes — Texture ───────────────────────────────────────────────────
36
+ export { NoiseTexture } from './nodes/process/NoiseTexture.js';
37
+ export { AnimatedNoiseTexture } from './nodes/process/AnimatedNoiseTexture.js';
38
+ export { VoronoiTexture } from './nodes/process/VoronoiTexture.js';
39
+ export { WaveTexture } from './nodes/process/WaveTexture.js';
40
+ export { GradientTexture } from './nodes/process/GradientTexture.js';
41
+ export { BrickTexture } from './nodes/process/BrickTexture.js';
42
+ export { CheckerTexture } from './nodes/process/CheckerTexture.js';
43
+ export { MagicTexture } from './nodes/process/MagicTexture.js';
44
+ export { MusgraveTexture } from './nodes/process/MusgraveTexture.js';
45
+ export { WhiteNoise } from './nodes/process/WhiteNoise.js';
46
+ export { ImageTexture } from './nodes/process/ImageTexture.js';
47
+ export { EnvironmentTexture } from './nodes/process/EnvironmentTexture.js';
48
+ // ── Process nodes — Color ─────────────────────────────────────────────────────
49
+ export { ColorRamp } from './nodes/process/ColorRamp.js';
50
+ export { MixRGB } from './nodes/process/MixRGB.js';
51
+ export { HueSaturationValue } from './nodes/process/HueSaturationValue.js';
52
+ export { BrightContrast } from './nodes/process/BrightContrast.js';
53
+ export { RGBtoBW } from './nodes/process/RGBtoBW.js';
54
+ export { Blackbody } from './nodes/process/Blackbody.js';
55
+ export { Gamma } from './nodes/process/Gamma.js';
56
+ export { InvertColor } from './nodes/process/InvertColor.js';
57
+ export { RGBCurves } from './nodes/process/RGBCurves.js';
58
+ export { Wavelength } from './nodes/process/Wavelength.js';
59
+ // ── Process nodes — Vector ────────────────────────────────────────────────────
60
+ export { NormalMap } from './nodes/process/NormalMap.js';
61
+ export { Bump } from './nodes/process/Bump.js';
62
+ export { Mapping } from './nodes/process/Mapping.js';
63
+ export { VectorMath } from './nodes/process/VectorMath.js';
64
+ export { SeparateRGB } from './nodes/process/SeparateRGB.js';
65
+ export { CombineRGB } from './nodes/process/CombineRGB.js';
66
+ export { SeparateXYZ } from './nodes/process/SeparateXYZ.js';
67
+ export { CombineXYZ } from './nodes/process/CombineXYZ.js';
68
+ export { Normal } from './nodes/process/Normal.js';
69
+ export { VectorRotate } from './nodes/process/VectorRotate.js';
70
+ export { VectorTransform } from './nodes/process/VectorTransform.js';
71
+ export { VectorCurves } from './nodes/process/VectorCurves.js';
72
+ // ── Process nodes — Shader ────────────────────────────────────────────────────
73
+ export { PrincipledBSDF } from './nodes/process/PrincipledBSDF.js';
74
+ export { Emission } from './nodes/process/Emission.js';
75
+ export { VolumeAbsorption } from './nodes/process/VolumeAbsorption.js';
76
+ export { VolumeScatter } from './nodes/process/VolumeScatter.js';
77
+ export { PrincipledVolume } from './nodes/process/PrincipledVolume.js';
78
+ export { MixShader } from './nodes/process/MixShader.js';
79
+ export { AddShader } from './nodes/process/AddShader.js';
80
+ export { Fresnel } from './nodes/process/Fresnel.js';
81
+ export { DiffuseBSDF } from './nodes/process/DiffuseBSDF.js';
82
+ export { GlossyBSDF } from './nodes/process/GlossyBSDF.js';
83
+ export { RefractionBSDF } from './nodes/process/RefractionBSDF.js';
84
+ export { GlassBSDF } from './nodes/process/GlassBSDF.js';
85
+ export { SheenBSDF } from './nodes/process/SheenBSDF.js';
86
+ export { SubsurfaceScattering } from './nodes/process/SubsurfaceScattering.js';
87
+ export { ToonBSDF } from './nodes/process/ToonBSDF.js';
88
+ export { SpecularBSDF } from './nodes/process/SpecularBSDF.js';
89
+ export { TranslucentBSDF } from './nodes/process/TranslucentBSDF.js';
90
+ export { PrincipledHair } from './nodes/process/PrincipledHair.js';
91
+ // ── Process nodes — Converter ─────────────────────────────────────────────────
92
+ export { Math as ShaderMath } from './nodes/process/Math.js';
93
+ export { Clamp } from './nodes/process/Clamp.js';
94
+ export { MapRange } from './nodes/process/MapRange.js';
95
+ export { FloatCurve } from './nodes/process/FloatCurve.js';
96
+ export { ShaderToRGB } from './nodes/process/ShaderToRGB.js';
97
+ export { CombineColor } from './nodes/process/CombineColor.js';
98
+ export { SeparateColor } from './nodes/process/SeparateColor.js';
99
+ export { HashValue } from './nodes/process/HashValue.js';
100
+ // ── Script node — custom GLSL as a first-class graph node (OSL equivalent) ───
101
+ export { ShaderScript } from './nodes/process/ShaderScript.js';
102
+ // ── Screen-space / ray-marching nodes ────────────────────────────────────────
103
+ export { ScreenCamera } from './nodes/input/ScreenCamera.js';
104
+ export { SchwarzschildMarch } from './nodes/process/SchwarzschildMarch.js';
105
+ export { ScreenOutput } from './nodes/output/ScreenOutput.js';
106
+ // ── Shader nodes ──────────────────────────────────────────────────────────────
107
+ export { AmbientOcclusion } from './nodes/shader/AmbientOcclusion.js';
108
+ export { RayPortal } from './nodes/shader/RayPortal.js';
@@ -0,0 +1,45 @@
1
+ import { InputNode } from '../../core/InputNode.js';
2
+ import type { NodeMetadata } from '../../core/ShaderNode.js';
3
+ import type { CompileContext } from '../../core/CompileContext.js';
4
+ /**
5
+ * Attribute — Blender "Attribute" input node equivalent.
6
+ * Reads a named custom float or vector attribute from the geometry's BufferAttributes.
7
+ *
8
+ * The attribute must be present on the geometry as a BufferAttribute with the given name.
9
+ * For vec3 attributes: Vector = the attribute value, Fac = length of the vector.
10
+ * For float attributes: Fac = the attribute value, Vector = vec3(value, value, value).
11
+ *
12
+ * Parameters:
13
+ * attributeType (number) — 0 = vec3, 1 = float (numeric for keyframe compat)
14
+ *
15
+ * Outputs:
16
+ * Fac (float) — scalar representation of the attribute value
17
+ * Vector (color) — vec3 representation of the attribute value
18
+ */
19
+ export declare class Attribute extends InputNode {
20
+ get nodeType(): string;
21
+ get metadata(): NodeMetadata;
22
+ /** The raw attribute name as it appears on the BufferGeometry. */
23
+ readonly attributeName: string;
24
+ /** 0 = vec3, 1 = float. Stored as number for keyframe/GSAP compat. */
25
+ parameters: {
26
+ attributeType: number;
27
+ };
28
+ private readonly _outputs;
29
+ /** Sanitized attribute name — only alphanumeric + underscore, used in GLSL. */
30
+ private readonly _safeAttrName;
31
+ constructor(attributeName: string, attributeType?: 'float' | 'vec3');
32
+ getOutputSockets(): Record<string, import("../../core/OutputSocket.js").OutputSocket>;
33
+ vertexInjections(): {
34
+ attrName: string;
35
+ attrType: "float";
36
+ varyingName: string;
37
+ }[] | {
38
+ attrName: string;
39
+ attrType: "vec3";
40
+ varyingName: string;
41
+ }[];
42
+ compileDefs(): string;
43
+ compileCall(ctx: CompileContext): string;
44
+ }
45
+ //# sourceMappingURL=Attribute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Attribute.d.ts","sourceRoot":"","sources":["../../../src/nodes/input/Attribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAElE;;;;;;;;;;;;;;GAcG;AACH,qBAAa,SAAU,SAAQ,SAAS;IACtC,IAAI,QAAQ,WAAyB;IAErC,IAAI,QAAQ,IAAI,YAAY,CAE3B;IAED,kEAAkE;IAClE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAE9B,sEAAsE;IAC7D,UAAU,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAuB;IAErE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmE;IAE5F,+EAA+E;IAC/E,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAQ;gBAE1B,aAAa,EAAE,MAAM,EAAE,aAAa,GAAE,OAAO,GAAG,MAAe;IAW3E,gBAAgB;IAEhB,gBAAgB;;;;;;;;;IAUhB,WAAW,IAAI,MAAM;IAErB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM;CAkBzC"}
@@ -0,0 +1,58 @@
1
+ import { InputNode } from '../../core/InputNode.js';
2
+ /**
3
+ * Attribute — Blender "Attribute" input node equivalent.
4
+ * Reads a named custom float or vector attribute from the geometry's BufferAttributes.
5
+ *
6
+ * The attribute must be present on the geometry as a BufferAttribute with the given name.
7
+ * For vec3 attributes: Vector = the attribute value, Fac = length of the vector.
8
+ * For float attributes: Fac = the attribute value, Vector = vec3(value, value, value).
9
+ *
10
+ * Parameters:
11
+ * attributeType (number) — 0 = vec3, 1 = float (numeric for keyframe compat)
12
+ *
13
+ * Outputs:
14
+ * Fac (float) — scalar representation of the attribute value
15
+ * Vector (color) — vec3 representation of the attribute value
16
+ */
17
+ export class Attribute extends InputNode {
18
+ get nodeType() { return 'Attribute'; }
19
+ get metadata() {
20
+ return { label: 'Attribute', category: 'Input', color: '#3d6b96', cost: 'low' };
21
+ }
22
+ constructor(attributeName, attributeType = 'vec3') {
23
+ super('Attribute');
24
+ /** 0 = vec3, 1 = float. Stored as number for keyframe/GSAP compat. */
25
+ this.parameters = { attributeType: 0 };
26
+ // SECURITY: sanitize the attribute name for safe use in GLSL identifiers
27
+ this._safeAttrName = attributeName.replace(/[^a-zA-Z0-9_]/g, '_');
28
+ this.attributeName = attributeName;
29
+ this.parameters.attributeType = attributeType === 'float' ? 1 : 0;
30
+ this._outputs = this.createOutputs({ Fac: 'float', Vector: 'color' });
31
+ }
32
+ getOutputSockets() { return this._outputs; }
33
+ vertexInjections() {
34
+ const isFloat = this.parameters.attributeType === 1;
35
+ const varyingName = `vAttr_${this._safeAttrName}`;
36
+ if (isFloat) {
37
+ return [{ attrName: this.attributeName, attrType: 'float', varyingName }];
38
+ }
39
+ return [{ attrName: this.attributeName, attrType: 'vec3', varyingName }];
40
+ }
41
+ compileDefs() { return ''; }
42
+ compileCall(ctx) {
43
+ const isFloat = this.parameters.attributeType === 1;
44
+ const varyingName = `vAttr_${this._safeAttrName}`;
45
+ const outFac = ctx.outputVar(this, 'Fac');
46
+ const outVector = ctx.outputVar(this, 'Vector');
47
+ if (isFloat) {
48
+ return [
49
+ `float ${outFac} = ${varyingName};`,
50
+ `vec3 ${outVector} = vec3(${varyingName}, ${varyingName}, ${varyingName});`,
51
+ ].join('\n ');
52
+ }
53
+ return [
54
+ `vec3 ${outVector} = ${varyingName};`,
55
+ `float ${outFac} = length(${varyingName});`,
56
+ ].join('\n ');
57
+ }
58
+ }
@@ -0,0 +1,21 @@
1
+ import { InputNode } from '../../core/InputNode.js';
2
+ import type { NodeMetadata } from '../../core/ShaderNode.js';
3
+ import type { CompileContext } from '../../core/CompileContext.js';
4
+ /**
5
+ * Camera Data — Blender "Camera Data" input node equivalent.
6
+ * Provides camera-relative metrics for the current surface point.
7
+ *
8
+ * Outputs:
9
+ * ViewDistance (float) — distance from surface to camera
10
+ * ViewZDepth (float) — camera-space Z depth
11
+ * ViewVector (color/vec3) — normalised direction from surface to camera
12
+ */
13
+ export declare class CameraData extends InputNode {
14
+ get nodeType(): string;
15
+ get metadata(): NodeMetadata;
16
+ private readonly _outputs;
17
+ constructor();
18
+ getOutputSockets(): Record<string, import("../../core/OutputSocket.js").OutputSocket>;
19
+ compileCall(ctx: CompileContext): string;
20
+ }
21
+ //# sourceMappingURL=CameraData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CameraData.d.ts","sourceRoot":"","sources":["../../../src/nodes/input/CameraData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAElE;;;;;;;;GAQG;AACH,qBAAa,UAAW,SAAQ,SAAS;IACvC,IAAI,QAAQ,WAA0B;IAEtC,IAAI,QAAQ,IAAI,YAAY,CAE3B;IAED,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmE;;IAW5F,gBAAgB;IAEhB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM;CAQzC"}
@@ -0,0 +1,33 @@
1
+ import { InputNode } from '../../core/InputNode.js';
2
+ /**
3
+ * Camera Data — Blender "Camera Data" input node equivalent.
4
+ * Provides camera-relative metrics for the current surface point.
5
+ *
6
+ * Outputs:
7
+ * ViewDistance (float) — distance from surface to camera
8
+ * ViewZDepth (float) — camera-space Z depth
9
+ * ViewVector (color/vec3) — normalised direction from surface to camera
10
+ */
11
+ export class CameraData extends InputNode {
12
+ get nodeType() { return 'CameraData'; }
13
+ get metadata() {
14
+ return { label: 'Camera Data', category: 'Input', color: '#3d6b96', cost: 'low' };
15
+ }
16
+ constructor() {
17
+ super('CameraData');
18
+ this._outputs = this.createOutputs({
19
+ ViewDistance: 'float',
20
+ ViewZDepth: 'float',
21
+ ViewVector: 'color',
22
+ });
23
+ }
24
+ getOutputSockets() { return this._outputs; }
25
+ compileCall(ctx) {
26
+ return [
27
+ `vec3 _cd_toCamera_${this.id} = cameraPosition - vPosition;`,
28
+ `float ${ctx.outputVar(this, 'ViewDistance')} = length(_cd_toCamera_${this.id});`,
29
+ `float ${ctx.outputVar(this, 'ViewZDepth')} = -gl_FragCoord.z;`,
30
+ `vec3 ${ctx.outputVar(this, 'ViewVector')} = normalize(_cd_toCamera_${this.id});`,
31
+ ].join('\n ');
32
+ }
33
+ }
@@ -0,0 +1,28 @@
1
+ import { InputNode } from '../../core/InputNode.js';
2
+ import type { NodeMetadata } from '../../core/ShaderNode.js';
3
+ import type { CompileContext } from '../../core/CompileContext.js';
4
+ /**
5
+ * Color Attribute — Blender "Color Attribute" input node equivalent.
6
+ * Reads vertex colour data painted onto the mesh.
7
+ * Requires the geometry to have a 'color' BufferAttribute.
8
+ * Falls back to white if the attribute is not present.
9
+ *
10
+ * Outputs:
11
+ * Color (color) — vertex colour RGB
12
+ * Alpha (float) — vertex colour alpha
13
+ */
14
+ export declare class ColorAttribute extends InputNode {
15
+ get nodeType(): string;
16
+ get metadata(): NodeMetadata;
17
+ private readonly _outputs;
18
+ constructor();
19
+ getOutputSockets(): Record<string, import("../../core/OutputSocket.js").OutputSocket>;
20
+ vertexInjections(): {
21
+ attrName: string;
22
+ attrType: "vec3";
23
+ varyingName: string;
24
+ }[];
25
+ compileDefs(): string;
26
+ compileCall(ctx: CompileContext): string;
27
+ }
28
+ //# sourceMappingURL=ColorAttribute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorAttribute.d.ts","sourceRoot":"","sources":["../../../src/nodes/input/ColorAttribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAElE;;;;;;;;;GASG;AACH,qBAAa,cAAe,SAAQ,SAAS;IAC3C,IAAI,QAAQ,WAA8B;IAE1C,IAAI,QAAQ,IAAI,YAAY,CAE3B;IAED,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmE;;IAO5F,gBAAgB;IAEhB,gBAAgB;;;;;IAIhB,WAAW,IAAI,MAAM;IAErB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM;CAMzC"}
@@ -0,0 +1,32 @@
1
+ import { InputNode } from '../../core/InputNode.js';
2
+ /**
3
+ * Color Attribute — Blender "Color Attribute" input node equivalent.
4
+ * Reads vertex colour data painted onto the mesh.
5
+ * Requires the geometry to have a 'color' BufferAttribute.
6
+ * Falls back to white if the attribute is not present.
7
+ *
8
+ * Outputs:
9
+ * Color (color) — vertex colour RGB
10
+ * Alpha (float) — vertex colour alpha
11
+ */
12
+ export class ColorAttribute extends InputNode {
13
+ get nodeType() { return 'ColorAttribute'; }
14
+ get metadata() {
15
+ return { label: 'Color Attribute', category: 'Input', color: '#3d6b96', cost: 'low' };
16
+ }
17
+ constructor() {
18
+ super('ColorAttribute');
19
+ this._outputs = this.createOutputs({ Color: 'color', Alpha: 'float' });
20
+ }
21
+ getOutputSockets() { return this._outputs; }
22
+ vertexInjections() {
23
+ return [{ attrName: 'color', attrType: 'vec3', varyingName: 'vColor' }];
24
+ }
25
+ compileDefs() { return ''; }
26
+ compileCall(ctx) {
27
+ return [
28
+ `vec3 ${ctx.outputVar(this, 'Color')} = vColor;`,
29
+ `float ${ctx.outputVar(this, 'Alpha')} = 1.0;`,
30
+ ].join('\n ');
31
+ }
32
+ }
@@ -0,0 +1,23 @@
1
+ import { InputNode } from '../../core/InputNode.js';
2
+ import type { NodeMetadata } from '../../core/ShaderNode.js';
3
+ import type { CompileContext } from '../../core/CompileContext.js';
4
+ /**
5
+ * Geometry — Blender "Geometry" input node equivalent.
6
+ * Provides raw geometric data about the current surface point.
7
+ *
8
+ * Outputs:
9
+ * Position (color/vec3) — world space position
10
+ * Normal (color/vec3) — interpolated surface normal
11
+ * TrueNormal(color/vec3) — flat face normal
12
+ * Incoming (color/vec3) — direction from camera to surface
13
+ * Backfacing(float) — 1.0 if back face, 0.0 if front
14
+ */
15
+ export declare class Geometry extends InputNode {
16
+ get nodeType(): string;
17
+ get metadata(): NodeMetadata;
18
+ private readonly _outputs;
19
+ constructor();
20
+ getOutputSockets(): Record<string, import("../../core/OutputSocket.js").OutputSocket>;
21
+ compileCall(ctx: CompileContext): string;
22
+ }
23
+ //# sourceMappingURL=Geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Geometry.d.ts","sourceRoot":"","sources":["../../../src/nodes/input/Geometry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAElE;;;;;;;;;;GAUG;AACH,qBAAa,QAAS,SAAQ,SAAS;IACrC,IAAI,QAAQ,WAAwB;IAEpC,IAAI,QAAQ,IAAI,YAAY,CAE3B;IAED,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmE;;IAa5F,gBAAgB;IAEhB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM;CASzC"}
@@ -0,0 +1,38 @@
1
+ import { InputNode } from '../../core/InputNode.js';
2
+ /**
3
+ * Geometry — Blender "Geometry" input node equivalent.
4
+ * Provides raw geometric data about the current surface point.
5
+ *
6
+ * Outputs:
7
+ * Position (color/vec3) — world space position
8
+ * Normal (color/vec3) — interpolated surface normal
9
+ * TrueNormal(color/vec3) — flat face normal
10
+ * Incoming (color/vec3) — direction from camera to surface
11
+ * Backfacing(float) — 1.0 if back face, 0.0 if front
12
+ */
13
+ export class Geometry extends InputNode {
14
+ get nodeType() { return 'Geometry'; }
15
+ get metadata() {
16
+ return { label: 'Geometry', category: 'Input', color: '#3d6b96', cost: 'low' };
17
+ }
18
+ constructor() {
19
+ super('Geometry');
20
+ this._outputs = this.createOutputs({
21
+ Position: 'color',
22
+ Normal: 'color',
23
+ TrueNormal: 'color',
24
+ Incoming: 'color',
25
+ Backfacing: 'float',
26
+ });
27
+ }
28
+ getOutputSockets() { return this._outputs; }
29
+ compileCall(ctx) {
30
+ return [
31
+ `vec3 ${ctx.outputVar(this, 'Position')} = vPosition;`,
32
+ `vec3 ${ctx.outputVar(this, 'Normal')} = normalize(vNormal);`,
33
+ `vec3 ${ctx.outputVar(this, 'TrueNormal')} = normalize(cross(dFdx(vPosition), dFdy(vPosition)));`,
34
+ `vec3 ${ctx.outputVar(this, 'Incoming')} = normalize(vPosition - cameraPosition);`,
35
+ `float ${ctx.outputVar(this, 'Backfacing')} = gl_FrontFacing ? 0.0 : 1.0;`,
36
+ ].join('\n ');
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ import { InputNode } from '../../core/InputNode.js';
2
+ import type { NodeMetadata } from '../../core/ShaderNode.js';
3
+ import type { CompileContext } from '../../core/CompileContext.js';
4
+ /**
5
+ * Hair Info — Blender "Hair Info" input node equivalent.
6
+ * Reads per-vertex strand data written by st-hair-core buildTubeGeometry /
7
+ * buildRibbonGeometry into the strandTangent and strandRandom attributes.
8
+ *
9
+ * Geometry requirements (tube or ribbon from st-hair-core):
10
+ * attribute vec3 strandTangent — tangent along strand axis at this vertex
11
+ * attribute float strandRandom — per-strand uniform random value [0,1]
12
+ * vUv.y — 0 at root, 1 at tip
13
+ *
14
+ * Outputs:
15
+ * IsStrand (float) — always 1.0 (use to mix with surface shader)
16
+ * Intercept (float) — 0.0 at root → 1.0 at tip
17
+ * Length (float) — 1.0 (normalised; actual length lives in the generator)
18
+ * TangentNormal (color) — unit tangent direction along the strand
19
+ * Random (float) — per-strand random value in [0, 1]
20
+ */
21
+ export declare class HairInfo extends InputNode {
22
+ get nodeType(): string;
23
+ get metadata(): NodeMetadata;
24
+ private readonly _outputs;
25
+ constructor();
26
+ getOutputSockets(): Record<string, import("../../core/OutputSocket.js").OutputSocket>;
27
+ vertexInjections(): ({
28
+ attrName: string;
29
+ attrType: "vec3";
30
+ varyingName: string;
31
+ } | {
32
+ attrName: string;
33
+ attrType: "float";
34
+ varyingName: string;
35
+ })[];
36
+ compileCall(ctx: CompileContext): string;
37
+ }
38
+ //# sourceMappingURL=HairInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HairInfo.d.ts","sourceRoot":"","sources":["../../../src/nodes/input/HairInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAElE;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,QAAS,SAAQ,SAAS;IACrC,IAAI,QAAQ,WAAwB;IAEpC,IAAI,QAAQ,IAAI,YAAY,CAE3B;IAED,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmE;;IAa5F,gBAAgB;IAEhB,gBAAgB;;;;;;;;;IAOhB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM;CASzC"}
@@ -0,0 +1,50 @@
1
+ import { InputNode } from '../../core/InputNode.js';
2
+ /**
3
+ * Hair Info — Blender "Hair Info" input node equivalent.
4
+ * Reads per-vertex strand data written by st-hair-core buildTubeGeometry /
5
+ * buildRibbonGeometry into the strandTangent and strandRandom attributes.
6
+ *
7
+ * Geometry requirements (tube or ribbon from st-hair-core):
8
+ * attribute vec3 strandTangent — tangent along strand axis at this vertex
9
+ * attribute float strandRandom — per-strand uniform random value [0,1]
10
+ * vUv.y — 0 at root, 1 at tip
11
+ *
12
+ * Outputs:
13
+ * IsStrand (float) — always 1.0 (use to mix with surface shader)
14
+ * Intercept (float) — 0.0 at root → 1.0 at tip
15
+ * Length (float) — 1.0 (normalised; actual length lives in the generator)
16
+ * TangentNormal (color) — unit tangent direction along the strand
17
+ * Random (float) — per-strand random value in [0, 1]
18
+ */
19
+ export class HairInfo extends InputNode {
20
+ get nodeType() { return 'HairInfo'; }
21
+ get metadata() {
22
+ return { label: 'Hair Info', category: 'Input', color: '#5a3a1a', cost: 'low' };
23
+ }
24
+ constructor() {
25
+ super('HairInfo');
26
+ this._outputs = this.createOutputs({
27
+ IsStrand: 'float',
28
+ Intercept: 'float',
29
+ Length: 'float',
30
+ TangentNormal: 'color',
31
+ Random: 'float',
32
+ });
33
+ }
34
+ getOutputSockets() { return this._outputs; }
35
+ vertexInjections() {
36
+ return [
37
+ { attrName: 'strandTangent', attrType: 'vec3', varyingName: 'vStrandTangent' },
38
+ { attrName: 'strandRandom', attrType: 'float', varyingName: 'vStrandRandom' },
39
+ ];
40
+ }
41
+ compileCall(ctx) {
42
+ return [
43
+ `float ${ctx.outputVar(this, 'IsStrand')} = 1.0;`,
44
+ `float ${ctx.outputVar(this, 'Intercept')} = vUv.y;`,
45
+ `float ${ctx.outputVar(this, 'Length')} = 1.0;`,
46
+ `vec3 ${ctx.outputVar(this, 'TangentNormal')} = normalize(vStrandTangent);`,
47
+ `float ${ctx.outputVar(this, 'Random')} = vStrandRandom;`,
48
+ ].join('\n ');
49
+ }
50
+ }
@@ -0,0 +1,26 @@
1
+ import { InputNode } from '../../core/InputNode.js';
2
+ import type { NodeMetadata } from '../../core/ShaderNode.js';
3
+ import type { CompileContext } from '../../core/CompileContext.js';
4
+ /**
5
+ * Layer Weight — Blender "Layer Weight" input node equivalent.
6
+ * Generates blend factors based on viewing angle.
7
+ * Useful for edge blending and layering materials.
8
+ *
9
+ * Outputs:
10
+ * Fresnel (float) — physically-based Fresnel factor
11
+ * Facing (float) — 0.0 at grazing, 1.0 facing camera
12
+ */
13
+ export declare class LayerWeight extends InputNode {
14
+ get nodeType(): string;
15
+ get metadata(): NodeMetadata;
16
+ parameters: {
17
+ blend: number;
18
+ };
19
+ private readonly _outputs;
20
+ constructor(inputs?: {
21
+ blend?: number;
22
+ } | number);
23
+ getOutputSockets(): Record<string, import("../../core/OutputSocket.js").OutputSocket>;
24
+ compileCall(ctx: CompileContext): string;
25
+ }
26
+ //# sourceMappingURL=LayerWeight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayerWeight.d.ts","sourceRoot":"","sources":["../../../src/nodes/input/LayerWeight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAElE;;;;;;;;GAQG;AACH,qBAAa,WAAY,SAAQ,SAAS;IACxC,IAAI,QAAQ,WAA2B;IAEvC,IAAI,QAAQ,IAAI,YAAY,CAE3B;IAED,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmE;gBAEhF,MAAM,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAW;IAOpD,gBAAgB;IAEhB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM;CAYzC"}
@@ -0,0 +1,35 @@
1
+ import { InputNode } from '../../core/InputNode.js';
2
+ /**
3
+ * Layer Weight — Blender "Layer Weight" input node equivalent.
4
+ * Generates blend factors based on viewing angle.
5
+ * Useful for edge blending and layering materials.
6
+ *
7
+ * Outputs:
8
+ * Fresnel (float) — physically-based Fresnel factor
9
+ * Facing (float) — 0.0 at grazing, 1.0 facing camera
10
+ */
11
+ export class LayerWeight extends InputNode {
12
+ get nodeType() { return 'LayerWeight'; }
13
+ get metadata() {
14
+ return { label: 'Layer Weight', category: 'Input', color: '#3d6b96', cost: 'low' };
15
+ }
16
+ constructor(inputs = {}) {
17
+ super('LayerWeight');
18
+ const blend = typeof inputs === 'number' ? inputs : (inputs.blend ?? 0.5);
19
+ this.parameters = { blend: Math.max(0.0001, blend) };
20
+ this._outputs = this.createOutputs({ Fresnel: 'float', Facing: 'float' });
21
+ }
22
+ getOutputSockets() { return this._outputs; }
23
+ compileCall(ctx) {
24
+ const b = this.parameters.blend.toFixed(4);
25
+ return [
26
+ `vec3 _lw_N_${this.id} = normalize(vNormal);`,
27
+ `vec3 _lw_V_${this.id} = normalize(cameraPosition - vPosition);`,
28
+ `float _lw_c_${this.id} = max(dot(_lw_N_${this.id}, _lw_V_${this.id}), 0.0);`,
29
+ `float _lw_ior_${this.id} = 1.0 / max(1.0 - ${b}, 0.0001);`,
30
+ `float _lw_F0_${this.id} = pow((_lw_ior_${this.id} - 1.0) / (_lw_ior_${this.id} + 1.0), 2.0);`,
31
+ `float ${ctx.outputVar(this, 'Fresnel')} = _lw_F0_${this.id} + (1.0 - _lw_F0_${this.id}) * pow(1.0 - _lw_c_${this.id}, 5.0);`,
32
+ `float ${ctx.outputVar(this, 'Facing')} = pow(1.0 - _lw_c_${this.id}, max(1.0 - ${b} + 0.0001, 0.0001));`,
33
+ ].join('\n ');
34
+ }
35
+ }
@@ -0,0 +1,60 @@
1
+ import { InputNode } from '../../core/InputNode.js';
2
+ import type { NodeMetadata } from '../../core/ShaderNode.js';
3
+ import type { CompileContext } from '../../core/CompileContext.js';
4
+ /**
5
+ * Light Path — Blender "Light Path" input node equivalent.
6
+ *
7
+ * Outputs the ray type currently being rendered, driven by externally-set
8
+ * uniforms. In rasterizer mode the uniforms default to camera-ray values
9
+ * (Is Camera Ray = 1, all others = 0).
10
+ *
11
+ * To drive a full multi-pass render where shadow/bounce contributions are
12
+ * separated, use LightPathController from @st-pathtracer-core, which sets
13
+ * these uniforms before each render pass.
14
+ *
15
+ * Uniform names are available on LightPath.U for external use.
16
+ *
17
+ * Outputs (all float):
18
+ * Is Camera Ray, Is Shadow Ray, Is Diffuse Ray, Is Glossy Ray,
19
+ * Is Singular Ray, Is Reflection Ray, Is Transmission Ray,
20
+ * Ray Length, Ray Depth, Diffuse Depth, Glossy Depth,
21
+ * Shadow Depth, Transparent Depth, Transmission Depth
22
+ */
23
+ export declare class LightPath extends InputNode {
24
+ get nodeType(): string;
25
+ get metadata(): NodeMetadata;
26
+ readonly parameters: Record<string, never>;
27
+ private readonly _outputs;
28
+ /**
29
+ * Canonical uniform names used by LightPath.
30
+ * LightPathController sets these on the compiled ShaderMaterial.
31
+ */
32
+ static readonly U: {
33
+ readonly isCamera: "u_st_lp_isCamera";
34
+ readonly isShadow: "u_st_lp_isShadow";
35
+ readonly isDiffuse: "u_st_lp_isDiffuse";
36
+ readonly isGlossy: "u_st_lp_isGlossy";
37
+ readonly isSingular: "u_st_lp_isSingular";
38
+ readonly isReflection: "u_st_lp_isReflection";
39
+ readonly isTransmission: "u_st_lp_isTransmission";
40
+ readonly rayLength: "u_st_lp_rayLength";
41
+ readonly rayDepth: "u_st_lp_rayDepth";
42
+ readonly diffuseDepth: "u_st_lp_diffuseDepth";
43
+ readonly glossyDepth: "u_st_lp_glossyDepth";
44
+ readonly shadowDepth: "u_st_lp_shadowDepth";
45
+ readonly transparentDepth: "u_st_lp_transparentDepth";
46
+ readonly transmissionDepth: "u_st_lp_transmissionDepth";
47
+ };
48
+ constructor();
49
+ getOutputSockets(): Record<string, import("../../core/OutputSocket.js").OutputSocket>;
50
+ /**
51
+ * Register all LightPath uniforms with their rasterizer defaults.
52
+ * CompileContext picks these up and includes them in the compiled
53
+ * material's uniforms object so LightPathController can set them.
54
+ * Default: Is Camera Ray = 1.0, all others = 0.0.
55
+ */
56
+ extraUniforms(): Record<string, number>;
57
+ compileDefs(): string;
58
+ compileCall(ctx: CompileContext): string;
59
+ }
60
+ //# sourceMappingURL=LightPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LightPath.d.ts","sourceRoot":"","sources":["../../../src/nodes/input/LightPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAElE;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,SAAU,SAAQ,SAAS;IACtC,IAAI,QAAQ,WAAyB;IAErC,IAAI,QAAQ,IAAI,YAAY,CAE3B;IAED,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAK;IAE/C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmE;IAE5F;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,CAAC;;;;;;;;;;;;;;;MAeP;;IAsBV,gBAAgB;IAEhB;;;;;OAKG;IACH,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAoBvC,WAAW,IAAI,MAAM;IAErB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM;CAmBzC"}