Advertisement
Guest User

Materiaux lave

a guest
Sep 14th, 2015
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 71.88 KB | None | 0 0
  1. set cut_paste_input [stack 0]
  2. version 8.0 v1
  3. push $cut_paste_input
  4. Group {
  5. name mat_lava
  6. tile_color 0xff3200ff
  7. selected true
  8. xpos 7938
  9. ypos 4791
  10. addUserKnob {20 mat_lava}
  11. addUserKnob {41 color T Constant4.color}
  12. addUserKnob {41 color_1 l color T Constant5.color}
  13. addUserKnob {41 lavaLevel T NoOp1.lavaLevel}
  14. addUserKnob {41 level_smooth T NoOp1.level_smooth}
  15. addUserKnob {20 TAGS}
  16. addUserKnob {1 Asset_name}
  17. addUserKnob {1 Asset_type}
  18. addUserKnob {1 Class}
  19. Class BD_Etalo
  20. addUserKnob {1 Backdrop_type}
  21. addUserKnob {1 Color}
  22. addUserKnob {1 EXR_version}
  23. addUserKnob {1 Misc}
  24. Misc RecompositionTree
  25. addUserKnob {1 Exit}
  26. }
  27. Input {
  28. inputs 0
  29. name pointWorld
  30. xpos 400
  31. ypos 278
  32. }
  33. Dot {
  34. name Dot1
  35. xpos 434
  36. ypos 402
  37. }
  38. set N49271450 [stack 0]
  39. Group {
  40. name WPosToNoise1
  41. tile_color 0x308fffff
  42. xpos 620
  43. ypos 518
  44. addUserKnob {20 WPosToNoise}
  45. addUserKnob {6 red +STARTLINE}
  46. addUserKnob {6 green -STARTLINE}
  47. green true
  48. addUserKnob {6 blue -STARTLINE}
  49. blue true
  50. addUserKnob {6 rgb_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
  51. addUserKnob {41 noiseType T PToN_exp.noiseType}
  52. addUserKnob {41 octaves l Octaves -STARTLINE T PToN_exp.octaves}
  53. addUserKnob {41 Worley3D_Seed l "Seed (Worley)" -STARTLINE T BlinkScript1.Worley3D_Seed}
  54. addUserKnob {41 uniform_scale l "uniform scale" T Axis1.uniform_scale}
  55. addUserKnob {41 lacunarity l Lacunarity T PToN_exp.lacunarity}
  56. addUserKnob {41 gain l Gain T PToN_exp.gain}
  57. addUserKnob {41 Worley3D_Displacement l Displacement t "Worley Only" T BlinkScript1.Worley3D_Displacement}
  58. addUserKnob {6 invert l Invert +STARTLINE}
  59. addUserKnob {26 ""}
  60. addUserKnob {20 transform l "Transform 3D" n 1}
  61. addUserKnob {41 translate T Axis1.translate}
  62. addUserKnob {41 rotate T Axis1.rotate}
  63. addUserKnob {41 scaling l scale T Axis1.scaling}
  64. addUserKnob {20 endGroup_1 l endGroup n -1}
  65. addUserKnob {20 HelpTab l Help}
  66. addUserKnob {26 Help l "" +STARTLINE T "\nNoise: \nCe node permet de mapper (en environnement) toute votre scene avec un noise 3D parametrable. \nIl vous suffit pour ca de lui donner a manger une passe de position Max/Vray. \n\nTout les parametres n'ont pas d'utilite pour tout les noises \n(Exemple: Lacunarity n'a aucune utilite pour le Worley)\n\n\nTranform:\nVous pouvez animer votre Noise en utilisant les options de translate. \n\nOptionnellement, vous pouvez brancher des Axis animes, provenant ou non de softs externes.\n (Attention a bien convertir vos axis en axis Max)"}
  67. addUserKnob {20 About}
  68. addUserKnob {26 About_1 l "" +STARTLINE T "WPosToNoise 1.0 by Noss : bruno.ortolland@gmail.com\n\nWorley blinkscript by Ivan Busquets"}
  69. }
  70. Input {
  71. inputs 0
  72. name pointPosition
  73. xpos 70
  74. ypos -466
  75. }
  76. Grade {
  77. add {{parent.Axis1.world_matrix.3} {parent.Axis1.world_matrix.7} {parent.Axis1.world_matrix.11} 0}
  78. black_clamp false
  79. name Grade1
  80. xpos 70
  81. ypos -394
  82. }
  83. ColorMatrix {
  84. matrix {
  85. {{parent.Axis1.world_matrix.0} {parent.Axis1.world_matrix.1} {parent.Axis1.world_matrix.2}}
  86. {{parent.Axis1.world_matrix.4} {parent.Axis1.world_matrix.5} {parent.Axis1.world_matrix.6}}
  87. {{parent.Axis1.world_matrix.8} {parent.Axis1.world_matrix.9} {parent.Axis1.world_matrix.10}}
  88. }
  89. name ColorMatrix1
  90. xpos 70
  91. ypos -346
  92. }
  93. Dot {
  94. name Dot4
  95. xpos 104
  96. ypos -198
  97. }
  98. set N49272210 [stack 0]
  99. Dot {
  100. name Dot6
  101. xpos 324
  102. ypos -198
  103. }
  104. set N49272580 [stack 0]
  105. Dot {
  106. name Dot5
  107. xpos 544
  108. ypos -198
  109. }
  110. ColorMatrix {
  111. matrix {
  112. {-4.371138829e-008 0 1}
  113. {0 1 0}
  114. {-1 0 -4.371138829e-008}
  115. }
  116. name ColorMatrix3
  117. xpos 510
  118. ypos -154
  119. }
  120. Dot {
  121. name Dot3
  122. xpos 544
  123. ypos -128
  124. }
  125. set N49272fd0 [stack 0]
  126. BlinkScript {
  127. ProgramGroup 1
  128. KernelDescription "1 \"Worley3D\" iterate pixelWise 45291152b7d71735741f26b17f4d23bdf56ad567aabfa36c1b2c3f23a430c4b8 2 \"worldP\" Read Point \"dst\" Write Point 8 \"Offset\" Float 3 AAAAAAAAAAAAAAAAAAAAAA== \"Frequency\" Float 1 AABAQA== \"Seed\" Int 1 AAAAAA== \"Displacement\" Float 1 AAAAAA== \"Distance\" Bool 1 AQ== \"Invert\" Bool 1 AQ== \"Cell size\" Float 1 AAAAAA== \"Cell softness\" Float 1 AACAPw=="
  129. kernelSource "// worley3D.blink\n// Create noise based on world position pass\n\n#define X_NOISE_GEN 1619\n#define Y_NOISE_GEN 31337\n#define Z_NOISE_GEN 6971\n#define SEED_NOISE_GEN 1013\n#define SQRT_3 1.73205081\n\ninline int IntValueNoise3D (int x, int y, int z, int seed)\n\{\n // All constants are primes and must remain prime in order for this noise\n // function to work correctly.\n int n = (\n X_NOISE_GEN * x\n + Y_NOISE_GEN * y\n + Z_NOISE_GEN * z\n + SEED_NOISE_GEN * seed)\n & 0x7fffffff;\n n = (n >> 13) ^ n;\n return (n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff;\n\}\n\ninline float ValueNoise3D (int x, int y, int z, int seed)\n\{\n return 1.0 - ((float)IntValueNoise3D (x, y, z, seed) / 1073741824.0);\n\}\n\nkernel Worley3D : ImageComputationKernel<ePixelWise>\n\{\n Image<eRead, eAccessPoint, eEdgeClamped> worldP; //the input image\n Image<eWrite, eAccessPoint> dst;\n\n param:\n float3 offset;\n float frequency;\n int seed;\n float displacement;\n bool distance;\n bool invert;\n float cell_size;\n float cell_softness;\n //int type;\n\n void define() \{\n defineParam(distance, \"Distance\", true);\n defineParam(offset, \"Offset\", float3(0.0f, 0.0f, 0.0f));\n defineParam(frequency, \"Frequency\", 3.0f);\n defineParam(displacement, \"Displacement\", 0.0f);\n defineParam(seed, \"Seed\", 0);\n defineParam(cell_size, \"Cell size\", 0.0f);\n defineParam(cell_softness, \"Cell softness\", 1.0f);\n defineParam(invert, \"Invert\", true);\n //defineParam(type, \"Type\", 0);\n \}\n\n void init() \{\n \}\n\n void process( int2 pos ) \{\n float value = 0.0;\n if ( worldP.kComps > 2 ) \{\n const float wx = worldP(0);\n const float wy = worldP(1);\n const float wz = worldP(2);\n\n float x = (wx - offset.x) * frequency;\n float y = (wy - offset.y) * frequency;\n float z = (wz - offset.z) * frequency;\n int xInt = (int)x; //(x > 0.0? (int)x: (int)x - 1);\n int yInt = (int)y; //(y > 0.0? (int)y: (int)y - 1);\n int zInt = (int)z; //(z > 0.0? (int)z: (int)z - 1);\n\n float minDist = 2147483647.0;\n float xF1 = 0;\n float yF1 = 0;\n float zF1 = 0;\n float xF2 = 0;\n float yF2 = 0;\n float zF2 = 0;\n\n float dist;\n\n for (int yCur = yInt - 2; yCur <= yInt + 2; yCur++) \{\n for (int xCur = xInt - 2; xCur <= xInt + 2; xCur++) \{\n for (int zCur = zInt - 2; zCur <= zInt + 2; zCur++) \{\n // Calculate the position and distance to the seed point inside of\n // this unit cube.\n float xPos = xCur + ValueNoise3D(xCur, yCur, zCur, seed );\n float yPos = yCur + ValueNoise3D(xCur, yCur, zCur, seed + 1);\n float zPos = zCur + ValueNoise3D(xCur, yCur, zCur, seed + 2);\n\n float xDist = xPos - x;\n float yDist = yPos - y;\n float zDist = zPos - z;\n\n dist = xDist * xDist + yDist * yDist + zDist * zDist;\n if (dist < minDist) \{\n // This seed point is closer to any others found so far, so record\n // this seed point.\n minDist = dist;\n xF2 = xF1;\n yF2 = yF1;\n xF2 = zF1;\n xF1 = xPos;\n yF1 = yPos;\n zF1 = zPos;\n \}\n \}\n \}\n \}\n\n float F1 = 0.0;\n float F2 = 0.0;\n if (distance) \{\n // Determine the distance to the nearest seed point.\n float xDist = xF1 - x;\n float yDist = yF1 - y;\n float zDist = zF1 - z;\n F1 = xDist*xDist + yDist*yDist + zDist*zDist;\n xDist = xF2 - x;\n yDist = yF2 - y;\n zDist = zF2 - z;\n F2 = xDist*xDist + yDist*yDist + zDist*zDist;\n \}\n value = F1;\n /*\n if ( type == 1 ) \{\n value = F2;\n \} else \{\n if ( type == 2 ) \{\n value = F1 * F2;\n \} else \{\n if ( type == 3 ) \{\n value = F2 - F1;\n \} else \{\n if ( type == 4 ) \{\n value = F1 + F2;\n \}\n \}\n \}\n \}\n */\n value += (displacement * (float)ValueNoise3D( (int)(floor(xF1)), (int)(floor(yF1)), (int)(floor(zF1)), seed)) + displacement;\n\n value = ((value - cell_size)*(1/cell_softness));\n\n if (invert) \{\n value = 1 - value;\n \}\n \} else \{\n value = 0.0f;\n \}\n for (int c = 0; c < dst.kComps; c++)\n dst(c) = value;\n \}\n\};\n\n"
  130. rebuild ""
  131. Worley3D_Frequency {{parent.Axis1.uniform_scale}}
  132. Worley3D_Seed 1
  133. Worley3D_Cellsoftness 0
  134. maxGPUMemory 53
  135. maxTileLines 15.5
  136. name BlinkScript3
  137. xpos 620
  138. ypos -64
  139. }
  140. push $N49272fd0
  141. ColorMatrix {
  142. matrix {
  143. {1 0 0}
  144. {0 0.7071067691 -0.7071067691}
  145. {0 0.7071067691 0.7071067691}
  146. }
  147. name ColorMatrix6
  148. xpos 510
  149. ypos -58
  150. }
  151. Expression {
  152. channel0 rgb
  153. expr0 "\[value PToN_exp.noiseType](r*axisScale.x*scale,g*axisScale.y*scale,b*axisScale.z*scale,octaves,lacunarity,gain)"
  154. channel1 {-rgba.red -rgba.green -rgba.blue none}
  155. channel2 {-rgba.red -rgba.green -rgba.blue none}
  156. name PToN_exp2
  157. xpos 510
  158. ypos -34
  159. addUserKnob {20 User}
  160. addUserKnob {13 axisScale}
  161. axisScale {{parent.Axis1.scaling.x} {parent.Axis1.scaling.y} {parent.Axis1.scaling.z}}
  162. addUserKnob {20 endGroup n -1}
  163. addUserKnob {7 scale R 0.01 10}
  164. scale {{parent.Axis1.uniform_scale}}
  165. addUserKnob {20 endGroup_1 l endGroup n -1}
  166. addUserKnob {3 octaves l Octaves}
  167. octaves {{parent.PToN_exp1.octaves}}
  168. addUserKnob {7 lacunarity l Lacunarity R 1 10}
  169. lacunarity {{parent.PToN_exp1.lacunarity}}
  170. addUserKnob {7 gain l Gain R 0.1 1}
  171. gain {{parent.PToN_exp1.gain}}
  172. addUserKnob {6 center_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
  173. addUserKnob {4 noiseType M {fBm turbulence worley "" ""}}
  174. }
  175. Grade {
  176. black 0.5
  177. name Grade4
  178. xpos 510
  179. ypos -8
  180. }
  181. Switch {
  182. inputs 2
  183. which {{"parent.PToN_exp.noiseType == 2 "}}
  184. name Switch3
  185. xpos 510
  186. ypos 62
  187. }
  188. Expression {
  189. expr0 0
  190. expr1 0
  191. expr2 b
  192. name Expression2
  193. xpos 510
  194. ypos 88
  195. }
  196. Grade {
  197. white {{parent.blue}}
  198. name Grade5
  199. xpos 510
  200. ypos 114
  201. }
  202. push 0
  203. push $N49272580
  204. ColorMatrix {
  205. matrix {
  206. {1 0 0}
  207. {0 -4.371138829e-008 -1}
  208. {0 1 -4.371138829e-008}
  209. }
  210. name ColorMatrix2
  211. xpos 290
  212. ypos -154
  213. }
  214. Dot {
  215. name Dot2
  216. xpos 324
  217. ypos -126
  218. }
  219. set N49274b50 [stack 0]
  220. BlinkScript {
  221. ProgramGroup 1
  222. KernelDescription "1 \"Worley3D\" iterate pixelWise 45291152b7d71735741f26b17f4d23bdf56ad567aabfa36c1b2c3f23a430c4b8 2 \"worldP\" Read Point \"dst\" Write Point 8 \"Offset\" Float 3 AAAAAAAAAAAAAAAAAAAAAA== \"Frequency\" Float 1 AABAQA== \"Seed\" Int 1 AAAAAA== \"Displacement\" Float 1 AAAAAA== \"Distance\" Bool 1 AQ== \"Invert\" Bool 1 AQ== \"Cell size\" Float 1 AAAAAA== \"Cell softness\" Float 1 AACAPw=="
  223. kernelSource "// worley3D.blink\n// Create noise based on world position pass\n\n#define X_NOISE_GEN 1619\n#define Y_NOISE_GEN 31337\n#define Z_NOISE_GEN 6971\n#define SEED_NOISE_GEN 1013\n#define SQRT_3 1.73205081\n\ninline int IntValueNoise3D (int x, int y, int z, int seed)\n\{\n // All constants are primes and must remain prime in order for this noise\n // function to work correctly.\n int n = (\n X_NOISE_GEN * x\n + Y_NOISE_GEN * y\n + Z_NOISE_GEN * z\n + SEED_NOISE_GEN * seed)\n & 0x7fffffff;\n n = (n >> 13) ^ n;\n return (n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff;\n\}\n\ninline float ValueNoise3D (int x, int y, int z, int seed)\n\{\n return 1.0 - ((float)IntValueNoise3D (x, y, z, seed) / 1073741824.0);\n\}\n\nkernel Worley3D : ImageComputationKernel<ePixelWise>\n\{\n Image<eRead, eAccessPoint, eEdgeClamped> worldP; //the input image\n Image<eWrite, eAccessPoint> dst;\n\n param:\n float3 offset;\n float frequency;\n int seed;\n float displacement;\n bool distance;\n bool invert;\n float cell_size;\n float cell_softness;\n //int type;\n\n void define() \{\n defineParam(distance, \"Distance\", true);\n defineParam(offset, \"Offset\", float3(0.0f, 0.0f, 0.0f));\n defineParam(frequency, \"Frequency\", 3.0f);\n defineParam(displacement, \"Displacement\", 0.0f);\n defineParam(seed, \"Seed\", 0);\n defineParam(cell_size, \"Cell size\", 0.0f);\n defineParam(cell_softness, \"Cell softness\", 1.0f);\n defineParam(invert, \"Invert\", true);\n //defineParam(type, \"Type\", 0);\n \}\n\n void init() \{\n \}\n\n void process( int2 pos ) \{\n float value = 0.0;\n if ( worldP.kComps > 2 ) \{\n const float wx = worldP(0);\n const float wy = worldP(1);\n const float wz = worldP(2);\n\n float x = (wx - offset.x) * frequency;\n float y = (wy - offset.y) * frequency;\n float z = (wz - offset.z) * frequency;\n int xInt = (int)x; //(x > 0.0? (int)x: (int)x - 1);\n int yInt = (int)y; //(y > 0.0? (int)y: (int)y - 1);\n int zInt = (int)z; //(z > 0.0? (int)z: (int)z - 1);\n\n float minDist = 2147483647.0;\n float xF1 = 0;\n float yF1 = 0;\n float zF1 = 0;\n float xF2 = 0;\n float yF2 = 0;\n float zF2 = 0;\n\n float dist;\n\n for (int yCur = yInt - 2; yCur <= yInt + 2; yCur++) \{\n for (int xCur = xInt - 2; xCur <= xInt + 2; xCur++) \{\n for (int zCur = zInt - 2; zCur <= zInt + 2; zCur++) \{\n // Calculate the position and distance to the seed point inside of\n // this unit cube.\n float xPos = xCur + ValueNoise3D(xCur, yCur, zCur, seed );\n float yPos = yCur + ValueNoise3D(xCur, yCur, zCur, seed + 1);\n float zPos = zCur + ValueNoise3D(xCur, yCur, zCur, seed + 2);\n\n float xDist = xPos - x;\n float yDist = yPos - y;\n float zDist = zPos - z;\n\n dist = xDist * xDist + yDist * yDist + zDist * zDist;\n if (dist < minDist) \{\n // This seed point is closer to any others found so far, so record\n // this seed point.\n minDist = dist;\n xF2 = xF1;\n yF2 = yF1;\n xF2 = zF1;\n xF1 = xPos;\n yF1 = yPos;\n zF1 = zPos;\n \}\n \}\n \}\n \}\n\n float F1 = 0.0;\n float F2 = 0.0;\n if (distance) \{\n // Determine the distance to the nearest seed point.\n float xDist = xF1 - x;\n float yDist = yF1 - y;\n float zDist = zF1 - z;\n F1 = xDist*xDist + yDist*yDist + zDist*zDist;\n xDist = xF2 - x;\n yDist = yF2 - y;\n zDist = zF2 - z;\n F2 = xDist*xDist + yDist*yDist + zDist*zDist;\n \}\n value = F1;\n /*\n if ( type == 1 ) \{\n value = F2;\n \} else \{\n if ( type == 2 ) \{\n value = F1 * F2;\n \} else \{\n if ( type == 3 ) \{\n value = F2 - F1;\n \} else \{\n if ( type == 4 ) \{\n value = F1 + F2;\n \}\n \}\n \}\n \}\n */\n value += (displacement * (float)ValueNoise3D( (int)(floor(xF1)), (int)(floor(yF1)), (int)(floor(zF1)), seed)) + displacement;\n\n value = ((value - cell_size)*(1/cell_softness));\n\n if (invert) \{\n value = 1 - value;\n \}\n \} else \{\n value = 0.0f;\n \}\n for (int c = 0; c < dst.kComps; c++)\n dst(c) = value;\n \}\n\};\n\n"
  224. rebuild ""
  225. Worley3D_Frequency {{parent.Axis1.uniform_scale}}
  226. Worley3D_Seed 1
  227. Worley3D_Cellsoftness 0
  228. maxGPUMemory 53
  229. maxTileLines 15.5
  230. name BlinkScript2
  231. xpos 400
  232. ypos -64
  233. }
  234. push $N49274b50
  235. ColorMatrix {
  236. matrix {
  237. {1 0 0}
  238. {0 0.7071067691 -0.7071067691}
  239. {0 0.7071067691 0.7071067691}
  240. }
  241. name ColorMatrix5
  242. xpos 290
  243. ypos -58
  244. }
  245. Expression {
  246. channel0 rgb
  247. expr0 "\[value PToN_exp.noiseType](r*axisScale.x*scale,g*axisScale.y*scale,b*axisScale.z*scale,octaves,lacunarity,gain)"
  248. channel1 {-rgba.red -rgba.green -rgba.blue none}
  249. channel2 {-rgba.red -rgba.green -rgba.blue none}
  250. name PToN_exp1
  251. xpos 290
  252. ypos -34
  253. addUserKnob {20 User}
  254. addUserKnob {13 axisScale}
  255. axisScale {{parent.Axis1.scaling.x} {parent.Axis1.scaling.y} {parent.Axis1.scaling.z}}
  256. addUserKnob {20 endGroup n -1}
  257. addUserKnob {7 scale R 0.01 10}
  258. scale {{parent.Axis1.uniform_scale}}
  259. addUserKnob {20 endGroup_1 l endGroup n -1}
  260. addUserKnob {3 octaves l Octaves}
  261. octaves {{parent.PToN_exp.octaves}}
  262. addUserKnob {7 lacunarity l Lacunarity R 1 10}
  263. lacunarity {{parent.PToN_exp.lacunarity}}
  264. addUserKnob {7 gain l Gain R 0.1 1}
  265. gain {{parent.PToN_exp.gain}}
  266. addUserKnob {6 center_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
  267. addUserKnob {4 noiseType M {fBm turbulence worley "" ""}}
  268. }
  269. Grade {
  270. black 0.5
  271. name Grade3
  272. xpos 290
  273. ypos -8
  274. }
  275. Switch {
  276. inputs 2
  277. which {{"parent.PToN_exp.noiseType == 2 "}}
  278. name Switch2
  279. xpos 290
  280. ypos 62
  281. }
  282. Expression {
  283. expr0 0
  284. expr1 g
  285. expr2 0
  286. name Expression1
  287. xpos 290
  288. ypos 88
  289. }
  290. Grade {
  291. white {{parent.green}}
  292. name Grade6
  293. xpos 290
  294. ypos 114
  295. }
  296. push $N49272210
  297. Dot {
  298. name Dot1
  299. xpos 104
  300. ypos -126
  301. }
  302. set N49276360 [stack 0]
  303. BlinkScript {
  304. ProgramGroup 1
  305. KernelDescription "1 \"Worley3D\" iterate pixelWise 45291152b7d71735741f26b17f4d23bdf56ad567aabfa36c1b2c3f23a430c4b8 2 \"worldP\" Read Point \"dst\" Write Point 8 \"Offset\" Float 3 AAAAAAAAAAAAAAAAAAAAAA== \"Frequency\" Float 1 AABAQA== \"Seed\" Int 1 AAAAAA== \"Displacement\" Float 1 AAAAAA== \"Distance\" Bool 1 AQ== \"Invert\" Bool 1 AQ== \"Cell size\" Float 1 AAAAAA== \"Cell softness\" Float 1 AACAPw=="
  306. kernelSource "// worley3D.blink\n// Create noise based on world position pass\n\n#define X_NOISE_GEN 1619\n#define Y_NOISE_GEN 31337\n#define Z_NOISE_GEN 6971\n#define SEED_NOISE_GEN 1013\n#define SQRT_3 1.73205081\n\ninline int IntValueNoise3D (int x, int y, int z, int seed)\n\{\n // All constants are primes and must remain prime in order for this noise\n // function to work correctly.\n int n = (\n X_NOISE_GEN * x\n + Y_NOISE_GEN * y\n + Z_NOISE_GEN * z\n + SEED_NOISE_GEN * seed)\n & 0x7fffffff;\n n = (n >> 13) ^ n;\n return (n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff;\n\}\n\ninline float ValueNoise3D (int x, int y, int z, int seed)\n\{\n return 1.0 - ((float)IntValueNoise3D (x, y, z, seed) / 1073741824.0);\n\}\n\nkernel Worley3D : ImageComputationKernel<ePixelWise>\n\{\n Image<eRead, eAccessPoint, eEdgeClamped> worldP; //the input image\n Image<eWrite, eAccessPoint> dst;\n\n param:\n float3 offset;\n float frequency;\n int seed;\n float displacement;\n bool distance;\n bool invert;\n float cell_size;\n float cell_softness;\n //int type;\n\n void define() \{\n defineParam(distance, \"Distance\", true);\n defineParam(offset, \"Offset\", float3(0.0f, 0.0f, 0.0f));\n defineParam(frequency, \"Frequency\", 3.0f);\n defineParam(displacement, \"Displacement\", 0.0f);\n defineParam(seed, \"Seed\", 0);\n defineParam(cell_size, \"Cell size\", 0.0f);\n defineParam(cell_softness, \"Cell softness\", 1.0f);\n defineParam(invert, \"Invert\", true);\n //defineParam(type, \"Type\", 0);\n \}\n\n void init() \{\n \}\n\n void process( int2 pos ) \{\n float value = 0.0;\n if ( worldP.kComps > 2 ) \{\n const float wx = worldP(0);\n const float wy = worldP(1);\n const float wz = worldP(2);\n\n float x = (wx - offset.x) * frequency;\n float y = (wy - offset.y) * frequency;\n float z = (wz - offset.z) * frequency;\n int xInt = (int)x; //(x > 0.0? (int)x: (int)x - 1);\n int yInt = (int)y; //(y > 0.0? (int)y: (int)y - 1);\n int zInt = (int)z; //(z > 0.0? (int)z: (int)z - 1);\n\n float minDist = 2147483647.0;\n float xF1 = 0;\n float yF1 = 0;\n float zF1 = 0;\n float xF2 = 0;\n float yF2 = 0;\n float zF2 = 0;\n\n float dist;\n\n for (int yCur = yInt - 2; yCur <= yInt + 2; yCur++) \{\n for (int xCur = xInt - 2; xCur <= xInt + 2; xCur++) \{\n for (int zCur = zInt - 2; zCur <= zInt + 2; zCur++) \{\n // Calculate the position and distance to the seed point inside of\n // this unit cube.\n float xPos = xCur + ValueNoise3D(xCur, yCur, zCur, seed );\n float yPos = yCur + ValueNoise3D(xCur, yCur, zCur, seed + 1);\n float zPos = zCur + ValueNoise3D(xCur, yCur, zCur, seed + 2);\n\n float xDist = xPos - x;\n float yDist = yPos - y;\n float zDist = zPos - z;\n\n dist = xDist * xDist + yDist * yDist + zDist * zDist;\n if (dist < minDist) \{\n // This seed point is closer to any others found so far, so record\n // this seed point.\n minDist = dist;\n xF2 = xF1;\n yF2 = yF1;\n xF2 = zF1;\n xF1 = xPos;\n yF1 = yPos;\n zF1 = zPos;\n \}\n \}\n \}\n \}\n\n float F1 = 0.0;\n float F2 = 0.0;\n if (distance) \{\n // Determine the distance to the nearest seed point.\n float xDist = xF1 - x;\n float yDist = yF1 - y;\n float zDist = zF1 - z;\n F1 = xDist*xDist + yDist*yDist + zDist*zDist;\n xDist = xF2 - x;\n yDist = yF2 - y;\n zDist = zF2 - z;\n F2 = xDist*xDist + yDist*yDist + zDist*zDist;\n \}\n value = F1;\n /*\n if ( type == 1 ) \{\n value = F2;\n \} else \{\n if ( type == 2 ) \{\n value = F1 * F2;\n \} else \{\n if ( type == 3 ) \{\n value = F2 - F1;\n \} else \{\n if ( type == 4 ) \{\n value = F1 + F2;\n \}\n \}\n \}\n \}\n */\n value += (displacement * (float)ValueNoise3D( (int)(floor(xF1)), (int)(floor(yF1)), (int)(floor(zF1)), seed)) + displacement;\n\n value = ((value - cell_size)*(1/cell_softness));\n\n if (invert) \{\n value = 1 - value;\n \}\n \} else \{\n value = 0.0f;\n \}\n for (int c = 0; c < dst.kComps; c++)\n dst(c) = value;\n \}\n\};\n\n"
  307. rebuild ""
  308. Worley3D_Frequency {{parent.Axis1.uniform_scale}}
  309. Worley3D_Seed 1
  310. Worley3D_Cellsoftness 0
  311. maxGPUMemory 53
  312. maxTileLines 15.5
  313. name BlinkScript1
  314. xpos 180
  315. ypos -64
  316. }
  317. push $N49276360
  318. ColorMatrix {
  319. matrix {
  320. {1 0 0}
  321. {0 0.7071067691 -0.7071067691}
  322. {0 0.7071067691 0.7071067691}
  323. }
  324. name ColorMatrix4
  325. xpos 70
  326. ypos -58
  327. }
  328. Expression {
  329. channel0 rgb
  330. expr0 "\[value this.noiseType](r*axisScale.x*scale,g*axisScale.y*scale,b*axisScale.z*scale,octaves,lacunarity,gain)"
  331. channel1 {-rgba.red -rgba.green -rgba.blue none}
  332. channel2 {-rgba.red -rgba.green -rgba.blue none}
  333. name PToN_exp
  334. xpos 70
  335. ypos -36
  336. addUserKnob {20 User}
  337. addUserKnob {13 axisScale}
  338. axisScale {{parent.Axis1.scaling.x} {parent.Axis1.scaling.y} {parent.Axis1.scaling.z}}
  339. addUserKnob {20 endGroup n -1}
  340. addUserKnob {7 scale R 0.01 10}
  341. scale {{parent.Axis1.uniform_scale}}
  342. addUserKnob {20 endGroup_1 l endGroup n -1}
  343. addUserKnob {3 octaves l Octaves}
  344. octaves 5
  345. addUserKnob {7 lacunarity l Lacunarity R 1 10}
  346. addUserKnob {7 gain l Gain R 0.1 1}
  347. gain 1
  348. addUserKnob {6 center_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
  349. addUserKnob {4 noiseType M {fBm turbulence worley "" ""}}
  350. noiseType turbulence
  351. }
  352. Grade {
  353. black 0.5
  354. name Grade2
  355. xpos 70
  356. ypos -10
  357. }
  358. Switch {
  359. inputs 2
  360. which {{"parent.PToN_exp.noiseType == 2 "}}
  361. name Switch1
  362. xpos 70
  363. ypos 62
  364. }
  365. Expression {
  366. expr0 r
  367. expr1 0
  368. expr2 0
  369. name Expression3
  370. xpos 70
  371. ypos 88
  372. }
  373. Grade {
  374. white {{parent.red}}
  375. name Grade7
  376. xpos 70
  377. ypos 114
  378. }
  379. Shuffle {
  380. out alpha
  381. name Shuffle1
  382. xpos 70
  383. ypos 158
  384. }
  385. Merge2 {
  386. inputs 3+1
  387. operation plus
  388. Achannels {rgba.red rgba.green rgba.blue -rgba.alpha}
  389. name Merge1
  390. xpos 70
  391. ypos 204
  392. }
  393. Invert {
  394. channels rgb
  395. mix {{parent.invert}}
  396. name Invert1
  397. xpos 70
  398. ypos 230
  399. }
  400. set N49500510 [stack 0]
  401. Output {
  402. name Output1
  403. xpos 70
  404. ypos 328
  405. }
  406. Input {
  407. inputs 0
  408. name Transform_3D
  409. xpos 180
  410. ypos -466
  411. number 1
  412. }
  413. Axis2 {
  414. translate {0 0 {parent.parent.WPosToNoisedfsq.Axis1.translate.z}}
  415. uniform_scale 0.53
  416. name Axis1
  417. xpos 190
  418. ypos -414
  419. }
  420. push $N49500510
  421. Viewer {
  422. input_process false
  423. name Viewer1
  424. xpos -260
  425. ypos 350
  426. }
  427. end_group
  428. push $N49271450
  429. Dot {
  430. name Dot2
  431. xpos 874
  432. ypos 402
  433. }
  434. ShuffleCopy {
  435. inputs 2
  436. in rgb
  437. red red
  438. green green
  439. out forward
  440. name ShuffleCopy1
  441. xpos 840
  442. ypos 518
  443. }
  444. Shuffle {
  445. red blue
  446. green blue
  447. alpha blue
  448. name Shuffle3
  449. xpos 840
  450. ypos 668
  451. }
  452. NoOp {
  453. name NoOp1
  454. xpos 840
  455. ypos 716
  456. addUserKnob {20 User}
  457. addUserKnob {7 lavaLevel R 0 20}
  458. lavaLevel 13
  459. addUserKnob {7 level_smooth R 0.1 5}
  460. level_smooth 0.45
  461. }
  462. IDistort {
  463. uv forward
  464. uv_scale 40
  465. name IDistort5
  466. xpos 840
  467. ypos 758
  468. }
  469. Grade {
  470. channels rgba
  471. blackpoint {{NoOp1.lavaLevel+NoOp1.level_smooth*3}}
  472. whitepoint {{NoOp1.lavaLevel-+NoOp1.level_smooth}}
  473. gamma 0.3
  474. black_clamp false
  475. name Grade30
  476. xpos 840
  477. ypos 878
  478. }
  479. set N49502400 [stack 0]
  480. Grade {
  481. whitepoint 1.31
  482. black_clamp false
  483. name Grade3
  484. xpos 840
  485. ypos 1120
  486. }
  487. set N49502770 [stack 0]
  488. ColorLookup {
  489. lut {master {curve C 0 s0.01999999955 1 s0.01999999955}
  490. red {}
  491. green {}
  492. blue {}
  493. alpha {}}
  494. name ColorLookup4
  495. xpos 730
  496. ypos 1216
  497. }
  498. set N49502ae0 [stack 0]
  499. Dot {
  500. name Dot7
  501. xpos 654
  502. ypos 1386
  503. }
  504. push $N49502770
  505. Grade {
  506. whitepoint 1.2
  507. black_clamp false
  508. name Grade6
  509. xpos 840
  510. ypos 1166
  511. }
  512. ColorCorrect {
  513. channels rgba
  514. shadows.gain 0
  515. midtones.gain 1.52
  516. highlights.gain 0
  517. lookup {shadow {curve 1 s0 x0.4975876808 0 s0}
  518. midtone {1-shadow-highlight}
  519. highlight {}}
  520. name ColorCorrect1
  521. xpos 840
  522. ypos 1214
  523. }
  524. Shuffle {
  525. alpha blue
  526. name Shuffle1
  527. xpos 840
  528. ypos 1262
  529. }
  530. set N495038a0 [stack 0]
  531. Grade {
  532. multiply 1.4
  533. gamma 0.001
  534. black_clamp false
  535. name Grade9
  536. xpos 510
  537. ypos 1310
  538. }
  539. Constant {
  540. inputs 0
  541. channels rgb
  542. color {1 0.4240113497 0.01708430052 0}
  543. name Constant4
  544. xpos 620
  545. ypos 951
  546. }
  547. Constant {
  548. inputs 0
  549. channels rgb
  550. color {1 0.4240113497 0.01708430052 0}
  551. name Constant5
  552. xpos 510
  553. ypos 951
  554. }
  555. push $N49502400
  556. Grade {
  557. channels rgba
  558. blackpoint 1
  559. whitepoint 2.8
  560. name Grade5
  561. xpos 620
  562. ypos 878
  563. }
  564. push $N49271450
  565. Dot {
  566. name Dot3
  567. xpos 214
  568. ypos 402
  569. }
  570. Group {
  571. name WPosToNoise
  572. tile_color 0x308fffff
  573. xpos 180
  574. ypos 518
  575. addUserKnob {20 WPosToNoise}
  576. addUserKnob {6 red +STARTLINE}
  577. red true
  578. addUserKnob {6 green -STARTLINE}
  579. green true
  580. addUserKnob {6 blue -STARTLINE}
  581. blue true
  582. addUserKnob {6 rgb_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
  583. addUserKnob {41 noiseType T PToN_exp.noiseType}
  584. addUserKnob {41 octaves l Octaves -STARTLINE T PToN_exp.octaves}
  585. addUserKnob {41 Worley3D_Seed l "Seed (Worley)" -STARTLINE T BlinkScript1.Worley3D_Seed}
  586. addUserKnob {41 uniform_scale l "uniform scale" T Axis1.uniform_scale}
  587. addUserKnob {41 lacunarity l Lacunarity T PToN_exp.lacunarity}
  588. addUserKnob {41 gain l Gain T PToN_exp.gain}
  589. addUserKnob {41 Worley3D_Displacement l Displacement t "Worley Only" T BlinkScript1.Worley3D_Displacement}
  590. addUserKnob {6 invert l Invert +STARTLINE}
  591. addUserKnob {26 ""}
  592. addUserKnob {20 transform l "Transform 3D" n 1}
  593. addUserKnob {41 translate T Axis1.translate}
  594. addUserKnob {41 rotate T Axis1.rotate}
  595. addUserKnob {41 scaling l scale T Axis1.scaling}
  596. addUserKnob {20 endGroup_1 l endGroup n -1}
  597. addUserKnob {20 HelpTab l Help}
  598. addUserKnob {26 Help l "" +STARTLINE T "\nNoise: \nCe node permet de mapper (en environnement) toute votre scene avec un noise 3D parametrable. \nIl vous suffit pour ca de lui donner a manger une passe de position Max/Vray. \n\nTout les parametres n'ont pas d'utilite pour tout les noises \n(Exemple: Lacunarity n'a aucune utilite pour le Worley)\n\n\nTranform:\nVous pouvez animer votre Noise en utilisant les options de translate. \n\nOptionnellement, vous pouvez brancher des Axis animes, provenant ou non de softs externes.\n (Attention a bien convertir vos axis en axis Max)"}
  599. addUserKnob {20 About}
  600. addUserKnob {26 About_1 l "" +STARTLINE T "WPosToNoise 1.0 by Noss : bruno.ortolland@gmail.com\n\nWorley blinkscript by Ivan Busquets"}
  601. }
  602. Input {
  603. inputs 0
  604. name pointPosition
  605. xpos 70
  606. ypos -466
  607. }
  608. Grade {
  609. add {{parent.Axis1.world_matrix.3} {parent.Axis1.world_matrix.7} {parent.Axis1.world_matrix.11} 0}
  610. black_clamp false
  611. name Grade1
  612. xpos 70
  613. ypos -394
  614. }
  615. ColorMatrix {
  616. matrix {
  617. {{parent.Axis1.world_matrix.0} {parent.Axis1.world_matrix.1} {parent.Axis1.world_matrix.2}}
  618. {{parent.Axis1.world_matrix.4} {parent.Axis1.world_matrix.5} {parent.Axis1.world_matrix.6}}
  619. {{parent.Axis1.world_matrix.8} {parent.Axis1.world_matrix.9} {parent.Axis1.world_matrix.10}}
  620. }
  621. name ColorMatrix1
  622. xpos 70
  623. ypos -346
  624. }
  625. Dot {
  626. name Dot4
  627. xpos 104
  628. ypos -198
  629. }
  630. set N49505790 [stack 0]
  631. Dot {
  632. name Dot6
  633. xpos 324
  634. ypos -198
  635. }
  636. set N49505b00 [stack 0]
  637. Dot {
  638. name Dot5
  639. xpos 544
  640. ypos -198
  641. }
  642. ColorMatrix {
  643. matrix {
  644. {-4.371138829e-008 0 1}
  645. {0 1 0}
  646. {-1 0 -4.371138829e-008}
  647. }
  648. name ColorMatrix3
  649. xpos 510
  650. ypos -154
  651. }
  652. Dot {
  653. name Dot3
  654. xpos 544
  655. ypos -128
  656. }
  657. set N49506550 [stack 0]
  658. BlinkScript {
  659. ProgramGroup 1
  660. KernelDescription "1 \"Worley3D\" iterate pixelWise 45291152b7d71735741f26b17f4d23bdf56ad567aabfa36c1b2c3f23a430c4b8 2 \"worldP\" Read Point \"dst\" Write Point 8 \"Offset\" Float 3 AAAAAAAAAAAAAAAAAAAAAA== \"Frequency\" Float 1 AABAQA== \"Seed\" Int 1 AAAAAA== \"Displacement\" Float 1 AAAAAA== \"Distance\" Bool 1 AQ== \"Invert\" Bool 1 AQ== \"Cell size\" Float 1 AAAAAA== \"Cell softness\" Float 1 AACAPw=="
  661. kernelSource "// worley3D.blink\n// Create noise based on world position pass\n\n#define X_NOISE_GEN 1619\n#define Y_NOISE_GEN 31337\n#define Z_NOISE_GEN 6971\n#define SEED_NOISE_GEN 1013\n#define SQRT_3 1.73205081\n\ninline int IntValueNoise3D (int x, int y, int z, int seed)\n\{\n // All constants are primes and must remain prime in order for this noise\n // function to work correctly.\n int n = (\n X_NOISE_GEN * x\n + Y_NOISE_GEN * y\n + Z_NOISE_GEN * z\n + SEED_NOISE_GEN * seed)\n & 0x7fffffff;\n n = (n >> 13) ^ n;\n return (n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff;\n\}\n\ninline float ValueNoise3D (int x, int y, int z, int seed)\n\{\n return 1.0 - ((float)IntValueNoise3D (x, y, z, seed) / 1073741824.0);\n\}\n\nkernel Worley3D : ImageComputationKernel<ePixelWise>\n\{\n Image<eRead, eAccessPoint, eEdgeClamped> worldP; //the input image\n Image<eWrite, eAccessPoint> dst;\n\n param:\n float3 offset;\n float frequency;\n int seed;\n float displacement;\n bool distance;\n bool invert;\n float cell_size;\n float cell_softness;\n //int type;\n\n void define() \{\n defineParam(distance, \"Distance\", true);\n defineParam(offset, \"Offset\", float3(0.0f, 0.0f, 0.0f));\n defineParam(frequency, \"Frequency\", 3.0f);\n defineParam(displacement, \"Displacement\", 0.0f);\n defineParam(seed, \"Seed\", 0);\n defineParam(cell_size, \"Cell size\", 0.0f);\n defineParam(cell_softness, \"Cell softness\", 1.0f);\n defineParam(invert, \"Invert\", true);\n //defineParam(type, \"Type\", 0);\n \}\n\n void init() \{\n \}\n\n void process( int2 pos ) \{\n float value = 0.0;\n if ( worldP.kComps > 2 ) \{\n const float wx = worldP(0);\n const float wy = worldP(1);\n const float wz = worldP(2);\n\n float x = (wx - offset.x) * frequency;\n float y = (wy - offset.y) * frequency;\n float z = (wz - offset.z) * frequency;\n int xInt = (int)x; //(x > 0.0? (int)x: (int)x - 1);\n int yInt = (int)y; //(y > 0.0? (int)y: (int)y - 1);\n int zInt = (int)z; //(z > 0.0? (int)z: (int)z - 1);\n\n float minDist = 2147483647.0;\n float xF1 = 0;\n float yF1 = 0;\n float zF1 = 0;\n float xF2 = 0;\n float yF2 = 0;\n float zF2 = 0;\n\n float dist;\n\n for (int yCur = yInt - 2; yCur <= yInt + 2; yCur++) \{\n for (int xCur = xInt - 2; xCur <= xInt + 2; xCur++) \{\n for (int zCur = zInt - 2; zCur <= zInt + 2; zCur++) \{\n // Calculate the position and distance to the seed point inside of\n // this unit cube.\n float xPos = xCur + ValueNoise3D(xCur, yCur, zCur, seed );\n float yPos = yCur + ValueNoise3D(xCur, yCur, zCur, seed + 1);\n float zPos = zCur + ValueNoise3D(xCur, yCur, zCur, seed + 2);\n\n float xDist = xPos - x;\n float yDist = yPos - y;\n float zDist = zPos - z;\n\n dist = xDist * xDist + yDist * yDist + zDist * zDist;\n if (dist < minDist) \{\n // This seed point is closer to any others found so far, so record\n // this seed point.\n minDist = dist;\n xF2 = xF1;\n yF2 = yF1;\n xF2 = zF1;\n xF1 = xPos;\n yF1 = yPos;\n zF1 = zPos;\n \}\n \}\n \}\n \}\n\n float F1 = 0.0;\n float F2 = 0.0;\n if (distance) \{\n // Determine the distance to the nearest seed point.\n float xDist = xF1 - x;\n float yDist = yF1 - y;\n float zDist = zF1 - z;\n F1 = xDist*xDist + yDist*yDist + zDist*zDist;\n xDist = xF2 - x;\n yDist = yF2 - y;\n zDist = zF2 - z;\n F2 = xDist*xDist + yDist*yDist + zDist*zDist;\n \}\n value = F1;\n /*\n if ( type == 1 ) \{\n value = F2;\n \} else \{\n if ( type == 2 ) \{\n value = F1 * F2;\n \} else \{\n if ( type == 3 ) \{\n value = F2 - F1;\n \} else \{\n if ( type == 4 ) \{\n value = F1 + F2;\n \}\n \}\n \}\n \}\n */\n value += (displacement * (float)ValueNoise3D( (int)(floor(xF1)), (int)(floor(yF1)), (int)(floor(zF1)), seed)) + displacement;\n\n value = ((value - cell_size)*(1/cell_softness));\n\n if (invert) \{\n value = 1 - value;\n \}\n \} else \{\n value = 0.0f;\n \}\n for (int c = 0; c < dst.kComps; c++)\n dst(c) = value;\n \}\n\};\n\n"
  662. rebuild ""
  663. Worley3D_Frequency {{parent.Axis1.uniform_scale}}
  664. Worley3D_Seed 1
  665. Worley3D_Cellsoftness 0
  666. maxGPUMemory 53
  667. maxTileLines 15.5
  668. name BlinkScript3
  669. xpos 620
  670. ypos -64
  671. }
  672. push $N49506550
  673. ColorMatrix {
  674. matrix {
  675. {1 0 0}
  676. {0 0.7071067691 -0.7071067691}
  677. {0 0.7071067691 0.7071067691}
  678. }
  679. name ColorMatrix6
  680. xpos 510
  681. ypos -58
  682. }
  683. Expression {
  684. channel0 rgb
  685. expr0 "\[value PToN_exp.noiseType](r*axisScale.x*scale,g*axisScale.y*scale,b*axisScale.z*scale,octaves,lacunarity,gain)"
  686. channel1 {-rgba.red -rgba.green -rgba.blue none}
  687. channel2 {-rgba.red -rgba.green -rgba.blue none}
  688. name PToN_exp2
  689. xpos 510
  690. ypos -34
  691. addUserKnob {20 User}
  692. addUserKnob {13 axisScale}
  693. axisScale {{parent.Axis1.scaling.x} {parent.Axis1.scaling.y} {parent.Axis1.scaling.z}}
  694. addUserKnob {20 endGroup n -1}
  695. addUserKnob {7 scale R 0.01 10}
  696. scale {{parent.Axis1.uniform_scale}}
  697. addUserKnob {20 endGroup_1 l endGroup n -1}
  698. addUserKnob {3 octaves l Octaves}
  699. octaves {{parent.PToN_exp1.octaves}}
  700. addUserKnob {7 lacunarity l Lacunarity R 1 10}
  701. lacunarity {{parent.PToN_exp1.lacunarity}}
  702. addUserKnob {7 gain l Gain R 0.1 1}
  703. gain {{parent.PToN_exp1.gain}}
  704. addUserKnob {6 center_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
  705. addUserKnob {4 noiseType M {fBm turbulence worley "" ""}}
  706. }
  707. Grade {
  708. black 0.5
  709. name Grade4
  710. xpos 510
  711. ypos -8
  712. }
  713. Switch {
  714. inputs 2
  715. which {{"parent.PToN_exp.noiseType == 2 "}}
  716. name Switch3
  717. xpos 510
  718. ypos 62
  719. }
  720. Expression {
  721. expr0 0
  722. expr1 0
  723. expr2 b
  724. name Expression2
  725. xpos 510
  726. ypos 88
  727. }
  728. Grade {
  729. white {{parent.blue}}
  730. name Grade5
  731. xpos 510
  732. ypos 114
  733. }
  734. push 0
  735. push $N49505b00
  736. ColorMatrix {
  737. matrix {
  738. {1 0 0}
  739. {0 -4.371138829e-008 -1}
  740. {0 1 -4.371138829e-008}
  741. }
  742. name ColorMatrix2
  743. xpos 290
  744. ypos -154
  745. }
  746. Dot {
  747. name Dot2
  748. xpos 324
  749. ypos -126
  750. }
  751. set N4946b880 [stack 0]
  752. BlinkScript {
  753. ProgramGroup 1
  754. KernelDescription "1 \"Worley3D\" iterate pixelWise 45291152b7d71735741f26b17f4d23bdf56ad567aabfa36c1b2c3f23a430c4b8 2 \"worldP\" Read Point \"dst\" Write Point 8 \"Offset\" Float 3 AAAAAAAAAAAAAAAAAAAAAA== \"Frequency\" Float 1 AABAQA== \"Seed\" Int 1 AAAAAA== \"Displacement\" Float 1 AAAAAA== \"Distance\" Bool 1 AQ== \"Invert\" Bool 1 AQ== \"Cell size\" Float 1 AAAAAA== \"Cell softness\" Float 1 AACAPw=="
  755. kernelSource "// worley3D.blink\n// Create noise based on world position pass\n\n#define X_NOISE_GEN 1619\n#define Y_NOISE_GEN 31337\n#define Z_NOISE_GEN 6971\n#define SEED_NOISE_GEN 1013\n#define SQRT_3 1.73205081\n\ninline int IntValueNoise3D (int x, int y, int z, int seed)\n\{\n // All constants are primes and must remain prime in order for this noise\n // function to work correctly.\n int n = (\n X_NOISE_GEN * x\n + Y_NOISE_GEN * y\n + Z_NOISE_GEN * z\n + SEED_NOISE_GEN * seed)\n & 0x7fffffff;\n n = (n >> 13) ^ n;\n return (n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff;\n\}\n\ninline float ValueNoise3D (int x, int y, int z, int seed)\n\{\n return 1.0 - ((float)IntValueNoise3D (x, y, z, seed) / 1073741824.0);\n\}\n\nkernel Worley3D : ImageComputationKernel<ePixelWise>\n\{\n Image<eRead, eAccessPoint, eEdgeClamped> worldP; //the input image\n Image<eWrite, eAccessPoint> dst;\n\n param:\n float3 offset;\n float frequency;\n int seed;\n float displacement;\n bool distance;\n bool invert;\n float cell_size;\n float cell_softness;\n //int type;\n\n void define() \{\n defineParam(distance, \"Distance\", true);\n defineParam(offset, \"Offset\", float3(0.0f, 0.0f, 0.0f));\n defineParam(frequency, \"Frequency\", 3.0f);\n defineParam(displacement, \"Displacement\", 0.0f);\n defineParam(seed, \"Seed\", 0);\n defineParam(cell_size, \"Cell size\", 0.0f);\n defineParam(cell_softness, \"Cell softness\", 1.0f);\n defineParam(invert, \"Invert\", true);\n //defineParam(type, \"Type\", 0);\n \}\n\n void init() \{\n \}\n\n void process( int2 pos ) \{\n float value = 0.0;\n if ( worldP.kComps > 2 ) \{\n const float wx = worldP(0);\n const float wy = worldP(1);\n const float wz = worldP(2);\n\n float x = (wx - offset.x) * frequency;\n float y = (wy - offset.y) * frequency;\n float z = (wz - offset.z) * frequency;\n int xInt = (int)x; //(x > 0.0? (int)x: (int)x - 1);\n int yInt = (int)y; //(y > 0.0? (int)y: (int)y - 1);\n int zInt = (int)z; //(z > 0.0? (int)z: (int)z - 1);\n\n float minDist = 2147483647.0;\n float xF1 = 0;\n float yF1 = 0;\n float zF1 = 0;\n float xF2 = 0;\n float yF2 = 0;\n float zF2 = 0;\n\n float dist;\n\n for (int yCur = yInt - 2; yCur <= yInt + 2; yCur++) \{\n for (int xCur = xInt - 2; xCur <= xInt + 2; xCur++) \{\n for (int zCur = zInt - 2; zCur <= zInt + 2; zCur++) \{\n // Calculate the position and distance to the seed point inside of\n // this unit cube.\n float xPos = xCur + ValueNoise3D(xCur, yCur, zCur, seed );\n float yPos = yCur + ValueNoise3D(xCur, yCur, zCur, seed + 1);\n float zPos = zCur + ValueNoise3D(xCur, yCur, zCur, seed + 2);\n\n float xDist = xPos - x;\n float yDist = yPos - y;\n float zDist = zPos - z;\n\n dist = xDist * xDist + yDist * yDist + zDist * zDist;\n if (dist < minDist) \{\n // This seed point is closer to any others found so far, so record\n // this seed point.\n minDist = dist;\n xF2 = xF1;\n yF2 = yF1;\n xF2 = zF1;\n xF1 = xPos;\n yF1 = yPos;\n zF1 = zPos;\n \}\n \}\n \}\n \}\n\n float F1 = 0.0;\n float F2 = 0.0;\n if (distance) \{\n // Determine the distance to the nearest seed point.\n float xDist = xF1 - x;\n float yDist = yF1 - y;\n float zDist = zF1 - z;\n F1 = xDist*xDist + yDist*yDist + zDist*zDist;\n xDist = xF2 - x;\n yDist = yF2 - y;\n zDist = zF2 - z;\n F2 = xDist*xDist + yDist*yDist + zDist*zDist;\n \}\n value = F1;\n /*\n if ( type == 1 ) \{\n value = F2;\n \} else \{\n if ( type == 2 ) \{\n value = F1 * F2;\n \} else \{\n if ( type == 3 ) \{\n value = F2 - F1;\n \} else \{\n if ( type == 4 ) \{\n value = F1 + F2;\n \}\n \}\n \}\n \}\n */\n value += (displacement * (float)ValueNoise3D( (int)(floor(xF1)), (int)(floor(yF1)), (int)(floor(zF1)), seed)) + displacement;\n\n value = ((value - cell_size)*(1/cell_softness));\n\n if (invert) \{\n value = 1 - value;\n \}\n \} else \{\n value = 0.0f;\n \}\n for (int c = 0; c < dst.kComps; c++)\n dst(c) = value;\n \}\n\};\n\n"
  756. rebuild ""
  757. Worley3D_Frequency {{parent.Axis1.uniform_scale}}
  758. Worley3D_Seed 1
  759. Worley3D_Cellsoftness 0
  760. maxGPUMemory 53
  761. maxTileLines 15.5
  762. name BlinkScript2
  763. xpos 400
  764. ypos -64
  765. }
  766. push $N4946b880
  767. ColorMatrix {
  768. matrix {
  769. {1 0 0}
  770. {0 0.7071067691 -0.7071067691}
  771. {0 0.7071067691 0.7071067691}
  772. }
  773. name ColorMatrix5
  774. xpos 290
  775. ypos -58
  776. }
  777. Expression {
  778. channel0 rgb
  779. expr0 "\[value PToN_exp.noiseType](r*axisScale.x*scale,g*axisScale.y*scale,b*axisScale.z*scale,octaves,lacunarity,gain)"
  780. channel1 {-rgba.red -rgba.green -rgba.blue none}
  781. channel2 {-rgba.red -rgba.green -rgba.blue none}
  782. name PToN_exp1
  783. xpos 290
  784. ypos -34
  785. addUserKnob {20 User}
  786. addUserKnob {13 axisScale}
  787. axisScale {{parent.Axis1.scaling.x} {parent.Axis1.scaling.y} {parent.Axis1.scaling.z}}
  788. addUserKnob {20 endGroup n -1}
  789. addUserKnob {7 scale R 0.01 10}
  790. scale {{parent.Axis1.uniform_scale}}
  791. addUserKnob {20 endGroup_1 l endGroup n -1}
  792. addUserKnob {3 octaves l Octaves}
  793. octaves {{parent.PToN_exp.octaves}}
  794. addUserKnob {7 lacunarity l Lacunarity R 1 10}
  795. lacunarity {{parent.PToN_exp.lacunarity}}
  796. addUserKnob {7 gain l Gain R 0.1 1}
  797. gain {{parent.PToN_exp.gain}}
  798. addUserKnob {6 center_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
  799. addUserKnob {4 noiseType M {fBm turbulence worley "" ""}}
  800. }
  801. Grade {
  802. black 0.5
  803. name Grade3
  804. xpos 290
  805. ypos -8
  806. }
  807. Switch {
  808. inputs 2
  809. which {{"parent.PToN_exp.noiseType == 2 "}}
  810. name Switch2
  811. xpos 290
  812. ypos 62
  813. }
  814. Expression {
  815. expr0 0
  816. expr1 g
  817. expr2 0
  818. name Expression1
  819. xpos 290
  820. ypos 88
  821. }
  822. Grade {
  823. white {{parent.green}}
  824. name Grade6
  825. xpos 290
  826. ypos 114
  827. }
  828. push $N49505790
  829. Dot {
  830. name Dot1
  831. xpos 104
  832. ypos -126
  833. }
  834. set N4946d090 [stack 0]
  835. BlinkScript {
  836. ProgramGroup 1
  837. KernelDescription "1 \"Worley3D\" iterate pixelWise 45291152b7d71735741f26b17f4d23bdf56ad567aabfa36c1b2c3f23a430c4b8 2 \"worldP\" Read Point \"dst\" Write Point 8 \"Offset\" Float 3 AAAAAAAAAAAAAAAAAAAAAA== \"Frequency\" Float 1 AABAQA== \"Seed\" Int 1 AAAAAA== \"Displacement\" Float 1 AAAAAA== \"Distance\" Bool 1 AQ== \"Invert\" Bool 1 AQ== \"Cell size\" Float 1 AAAAAA== \"Cell softness\" Float 1 AACAPw=="
  838. kernelSource "// worley3D.blink\n// Create noise based on world position pass\n\n#define X_NOISE_GEN 1619\n#define Y_NOISE_GEN 31337\n#define Z_NOISE_GEN 6971\n#define SEED_NOISE_GEN 1013\n#define SQRT_3 1.73205081\n\ninline int IntValueNoise3D (int x, int y, int z, int seed)\n\{\n // All constants are primes and must remain prime in order for this noise\n // function to work correctly.\n int n = (\n X_NOISE_GEN * x\n + Y_NOISE_GEN * y\n + Z_NOISE_GEN * z\n + SEED_NOISE_GEN * seed)\n & 0x7fffffff;\n n = (n >> 13) ^ n;\n return (n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff;\n\}\n\ninline float ValueNoise3D (int x, int y, int z, int seed)\n\{\n return 1.0 - ((float)IntValueNoise3D (x, y, z, seed) / 1073741824.0);\n\}\n\nkernel Worley3D : ImageComputationKernel<ePixelWise>\n\{\n Image<eRead, eAccessPoint, eEdgeClamped> worldP; //the input image\n Image<eWrite, eAccessPoint> dst;\n\n param:\n float3 offset;\n float frequency;\n int seed;\n float displacement;\n bool distance;\n bool invert;\n float cell_size;\n float cell_softness;\n //int type;\n\n void define() \{\n defineParam(distance, \"Distance\", true);\n defineParam(offset, \"Offset\", float3(0.0f, 0.0f, 0.0f));\n defineParam(frequency, \"Frequency\", 3.0f);\n defineParam(displacement, \"Displacement\", 0.0f);\n defineParam(seed, \"Seed\", 0);\n defineParam(cell_size, \"Cell size\", 0.0f);\n defineParam(cell_softness, \"Cell softness\", 1.0f);\n defineParam(invert, \"Invert\", true);\n //defineParam(type, \"Type\", 0);\n \}\n\n void init() \{\n \}\n\n void process( int2 pos ) \{\n float value = 0.0;\n if ( worldP.kComps > 2 ) \{\n const float wx = worldP(0);\n const float wy = worldP(1);\n const float wz = worldP(2);\n\n float x = (wx - offset.x) * frequency;\n float y = (wy - offset.y) * frequency;\n float z = (wz - offset.z) * frequency;\n int xInt = (int)x; //(x > 0.0? (int)x: (int)x - 1);\n int yInt = (int)y; //(y > 0.0? (int)y: (int)y - 1);\n int zInt = (int)z; //(z > 0.0? (int)z: (int)z - 1);\n\n float minDist = 2147483647.0;\n float xF1 = 0;\n float yF1 = 0;\n float zF1 = 0;\n float xF2 = 0;\n float yF2 = 0;\n float zF2 = 0;\n\n float dist;\n\n for (int yCur = yInt - 2; yCur <= yInt + 2; yCur++) \{\n for (int xCur = xInt - 2; xCur <= xInt + 2; xCur++) \{\n for (int zCur = zInt - 2; zCur <= zInt + 2; zCur++) \{\n // Calculate the position and distance to the seed point inside of\n // this unit cube.\n float xPos = xCur + ValueNoise3D(xCur, yCur, zCur, seed );\n float yPos = yCur + ValueNoise3D(xCur, yCur, zCur, seed + 1);\n float zPos = zCur + ValueNoise3D(xCur, yCur, zCur, seed + 2);\n\n float xDist = xPos - x;\n float yDist = yPos - y;\n float zDist = zPos - z;\n\n dist = xDist * xDist + yDist * yDist + zDist * zDist;\n if (dist < minDist) \{\n // This seed point is closer to any others found so far, so record\n // this seed point.\n minDist = dist;\n xF2 = xF1;\n yF2 = yF1;\n xF2 = zF1;\n xF1 = xPos;\n yF1 = yPos;\n zF1 = zPos;\n \}\n \}\n \}\n \}\n\n float F1 = 0.0;\n float F2 = 0.0;\n if (distance) \{\n // Determine the distance to the nearest seed point.\n float xDist = xF1 - x;\n float yDist = yF1 - y;\n float zDist = zF1 - z;\n F1 = xDist*xDist + yDist*yDist + zDist*zDist;\n xDist = xF2 - x;\n yDist = yF2 - y;\n zDist = zF2 - z;\n F2 = xDist*xDist + yDist*yDist + zDist*zDist;\n \}\n value = F1;\n /*\n if ( type == 1 ) \{\n value = F2;\n \} else \{\n if ( type == 2 ) \{\n value = F1 * F2;\n \} else \{\n if ( type == 3 ) \{\n value = F2 - F1;\n \} else \{\n if ( type == 4 ) \{\n value = F1 + F2;\n \}\n \}\n \}\n \}\n */\n value += (displacement * (float)ValueNoise3D( (int)(floor(xF1)), (int)(floor(yF1)), (int)(floor(zF1)), seed)) + displacement;\n\n value = ((value - cell_size)*(1/cell_softness));\n\n if (invert) \{\n value = 1 - value;\n \}\n \} else \{\n value = 0.0f;\n \}\n for (int c = 0; c < dst.kComps; c++)\n dst(c) = value;\n \}\n\};\n\n"
  839. rebuild ""
  840. Worley3D_Frequency {{parent.Axis1.uniform_scale}}
  841. Worley3D_Seed 1
  842. Worley3D_Cellsoftness 0
  843. maxGPUMemory 53
  844. maxTileLines 15.5
  845. name BlinkScript1
  846. xpos 180
  847. ypos -64
  848. }
  849. push $N4946d090
  850. ColorMatrix {
  851. matrix {
  852. {1 0 0}
  853. {0 0.7071067691 -0.7071067691}
  854. {0 0.7071067691 0.7071067691}
  855. }
  856. name ColorMatrix4
  857. xpos 70
  858. ypos -58
  859. }
  860. Expression {
  861. channel0 rgb
  862. expr0 "\[value this.noiseType](r*axisScale.x*scale,g*axisScale.y*scale,b*axisScale.z*scale,octaves,lacunarity,gain)"
  863. channel1 {-rgba.red -rgba.green -rgba.blue none}
  864. channel2 {-rgba.red -rgba.green -rgba.blue none}
  865. name PToN_exp
  866. xpos 70
  867. ypos -36
  868. addUserKnob {20 User}
  869. addUserKnob {13 axisScale}
  870. axisScale {{parent.Axis1.scaling.x} {parent.Axis1.scaling.y} {parent.Axis1.scaling.z}}
  871. addUserKnob {20 endGroup n -1}
  872. addUserKnob {7 scale R 0.01 10}
  873. scale {{parent.Axis1.uniform_scale}}
  874. addUserKnob {20 endGroup_1 l endGroup n -1}
  875. addUserKnob {3 octaves l Octaves}
  876. octaves 5
  877. addUserKnob {7 lacunarity l Lacunarity R 1 10}
  878. addUserKnob {7 gain l Gain R 0.1 1}
  879. gain 1
  880. addUserKnob {6 center_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
  881. addUserKnob {4 noiseType M {fBm turbulence worley "" ""}}
  882. }
  883. Grade {
  884. black 0.5
  885. name Grade2
  886. xpos 70
  887. ypos -10
  888. }
  889. Switch {
  890. inputs 2
  891. which {{"parent.PToN_exp.noiseType == 2 "}}
  892. name Switch1
  893. xpos 70
  894. ypos 62
  895. }
  896. Expression {
  897. expr0 r
  898. expr1 0
  899. expr2 0
  900. name Expression3
  901. xpos 70
  902. ypos 88
  903. }
  904. Grade {
  905. white {{parent.red}}
  906. name Grade7
  907. xpos 70
  908. ypos 114
  909. }
  910. Shuffle {
  911. out alpha
  912. name Shuffle1
  913. xpos 70
  914. ypos 158
  915. }
  916. Merge2 {
  917. inputs 3+1
  918. operation plus
  919. Achannels {rgba.red rgba.green rgba.blue -rgba.alpha}
  920. name Merge1
  921. xpos 70
  922. ypos 204
  923. }
  924. Invert {
  925. channels rgb
  926. mix {{parent.invert}}
  927. name Invert1
  928. xpos 70
  929. ypos 230
  930. }
  931. Output {
  932. name Output1
  933. xpos 70
  934. ypos 328
  935. }
  936. Input {
  937. inputs 0
  938. name Transform_3D
  939. xpos 180
  940. ypos -466
  941. number 1
  942. }
  943. Axis2 {
  944. translate {0 {curve x1 0 x100 -0.025} 0}
  945. uniform_scale {{parent.parent.WPosToNoisedfsq.Axis1.uniform_scale}}
  946. name Axis1
  947. xpos 190
  948. ypos -414
  949. }
  950. end_group
  951. push $N49271450
  952. Group {
  953. name WPosToNoisedfsq
  954. tile_color 0x308fffff
  955. xpos 400
  956. ypos 446
  957. addUserKnob {20 WPosToNoise}
  958. addUserKnob {41 noiseType T PToN_exp.noiseType}
  959. addUserKnob {41 octaves l Octaves -STARTLINE T PToN_exp.octaves}
  960. addUserKnob {41 Worley3D_Seed l "Seed (Worley)" -STARTLINE T BlinkScript1.Worley3D_Seed}
  961. addUserKnob {41 uniform_scale l "uniform scale" T Axis1.uniform_scale}
  962. addUserKnob {41 lacunarity l Lacunarity T PToN_exp.lacunarity}
  963. addUserKnob {41 gain l Gain T PToN_exp.gain}
  964. addUserKnob {41 Worley3D_Displacement l Displacement t "Worley Only" T BlinkScript1.Worley3D_Displacement}
  965. addUserKnob {6 invert l Invert +STARTLINE}
  966. addUserKnob {26 ""}
  967. addUserKnob {20 transform l "Transform 3D" n 1}
  968. addUserKnob {41 translate T Axis1.translate}
  969. addUserKnob {41 rotate T Axis1.rotate}
  970. addUserKnob {41 scaling l scale T Axis1.scaling}
  971. addUserKnob {20 endGroup_1 l endGroup n -1}
  972. addUserKnob {20 HelpTab l Help}
  973. addUserKnob {26 Help l "" +STARTLINE T "\nNoise: \nCe node permet de mapper (en environnement) toute votre scene avec un noise 3D parametrable. \nIl vous suffit pour ca de lui donner a manger une passe de position Max/Vray. \n\nTout les parametres n'ont pas d'utilite pour tout les noises \n(Exemple: Lacunarity n'a aucune utilite pour le Worley)\n\n\nTranform:\nVous pouvez animer votre Noise en utilisant les options de translate. \n\nOptionnellement, vous pouvez brancher des Axis animes, provenant ou non de softs externes.\n (Attention a bien convertir vos axis en axis Max)"}
  974. addUserKnob {20 About}
  975. addUserKnob {26 About_1 l "" +STARTLINE T "WPosToNoise 1.0 by Noss : bruno.ortolland@gmail.com\n\nWorley blinkscript by Ivan Busquets"}
  976. }
  977. Input {
  978. inputs 0
  979. name pointPosition
  980. xpos -8
  981. ypos -250
  982. }
  983. Grade {
  984. add {{parent.Axis1.world_matrix.3} {parent.Axis1.world_matrix.7} {parent.Axis1.world_matrix.11} 0}
  985. black_clamp false
  986. name Grade1
  987. xpos -8
  988. ypos -178
  989. }
  990. ColorMatrix {
  991. matrix {
  992. {{parent.Axis1.world_matrix.0} {parent.Axis1.world_matrix.1} {parent.Axis1.world_matrix.2}}
  993. {{parent.Axis1.world_matrix.4} {parent.Axis1.world_matrix.5} {parent.Axis1.world_matrix.6}}
  994. {{parent.Axis1.world_matrix.8} {parent.Axis1.world_matrix.9} {parent.Axis1.world_matrix.10}}
  995. }
  996. name ColorMatrix1
  997. xpos -8
  998. ypos -130
  999. }
  1000. set N49470420 [stack 0]
  1001. Dot {
  1002. name Dot1
  1003. xpos 26
  1004. ypos -30
  1005. }
  1006. set N49470790 [stack 0]
  1007. BlinkScript {
  1008. ProgramGroup 1
  1009. KernelDescription "1 \"Worley3D\" iterate pixelWise 45291152b7d71735741f26b17f4d23bdf56ad567aabfa36c1b2c3f23a430c4b8 2 \"worldP\" Read Point \"dst\" Write Point 8 \"Offset\" Float 3 AAAAAAAAAAAAAAAAAAAAAA== \"Frequency\" Float 1 AABAQA== \"Seed\" Int 1 AAAAAA== \"Displacement\" Float 1 AAAAAA== \"Distance\" Bool 1 AQ== \"Invert\" Bool 1 AQ== \"Cell size\" Float 1 AAAAAA== \"Cell softness\" Float 1 AACAPw=="
  1010. kernelSource "// worley3D.blink\n// Create noise based on world position pass\n\n#define X_NOISE_GEN 1619\n#define Y_NOISE_GEN 31337\n#define Z_NOISE_GEN 6971\n#define SEED_NOISE_GEN 1013\n#define SQRT_3 1.73205081\n\ninline int IntValueNoise3D (int x, int y, int z, int seed)\n\{\n // All constants are primes and must remain prime in order for this noise\n // function to work correctly.\n int n = (\n X_NOISE_GEN * x\n + Y_NOISE_GEN * y\n + Z_NOISE_GEN * z\n + SEED_NOISE_GEN * seed)\n & 0x7fffffff;\n n = (n >> 13) ^ n;\n return (n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff;\n\}\n\ninline float ValueNoise3D (int x, int y, int z, int seed)\n\{\n return 1.0 - ((float)IntValueNoise3D (x, y, z, seed) / 1073741824.0);\n\}\n\nkernel Worley3D : ImageComputationKernel<ePixelWise>\n\{\n Image<eRead, eAccessPoint, eEdgeClamped> worldP; //the input image\n Image<eWrite, eAccessPoint> dst;\n\n param:\n float3 offset;\n float frequency;\n int seed;\n float displacement;\n bool distance;\n bool invert;\n float cell_size;\n float cell_softness;\n //int type;\n\n void define() \{\n defineParam(distance, \"Distance\", true);\n defineParam(offset, \"Offset\", float3(0.0f, 0.0f, 0.0f));\n defineParam(frequency, \"Frequency\", 3.0f);\n defineParam(displacement, \"Displacement\", 0.0f);\n defineParam(seed, \"Seed\", 0);\n defineParam(cell_size, \"Cell size\", 0.0f);\n defineParam(cell_softness, \"Cell softness\", 1.0f);\n defineParam(invert, \"Invert\", true);\n //defineParam(type, \"Type\", 0);\n \}\n\n void init() \{\n \}\n\n void process( int2 pos ) \{\n float value = 0.0;\n if ( worldP.kComps > 2 ) \{\n const float wx = worldP(0);\n const float wy = worldP(1);\n const float wz = worldP(2);\n\n float x = (wx - offset.x) * frequency;\n float y = (wy - offset.y) * frequency;\n float z = (wz - offset.z) * frequency;\n int xInt = (int)x; //(x > 0.0? (int)x: (int)x - 1);\n int yInt = (int)y; //(y > 0.0? (int)y: (int)y - 1);\n int zInt = (int)z; //(z > 0.0? (int)z: (int)z - 1);\n\n float minDist = 2147483647.0;\n float xF1 = 0;\n float yF1 = 0;\n float zF1 = 0;\n float xF2 = 0;\n float yF2 = 0;\n float zF2 = 0;\n\n float dist;\n\n for (int yCur = yInt - 2; yCur <= yInt + 2; yCur++) \{\n for (int xCur = xInt - 2; xCur <= xInt + 2; xCur++) \{\n for (int zCur = zInt - 2; zCur <= zInt + 2; zCur++) \{\n // Calculate the position and distance to the seed point inside of\n // this unit cube.\n float xPos = xCur + ValueNoise3D(xCur, yCur, zCur, seed );\n float yPos = yCur + ValueNoise3D(xCur, yCur, zCur, seed + 1);\n float zPos = zCur + ValueNoise3D(xCur, yCur, zCur, seed + 2);\n\n float xDist = xPos - x;\n float yDist = yPos - y;\n float zDist = zPos - z;\n\n dist = xDist * xDist + yDist * yDist + zDist * zDist;\n if (dist < minDist) \{\n // This seed point is closer to any others found so far, so record\n // this seed point.\n minDist = dist;\n xF2 = xF1;\n yF2 = yF1;\n xF2 = zF1;\n xF1 = xPos;\n yF1 = yPos;\n zF1 = zPos;\n \}\n \}\n \}\n \}\n\n float F1 = 0.0;\n float F2 = 0.0;\n if (distance) \{\n // Determine the distance to the nearest seed point.\n float xDist = xF1 - x;\n float yDist = yF1 - y;\n float zDist = zF1 - z;\n F1 = xDist*xDist + yDist*yDist + zDist*zDist;\n xDist = xF2 - x;\n yDist = yF2 - y;\n zDist = zF2 - z;\n F2 = xDist*xDist + yDist*yDist + zDist*zDist;\n \}\n value = F1;\n /*\n if ( type == 1 ) \{\n value = F2;\n \} else \{\n if ( type == 2 ) \{\n value = F1 * F2;\n \} else \{\n if ( type == 3 ) \{\n value = F2 - F1;\n \} else \{\n if ( type == 4 ) \{\n value = F1 + F2;\n \}\n \}\n \}\n \}\n */\n value += (displacement * (float)ValueNoise3D( (int)(floor(xF1)), (int)(floor(yF1)), (int)(floor(zF1)), seed)) + displacement;\n\n value = ((value - cell_size)*(1/cell_softness));\n\n if (invert) \{\n value = 1 - value;\n \}\n \} else \{\n value = 0.0f;\n \}\n for (int c = 0; c < dst.kComps; c++)\n dst(c) = value;\n \}\n\};\n\n"
  1011. rebuild ""
  1012. Worley3D_Offset {0.3249999881 -0.009999999776 -0.25}
  1013. Worley3D_Frequency {{parent.Axis1.uniform_scale}}
  1014. Worley3D_Seed 1
  1015. Worley3D_Cellsoftness 0
  1016. maxGPUMemory 53
  1017. maxTileLines 15.5
  1018. name BlinkScript1
  1019. xpos 180
  1020. ypos 80
  1021. }
  1022. push $N49470790
  1023. Expression {
  1024. channel0 rgb
  1025. expr0 "\[value this.noiseType](r*axisScale.x*scale,g*axisScale.y*scale,b*axisScale.z*scale,octaves,lacunarity,gain)"
  1026. channel1 {-rgba.red -rgba.green -rgba.blue none}
  1027. channel2 {-rgba.red -rgba.green -rgba.blue none}
  1028. name PToN_exp
  1029. xpos -8
  1030. ypos 38
  1031. addUserKnob {20 User}
  1032. addUserKnob {13 axisScale}
  1033. axisScale {{parent.Axis1.scaling.x} {parent.Axis1.scaling.y} {parent.Axis1.scaling.z}}
  1034. addUserKnob {20 endGroup n -1}
  1035. addUserKnob {7 scale R 0.01 10}
  1036. scale {{parent.Axis1.uniform_scale}}
  1037. addUserKnob {20 endGroup_1 l endGroup n -1}
  1038. addUserKnob {3 octaves l Octaves}
  1039. octaves 5
  1040. addUserKnob {7 lacunarity l Lacunarity R 1 10}
  1041. lacunarity 2
  1042. addUserKnob {7 gain l Gain R 0.1 1}
  1043. gain 0.1
  1044. addUserKnob {6 center_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
  1045. addUserKnob {4 noiseType M {fBm turbulence worley "" ""}}
  1046. noiseType worley
  1047. }
  1048. Switch {
  1049. inputs 2
  1050. which {{"parent.PToN_exp.noiseType == 2 "}}
  1051. name Switch1
  1052. xpos -8
  1053. ypos 86
  1054. }
  1055. Invert {
  1056. channels rgb
  1057. mix {{parent.invert}}
  1058. name Invert1
  1059. xpos -8
  1060. ypos 134
  1061. }
  1062. set N494711e0 [stack 0]
  1063. push $N49470420
  1064. Expression {
  1065. temp_name0 dist
  1066. temp_expr0 "sqrt( (r*axisScale.x-center.r)*(r*axisScale.x-center.r)+(g*axisScale.y-center.g)*(g*axisScale.y-center.g)+(b*axisScale.z-center.b)*(b*axisScale.z-center.b))"
  1067. channel0 rgba
  1068. expr0 1-dist/ringScale
  1069. name radial_fromPointPos3
  1070. xpos -260
  1071. ypos 38
  1072. addUserKnob {20 User}
  1073. addUserKnob {13 axisScale}
  1074. axisScale {{parent.Axis1.scaling.x} {parent.Axis1.scaling.y} {parent.Axis1.scaling.z}}
  1075. addUserKnob {7 ringScale R 0.1 100}
  1076. ringScale 27.5
  1077. addUserKnob {18 center}
  1078. center {{parent.position.x} {parent.position.y} {parent.position.z}}
  1079. addUserKnob {6 center_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
  1080. }
  1081. ColorCorrect {
  1082. inputs 1+1
  1083. shadows.offset -0.48
  1084. midtones.offset -0.009
  1085. highlights.offset 0.0005
  1086. lookup {shadow {curve 1 s0 x0.4069852531 0 s0}
  1087. midtone {1-shadow-highlight}
  1088. highlight {curve x0.4272058308 0 s0 x1 1 s0}}
  1089. maskChannelMask rgba.red
  1090. invert_mask true
  1091. name ColorCorrect1
  1092. xpos -260
  1093. ypos 134
  1094. }
  1095. push $N494711e0
  1096. Switch {
  1097. inputs 2
  1098. which {{parent.activate}}
  1099. name Switch2
  1100. xpos -8
  1101. ypos 230
  1102. }
  1103. set N49427110 [stack 0]
  1104. Output {
  1105. name Output1
  1106. xpos -8
  1107. ypos 328
  1108. }
  1109. push $N49427110
  1110. Viewer {
  1111. input_process false
  1112. name Viewer1
  1113. xpos -260
  1114. ypos 350
  1115. }
  1116. Input {
  1117. inputs 0
  1118. name Transform_3D
  1119. xpos 180
  1120. ypos -250
  1121. number 1
  1122. }
  1123. Axis2 {
  1124. translate {0 0 {curve l x101 0 x201 -5}}
  1125. uniform_scale 0.32
  1126. name Axis1
  1127. xpos 190
  1128. ypos -150
  1129. }
  1130. end_group
  1131. Grade {
  1132. channels rgba
  1133. blackpoint 0.1
  1134. white 1.14
  1135. gamma 0.7
  1136. name Grade10
  1137. xpos 400
  1138. ypos 472
  1139. }
  1140. ShuffleCopy {
  1141. inputs 2
  1142. in rgb
  1143. red red
  1144. green green
  1145. out forward
  1146. name ShuffleCopy3
  1147. xpos 400
  1148. ypos 518
  1149. }
  1150. Dot {
  1151. name Dot4
  1152. xpos 434
  1153. ypos 570
  1154. }
  1155. set N49472d60 [stack 0]
  1156. Dot {
  1157. name Dot5
  1158. xpos 324
  1159. ypos 570
  1160. }
  1161. IDistort {
  1162. channels rgba
  1163. uv forward
  1164. uv_scale 12.2
  1165. name IDistort2
  1166. xpos 290
  1167. ypos 682
  1168. }
  1169. Blur {
  1170. channels rgba
  1171. size 5
  1172. name Blur4
  1173. xpos 290
  1174. ypos 710
  1175. }
  1176. ColorLookup {
  1177. lut {master {curve K x-0.1725826263 0 x0 0 S x0.8953607678 -0.007765769958 x1.044760942 1.911101222 s0}
  1178. red {}
  1179. green {}
  1180. blue {}
  1181. alpha {}}
  1182. name ColorLookup2
  1183. xpos 290
  1184. ypos 736
  1185. }
  1186. push 0
  1187. push $N49472d60
  1188. Blur {
  1189. channels rgba
  1190. size 5
  1191. name Blur8
  1192. xpos 400
  1193. ypos 614
  1194. }
  1195. set N49473e90 [stack 0]
  1196. ColorLookup {
  1197. lut {master {curve C 0 L x0.530856967 -0.006214966853 S x0.5530700684 0.1684975622 x0.6423245072 0.1684975622 L x0.6729414463 -0.006054009556}
  1198. red {}
  1199. green {}
  1200. blue {}
  1201. alpha {}}
  1202. name ColorLookup7
  1203. xpos 510
  1204. ypos 614
  1205. }
  1206. Blur {
  1207. channels rgba
  1208. size 0.5
  1209. name Blur10
  1210. xpos 510
  1211. ypos 638
  1212. }
  1213. IDistort {
  1214. channels rgba
  1215. uv forward
  1216. uv_scale {4.5 5.5}
  1217. name IDistort4
  1218. xpos 510
  1219. ypos 686
  1220. }
  1221. ColorLookup {
  1222. lut {master {curve C x0.1212719381 0.008208930492 x0.1598684192 1}
  1223. red {}
  1224. green {}
  1225. blue {}
  1226. alpha {}}
  1227. name ColorLookup6
  1228. xpos 510
  1229. ypos 734
  1230. }
  1231. push $N49473e90
  1232. ColorLookup {
  1233. lut {master {curve C 0 L x0.783757627 -0.003996809694 K x0.783757627 1.452235222 x0.8517802358 1.452235222 L x0.8517802358 -0.003838388943}
  1234. red {}
  1235. green {}
  1236. blue {}
  1237. alpha {}}
  1238. name ColorLookup5
  1239. xpos 400
  1240. ypos 640
  1241. }
  1242. IDistort {
  1243. channels rgba
  1244. uv forward
  1245. uv_scale {19 0}
  1246. name IDistort3
  1247. xpos 400
  1248. ypos 686
  1249. }
  1250. Merge2 {
  1251. inputs 3+1
  1252. operation screen
  1253. name Merge4
  1254. xpos 400
  1255. ypos 806
  1256. }
  1257. Grade {
  1258. inputs 1+1
  1259. white 0
  1260. invert_mask true
  1261. name Grade4
  1262. xpos 400
  1263. ypos 878
  1264. }
  1265. Merge2 {
  1266. inputs 2
  1267. operation multiply
  1268. name Merge1
  1269. xpos 400
  1270. ypos 976
  1271. }
  1272. Merge2 {
  1273. inputs 2
  1274. operation max
  1275. name Merge2
  1276. xpos 400
  1277. ypos 1002
  1278. }
  1279. IDistort {
  1280. channels rgba
  1281. uv forward
  1282. uv_scale 31
  1283. name IDistort1
  1284. xpos 400
  1285. ypos 1070
  1286. }
  1287. set N49476460 [stack 0]
  1288. Glow2 {
  1289. tolerance 0.355
  1290. brightness 5
  1291. saturation 0
  1292. effect_only true
  1293. size 612.5
  1294. name Glow5
  1295. xpos 510
  1296. ypos 1094
  1297. disable true
  1298. }
  1299. push $N49476460
  1300. Glow2 {
  1301. tolerance 0.805
  1302. brightness 0.5
  1303. size 300
  1304. name Glow3
  1305. xpos 400
  1306. ypos 1094
  1307. disable true
  1308. }
  1309. Grade {
  1310. inputs 1+1
  1311. white 0.66
  1312. maskChannelMask rgba.red
  1313. invert_mask true
  1314. name Grade1
  1315. xpos 400
  1316. ypos 1142
  1317. }
  1318. set N49476eb0 [stack 0]
  1319. Dot {
  1320. name Dot6
  1321. xpos 214
  1322. ypos 1146
  1323. }
  1324. Grade {
  1325. white {8.708999634 3.824805737 0.1413806975 0}
  1326. name Grade2
  1327. xpos 180
  1328. ypos 1262
  1329. }
  1330. set N49477590 [stack 0]
  1331. ColorCorrect {
  1332. saturation 0.82
  1333. name ColorCorrect2
  1334. xpos 180
  1335. ypos 1310
  1336. }
  1337. push $N495038a0
  1338. push $N49477590
  1339. push $N49502ae0
  1340. push $N49476eb0
  1341. Grade {
  1342. inputs 1+1
  1343. channels rgba
  1344. white 0
  1345. multiply 1.36
  1346. black_clamp false
  1347. maskChannelMask rgba.red
  1348. invert_mask true
  1349. name Grade29
  1350. xpos 400
  1351. ypos 1214
  1352. }
  1353. Merge2 {
  1354. inputs 2+1
  1355. operation screen
  1356. name Merge3
  1357. xpos 400
  1358. ypos 1262
  1359. }
  1360. Merge2 {
  1361. inputs 2+1
  1362. operation screen
  1363. maskChannelMask rgba.red
  1364. name Merge6
  1365. xpos 400
  1366. ypos 1310
  1367. }
  1368. ShuffleCopy {
  1369. inputs 2
  1370. red red
  1371. out alpha
  1372. name ShuffleCopy2
  1373. xpos 400
  1374. ypos 1382
  1375. }
  1376. push $N49502ae0
  1377. Grade {
  1378. blackpoint -0.066
  1379. whitepoint 0.012
  1380. white {1 1 1 1}
  1381. gamma 0.17
  1382. black_clamp false
  1383. name Grade7
  1384. xpos 730
  1385. ypos 1326
  1386. }
  1387. Grade {
  1388. white {1 0.1884988546 0 1}
  1389. white_clamp true
  1390. name Grade8
  1391. xpos 730
  1392. ypos 1384
  1393. }
  1394. Blur {
  1395. channels rgb
  1396. size 5
  1397. name Blur1
  1398. xpos 730
  1399. ypos 1410
  1400. }
  1401. Merge2 {
  1402. inputs 2
  1403. name Merge5
  1404. xpos 400
  1405. ypos 1408
  1406. }
  1407. set N49479110 [stack 0]
  1408. Output {
  1409. name Output1
  1410. xpos 400
  1411. ypos 1478
  1412. }
  1413. push $N49479110
  1414. Viewer {
  1415. frame 139
  1416. colour_sample_bbox {0.7453125119 -0.5421875119 0.7458333373 -0.5416666865}
  1417. samplepoints {{0.7453125119 -0.5421875119}
  1418. }
  1419. viewerProcess rec709
  1420. input_process false
  1421. name Viewer1
  1422. selected true
  1423. xpos 772
  1424. ypos 1454
  1425. }
  1426. end_group
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement