Brak opisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

EnvConvolve.gizmo 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  1. #! ./Contents/MacOS/Nuke6.1v2b5 -nx
  2. version 6.1 v2b5
  3. Gizmo {
  4. help "A fast (FFT-based) approximation of brute force environment map convolution a la HDR Shop, using a Phong BRDF. The output image is seamless and can be diffuse or specular.\n\nFor a diffuse surface, a 512*256 map will hold enough detail. Higher resolution is required depending on how specular the surface is."
  5. addUserKnob {20 EnvConvolve l "Env Convolve"}
  6. addUserKnob {7 phexp l exponent t "Set to 1 is a diffuse surface. Anything higher exponentially increases glossiness/specularity." R 1 200}
  7. phexp 1
  8. }
  9. BackdropNode {
  10. inputs 0
  11. name BackdropNode18
  12. tile_color 0x7171c600
  13. label "Phong BRDF"
  14. note_font_size 24
  15. xpos -1331
  16. ypos -177
  17. bdwidth 197
  18. bdheight 176
  19. }
  20. BackdropNode {
  21. inputs 0
  22. name BackdropNode4
  23. tile_color 0x8e8e3800
  24. label -Z
  25. note_font_size 24
  26. xpos -925
  27. ypos -494
  28. bdwidth 216
  29. bdheight 142
  30. }
  31. BackdropNode {
  32. inputs 0
  33. name BackdropNode12
  34. tile_color 0x8e8e3800
  35. label +Z
  36. note_font_size 24
  37. xpos -586
  38. ypos -495
  39. bdwidth 216
  40. bdheight 142
  41. }
  42. Input {
  43. inputs 0
  44. name Input
  45. xpos -1033
  46. ypos -1072
  47. }
  48. set N1bf4fdc0 [stack 0]
  49. Dot {
  50. name Dot4
  51. xpos -1492
  52. ypos -958
  53. }
  54. Dot {
  55. name Dot6
  56. xpos -1492
  57. ypos 856
  58. }
  59. push $N1bf4fdc0
  60. Shuffle {
  61. red black
  62. green black
  63. blue black
  64. alpha white
  65. name Shuffle1
  66. xpos -1033
  67. ypos -763
  68. }
  69. set N2d59780 [stack 0]
  70. Reformat {
  71. type scale
  72. name Reformat3
  73. label "Pass through"
  74. xpos -723
  75. ypos -741
  76. }
  77. Expression {
  78. expr0 cos(2*PI*x/size.w+PI/2)*sin(PI*(y/size.h))
  79. expr1 cos(PI*(1-y/size.h))
  80. expr2 cos(2*PI*x/size.w)*sin(PI*(y/size.h))
  81. name Expression3
  82. label "latlong unit sphere"
  83. selected true
  84. xpos -723
  85. ypos -701
  86. postage_stamp true
  87. addUserKnob {20 User}
  88. addUserKnob {14 size R 0 100}
  89. size {{!proxy?input.width:(input.width/proxy_scale) i} {!proxy?input.height:(input.height/proxy_scale) i}}
  90. }
  91. set N23ae86b0 [stack 0]
  92. Dot {
  93. name Dot3
  94. xpos -262
  95. ypos -666
  96. }
  97. Dot {
  98. name Dot2
  99. xpos -276
  100. ypos 397
  101. }
  102. Dot {
  103. name Dot1
  104. xpos -809
  105. ypos 397
  106. }
  107. set N2d6db10 [stack 0]
  108. Shuffle {
  109. alpha blue
  110. name Shuffle4
  111. label "Z direction to alpha"
  112. xpos -843
  113. ypos 704
  114. }
  115. Grade {
  116. channels alpha
  117. whitepoint 0.98
  118. gamma 0.8
  119. white_clamp true
  120. name Grade1
  121. xpos -843
  122. ypos 744
  123. }
  124. push $N2d6db10
  125. Group {
  126. name RotationMatrix3
  127. help "Use this for rotating xyz vector data such as P and N."
  128. xpos -776
  129. ypos 476
  130. addUserKnob {20 RotationMatrix}
  131. addUserKnob {13 rot l rotation t "Link to say axis' or camera's rotate.\nYaw = y axis.\nPitch = x axis.\nRoll = z axis."}
  132. rot {0 180 0}
  133. }
  134. Input {
  135. inputs 0
  136. name Input
  137. xpos -304
  138. ypos -17
  139. }
  140. ColorMatrix {
  141. matrix {
  142. {{cos(radians(yrot)) i} 0 {-sin(radians(yrot)) i}}
  143. {0 1 0}
  144. {{sin(radians(yrot)) i} 0 {cos(radians(yrot)) i}}
  145. }
  146. name ColorMatrix14
  147. label "yrot (yaw)"
  148. xpos -304
  149. ypos 89
  150. addUserKnob {20 "" l User}
  151. addUserKnob {7 yrot l "y rotation" R -90 90}
  152. yrot {{parent.rot.y i}}
  153. }
  154. ColorMatrix {
  155. matrix {
  156. {1 0 0}
  157. {0 {cos(radians(xrot)) i} {sin(radians(xrot)) i}}
  158. {0 {-sin(radians(xrot)) i} {cos(radians(xrot)) i}}
  159. }
  160. name ColorMatrix15
  161. label "xrot (pitch)\n"
  162. xpos -304
  163. ypos 127
  164. addUserKnob {20 "" l User}
  165. addUserKnob {7 xrot l "x rotation" R -90 90}
  166. xrot {{parent.rot.x i}}
  167. }
  168. ColorMatrix {
  169. matrix {
  170. {{cos(radians(zrot)) i} {sin(radians(zrot)) i} 0}
  171. {{-sin(radians(zrot)) i} {cos(radians(zrot)) i} 0}
  172. {0 0 1}
  173. }
  174. name ColorMatrix13
  175. label "zrot (roll)"
  176. xpos -304
  177. ypos 165
  178. addUserKnob {20 "" l User}
  179. addUserKnob {7 zrot l "z rotation" R -90 90}
  180. zrot {{parent.rot.z i}}
  181. }
  182. Output {
  183. name Output1
  184. xpos -304
  185. ypos 280
  186. }
  187. end_group
  188. Expression {
  189. temp_name0 radius
  190. temp_expr0 ".5/pi*acos(-b)/sqrt(r*r + g*g)"
  191. expr0 "0.5 + (r*radius)"
  192. expr1 "0.5 + (g*radius)"
  193. expr2 0
  194. name AngularMapProjection3
  195. xpos -776
  196. ypos 502
  197. }
  198. push $N2d59780
  199. Reformat {
  200. type scale
  201. scale {1 2}
  202. resize none
  203. name Reformat2
  204. xpos -1033
  205. ypos -335
  206. }
  207. Expression {
  208. expr0 (pi+atan(cx,cy))/(2*pi)
  209. expr1 sqrt((cx**2)+(cy**2))
  210. expr2 0
  211. name st2polar1
  212. xpos -1033
  213. ypos -291
  214. }
  215. set N1bf5aa60 [stack 0]
  216. push $N1bf5aa60
  217. push $N2d59780
  218. Reformat {
  219. type scale
  220. scale 2
  221. name Reformat1
  222. xpos -1230
  223. ypos -523
  224. }
  225. Expression {
  226. expr0 cos(2*PI*x/size.w+PI/2)*sin(PI*(y/size.h))
  227. expr1 cos(PI*(1-y/size.h))
  228. expr2 cos(2*PI*x/size.w)*sin(PI*(y/size.h))
  229. name Expression1
  230. label "latlong unit sphere"
  231. xpos -1230
  232. ypos -497
  233. postage_stamp true
  234. addUserKnob {20 User}
  235. addUserKnob {14 size R 0 100}
  236. size {{!proxy?input.width:(input.width/proxy_scale) i} {!proxy?input.height:(input.height/proxy_scale) i}}
  237. }
  238. Group {
  239. name RotationMatrix1
  240. help "Use this for rotating xyz vector data such as P and N."
  241. label identity
  242. xpos -1230
  243. ypos -409
  244. addUserKnob {20 RotationMatrix}
  245. addUserKnob {13 rot l rotation t "Link to say axis' or camera's rotate.\nYaw = y axis.\nPitch = x axis.\nRoll = z axis."}
  246. rot {0 90 -90}
  247. }
  248. Input {
  249. inputs 0
  250. name Input
  251. xpos -304
  252. ypos -17
  253. }
  254. ColorMatrix {
  255. matrix {
  256. {{cos(radians(yrot)) i} 0 {-sin(radians(yrot)) i}}
  257. {0 1 0}
  258. {{sin(radians(yrot)) i} 0 {cos(radians(yrot)) i}}
  259. }
  260. name ColorMatrix14
  261. label "yrot (yaw)"
  262. xpos -304
  263. ypos 89
  264. addUserKnob {20 "" l User}
  265. addUserKnob {7 yrot l "y rotation" R -90 90}
  266. yrot {{parent.rot.y i}}
  267. }
  268. ColorMatrix {
  269. matrix {
  270. {1 0 0}
  271. {0 {cos(radians(xrot)) i} {sin(radians(xrot)) i}}
  272. {0 {-sin(radians(xrot)) i} {cos(radians(xrot)) i}}
  273. }
  274. name ColorMatrix15
  275. label "xrot (pitch)\n"
  276. xpos -304
  277. ypos 127
  278. addUserKnob {20 "" l User}
  279. addUserKnob {7 xrot l "x rotation" R -90 90}
  280. xrot {{parent.rot.x i}}
  281. }
  282. ColorMatrix {
  283. matrix {
  284. {{cos(radians(zrot)) i} {sin(radians(zrot)) i} 0}
  285. {{-sin(radians(zrot)) i} {cos(radians(zrot)) i} 0}
  286. {0 0 1}
  287. }
  288. name ColorMatrix13
  289. label "zrot (roll)"
  290. xpos -304
  291. ypos 165
  292. addUserKnob {20 "" l User}
  293. addUserKnob {7 zrot l "z rotation" R -90 90}
  294. zrot {{parent.rot.z i}}
  295. }
  296. Output {
  297. name Output1
  298. xpos -304
  299. ypos 280
  300. }
  301. end_group
  302. Shuffle {
  303. red blue
  304. blue red
  305. name Shuffle3
  306. xpos -1230
  307. ypos -351
  308. }
  309. STMap {
  310. inputs 2
  311. channels rgb
  312. uv rgb
  313. name STMap25
  314. label "latlong to angular"
  315. xpos -1230
  316. ypos -298
  317. }
  318. CopyBBox {
  319. inputs 2
  320. name CopyBBox1
  321. xpos -1230
  322. ypos -260
  323. }
  324. Dot {
  325. name Dot9
  326. xpos -1196
  327. ypos -131
  328. }
  329. set N2dac150 [stack 0]
  330. Shuffle {
  331. red black
  332. green black
  333. blue white
  334. name Shuffle2
  335. label "Make +z vector"
  336. xpos -1313
  337. ypos -121
  338. }
  339. push $N2dac150
  340. MergeExpression {
  341. inputs 2
  342. temp_name0 DotProduct
  343. temp_expr0 (Ar*Br)+(Ag*Bg)+(Ab*Bb)
  344. channel0 rgb
  345. expr0 max(0,DotProduct)
  346. name MergeExpression2
  347. label "dot product (N.L)"
  348. xpos -1230
  349. ypos -74
  350. }
  351. Expression {
  352. channel0 rgb
  353. expr0 pow(r,phexp)
  354. channel1 none
  355. channel2 {-rgba.red -rgba.green -rgba.blue}
  356. channel3 {none none none -rgba.alpha}
  357. name PhongExponent1
  358. xpos -1230
  359. ypos -34
  360. addUserKnob {20 User}
  361. addUserKnob {7 phexp l "phong exponent" R 1 200}
  362. phexp {{parent.phexp.main i}}
  363. }
  364. FFT {
  365. channels rgb
  366. normalize_input true
  367. center_kernel true
  368. name FFT3
  369. xpos -863
  370. ypos 208
  371. }
  372. set N17580a10 [stack 0]
  373. push $N1bf5aa60
  374. push $N23ae86b0
  375. Group {
  376. name RotationMatrix4
  377. help "Use this for rotating xyz vector data such as P and N."
  378. label identity
  379. xpos -723
  380. ypos -593
  381. addUserKnob {20 RotationMatrix}
  382. addUserKnob {13 rot l rotation t "Link to say axis' or camera's rotate.\nYaw = y axis.\nPitch = x axis.\nRoll = z axis."}
  383. rot {0 90 -90}
  384. }
  385. Input {
  386. inputs 0
  387. name Input
  388. xpos -304
  389. ypos -17
  390. }
  391. ColorMatrix {
  392. matrix {
  393. {{cos(radians(yrot)) i} 0 {-sin(radians(yrot)) i}}
  394. {0 1 0}
  395. {{sin(radians(yrot)) i} 0 {cos(radians(yrot)) i}}
  396. }
  397. name ColorMatrix14
  398. label "yrot (yaw)"
  399. xpos -304
  400. ypos 89
  401. addUserKnob {20 "" l User}
  402. addUserKnob {7 yrot l "y rotation" R -90 90}
  403. yrot {{parent.rot.y i}}
  404. }
  405. ColorMatrix {
  406. matrix {
  407. {1 0 0}
  408. {0 {cos(radians(xrot)) i} {sin(radians(xrot)) i}}
  409. {0 {-sin(radians(xrot)) i} {cos(radians(xrot)) i}}
  410. }
  411. name ColorMatrix15
  412. label "xrot (pitch)\n"
  413. xpos -304
  414. ypos 127
  415. addUserKnob {20 "" l User}
  416. addUserKnob {7 xrot l "x rotation" R -90 90}
  417. xrot {{parent.rot.x i}}
  418. }
  419. ColorMatrix {
  420. matrix {
  421. {{cos(radians(zrot)) i} {sin(radians(zrot)) i} 0}
  422. {{-sin(radians(zrot)) i} {cos(radians(zrot)) i} 0}
  423. {0 0 1}
  424. }
  425. name ColorMatrix13
  426. label "zrot (roll)"
  427. xpos -304
  428. ypos 165
  429. addUserKnob {20 "" l User}
  430. addUserKnob {7 zrot l "z rotation" R -90 90}
  431. zrot {{parent.rot.z i}}
  432. }
  433. Output {
  434. name Output1
  435. xpos -304
  436. ypos 280
  437. }
  438. end_group
  439. set N1bf9e760 [stack 0]
  440. Group {
  441. name RotationMatrix2
  442. help "Use this for rotating xyz vector data such as P and N."
  443. xpos -575
  444. ypos -440
  445. addUserKnob {20 RotationMatrix}
  446. addUserKnob {13 rot l rotation t "Link to say axis' or camera's rotate.\nYaw = y axis.\nPitch = x axis.\nRoll = z axis."}
  447. rot {0 180 0}
  448. }
  449. Input {
  450. inputs 0
  451. name Input
  452. xpos -304
  453. ypos -17
  454. }
  455. ColorMatrix {
  456. matrix {
  457. {{cos(radians(yrot)) i} 0 {-sin(radians(yrot)) i}}
  458. {0 1 0}
  459. {{sin(radians(yrot)) i} 0 {cos(radians(yrot)) i}}
  460. }
  461. name ColorMatrix14
  462. label "yrot (yaw)"
  463. xpos -304
  464. ypos 89
  465. addUserKnob {20 "" l User}
  466. addUserKnob {7 yrot l "y rotation" R -90 90}
  467. yrot {{parent.rot.y i}}
  468. }
  469. ColorMatrix {
  470. matrix {
  471. {1 0 0}
  472. {0 {cos(radians(xrot)) i} {sin(radians(xrot)) i}}
  473. {0 {-sin(radians(xrot)) i} {cos(radians(xrot)) i}}
  474. }
  475. name ColorMatrix15
  476. label "xrot (pitch)\n"
  477. xpos -304
  478. ypos 127
  479. addUserKnob {20 "" l User}
  480. addUserKnob {7 xrot l "x rotation" R -90 90}
  481. xrot {{parent.rot.x i}}
  482. }
  483. ColorMatrix {
  484. matrix {
  485. {{cos(radians(zrot)) i} {sin(radians(zrot)) i} 0}
  486. {{-sin(radians(zrot)) i} {cos(radians(zrot)) i} 0}
  487. {0 0 1}
  488. }
  489. name ColorMatrix13
  490. label "zrot (roll)"
  491. xpos -304
  492. ypos 165
  493. addUserKnob {20 "" l User}
  494. addUserKnob {7 zrot l "z rotation" R -90 90}
  495. zrot {{parent.rot.z i}}
  496. }
  497. Output {
  498. name Output1
  499. xpos -304
  500. ypos 280
  501. }
  502. end_group
  503. Expression {
  504. temp_name0 u
  505. temp_expr0 0.5*(1+atan(b,r)/pi)
  506. temp_name1 v
  507. temp_expr1 acos(-g)/pi
  508. expr0 u
  509. expr1 v
  510. expr2 0
  511. channel3 {none none none -rgba.alpha}
  512. name SphericalProjection6
  513. label "Convert normals \nto latlong UV coords"
  514. xpos -575
  515. ypos -414
  516. }
  517. push $N1bf4fdc0
  518. Dot {
  519. name Dot5
  520. xpos -431
  521. ypos -630
  522. }
  523. set N1bfdf7e0 [stack 0]
  524. STMap {
  525. inputs 2
  526. channels rgb
  527. uv rgb
  528. name STMap14
  529. xpos -465
  530. ypos -400
  531. }
  532. STMap {
  533. inputs 2
  534. channels rgb
  535. uv rgb
  536. name STMap15
  537. label "latlong to angular"
  538. xpos -682
  539. ypos 228
  540. }
  541. Group {
  542. inputs 2
  543. name FFTConvolve3
  544. xpos -682
  545. ypos 307
  546. }
  547. Input {
  548. inputs 0
  549. name brdf
  550. xpos -768
  551. ypos -542
  552. number 1
  553. }
  554. Input {
  555. inputs 0
  556. name probe
  557. xpos -592
  558. ypos -543
  559. }
  560. FFT {
  561. channels rgb
  562. name FFT1
  563. xpos -615
  564. ypos -466
  565. }
  566. FFTMultiply {
  567. inputs 2
  568. channels rgb
  569. name FFTMultiply4
  570. xpos -669
  571. ypos -404
  572. }
  573. InvFFT {
  574. channels rgb
  575. name InvFFT4
  576. xpos -669
  577. ypos -378
  578. }
  579. Output {
  580. name Output1
  581. xpos -669
  582. ypos -278
  583. }
  584. end_group
  585. STMap {
  586. inputs 2
  587. channels rgba
  588. uv rgb
  589. name STMap26
  590. xpos -682
  591. ypos 560
  592. }
  593. push $N2d6db10
  594. Expression {
  595. temp_name0 radius
  596. temp_expr0 ".5/pi*acos(-b)/sqrt(r*r + g*g)"
  597. expr0 "0.5 + (r*radius)"
  598. expr1 "0.5 + (g*radius)"
  599. expr2 0
  600. name AngularMapProjection
  601. xpos -964
  602. ypos 500
  603. }
  604. push $N17580a10
  605. push $N1bf5aa60
  606. push $N1bf9e760
  607. Expression {
  608. temp_name0 u
  609. temp_expr0 0.5*(1+atan(b,r)/pi)
  610. temp_name1 v
  611. temp_expr1 acos(-g)/pi
  612. expr0 u
  613. expr1 v
  614. expr2 0
  615. channel3 {none none none -rgba.alpha}
  616. name SphericalProjection5
  617. label "Convert normals \nto latlong UV coords"
  618. xpos -914
  619. ypos -413
  620. }
  621. push $N1bfdf7e0
  622. STMap {
  623. inputs 2
  624. channels rgb
  625. uv rgb
  626. name STMap13
  627. xpos -804
  628. ypos -399
  629. }
  630. STMap {
  631. inputs 2
  632. channels rgb
  633. uv rgb
  634. name STMap12
  635. label "latlong to angular"
  636. xpos -1033
  637. ypos 209
  638. }
  639. Group {
  640. inputs 2
  641. name FFTConvolve1
  642. xpos -1033
  643. ypos 305
  644. }
  645. Input {
  646. inputs 0
  647. name brdf
  648. xpos -768
  649. ypos -542
  650. number 1
  651. }
  652. Input {
  653. inputs 0
  654. name probe
  655. xpos -592
  656. ypos -543
  657. }
  658. FFT {
  659. channels rgb
  660. name FFT1
  661. xpos -615
  662. ypos -466
  663. }
  664. FFTMultiply {
  665. inputs 2
  666. channels rgb
  667. name FFTMultiply4
  668. xpos -669
  669. ypos -404
  670. }
  671. InvFFT {
  672. channels rgb
  673. name InvFFT4
  674. xpos -669
  675. ypos -378
  676. }
  677. Output {
  678. name Output1
  679. xpos -669
  680. ypos -278
  681. }
  682. end_group
  683. STMap {
  684. inputs 2
  685. channels rgba
  686. uv rgb
  687. name STMap24
  688. xpos -1033
  689. ypos 566
  690. }
  691. Keymix {
  692. inputs 3
  693. channels rgb
  694. name Keymix3
  695. xpos -843
  696. ypos 852
  697. }
  698. CopyBBox {
  699. inputs 2
  700. name CopyBBox2
  701. xpos -843
  702. ypos 897
  703. }
  704. Output {
  705. name Output1
  706. xpos -843
  707. ypos 1015
  708. }
  709. end_group