Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

2 лет назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858
  1. ---
  2. sidebar: auto
  3. ---
  4. # Material 🌎
  5. In the real world, each object would react differently to light. Steel looks more shiny than a ceramic vase, and a wooden box would not reflect light as strongly as a steel box. Each object also reacts differently to specular highlights. Some objects don't scatter a lot of light but reflect a lot of light, resulting in a smaller highlight, and some objects scatter a lot and they produce a larger radius highlight. If we want to simulate multiple types of objects in OpenGL, we must define the Material property for each object separately.
  6. ## DC.ColorMaterialProperty
  7. ### example
  8. ```js
  9. let material = new DC.ColorMaterialProperty(DC.Color.RED)
  10. ```
  11. ### creation
  12. - **_constructor(color)_**
  13. - parameters
  14. - `{DC.Color} color`
  15. - returns `material`
  16. ## DC.ImageMaterialProperty
  17. ### example
  18. ```js
  19. let material = new DC.ImageMaterialProperty({
  20. image: '**/**.png',
  21. transparent: true,
  22. })
  23. ```
  24. ### creation
  25. - **_constructor([options])_**
  26. - parameters
  27. - `{Object} options`
  28. - returns `material`
  29. ```json
  30. //options(optional)
  31. {
  32. "image": "",
  33. "repeat": { "x": 1, "y": 1 },
  34. "color": DC.Color.WHITE,
  35. "transparent": false
  36. }
  37. ```
  38. ### properties
  39. - `{String} image`
  40. - `{Object} repeat`
  41. - `{DC.Color} color`
  42. - `{Boolean} transparent`
  43. ## DC.CircleBlurMaterialProperty
  44. ### example
  45. ```js
  46. let material = new DC.CircleBlurMaterialProperty({
  47. color: DC.Color.WHITE,
  48. })
  49. ```
  50. ### creation
  51. - **_constructor([options])_**
  52. - parameters
  53. - `{Object} options`
  54. - returns `materialProperty`
  55. ```json
  56. // options(optional)
  57. {
  58. "color": DC.Color.WHITE,
  59. "speed": 10
  60. }
  61. ```
  62. ### properties
  63. - `{DC.Color} color`
  64. - `{Number} speed`
  65. ## DC.CircleDiffuseMaterialProperty
  66. ### example
  67. ```js
  68. let material = new DC.CircleDiffuseMaterialProperty({
  69. color: DC.Color.WHITE,
  70. })
  71. ```
  72. ### creation
  73. - **_constructor([options])_**
  74. - parameters
  75. - `{Object} options`
  76. - returns `materialProperty`
  77. ```json
  78. // options(optional)
  79. {
  80. "color": DC.Color.WHITE
  81. "speed": 10
  82. }
  83. ```
  84. ### properties
  85. - `{DC.Color} color`
  86. - `{Number} speed`
  87. ## DC.CircleFadeMaterialProperty
  88. ### example
  89. ```js
  90. let material = new DC.CircleFadeMaterialProperty({
  91. color: DC.Color.WHITE,
  92. })
  93. ```
  94. ### creation
  95. - **_constructor([options])_**
  96. - parameters
  97. - `{Object} options`
  98. - returns `materialProperty`
  99. ```json
  100. // options(optional)
  101. {
  102. "color": DC.Color.WHITE,
  103. "speed": 10
  104. }
  105. ```
  106. ### properties
  107. - `{DC.Color} color`
  108. - `{Number} speed`
  109. ## DC.CirclePulseMaterialProperty
  110. ### example
  111. ```js
  112. let material = new DC.CirclePulseMaterialProperty({
  113. color: DC.Color.WHITE,
  114. })
  115. ```
  116. ### creation
  117. - **_constructor([options])_**
  118. - parameters
  119. - `{Object} options`
  120. - returns `materialProperty`
  121. ```json
  122. // options(optional)
  123. {
  124. "color": DC.Color.WHITE,
  125. "speed": 10
  126. }
  127. ```
  128. ### properties
  129. - `{DC.Color} color`
  130. - `{Number} speed`
  131. ## DC.CircleScanMaterialProperty
  132. ### example
  133. ```js
  134. let material = new DC.CircleScanMaterialProperty({
  135. color: DC.Color.WHITE,
  136. })
  137. ```
  138. ### creation
  139. - **_constructor([options])_**
  140. - parameters
  141. - `{Object} options`
  142. - returns `material`
  143. ```json
  144. // options(optional)
  145. {
  146. "color": DC.Color.WHITE,
  147. "speed": 10
  148. }
  149. ```
  150. ### properties
  151. - `{DC.Color} color`
  152. - `{Number} speed`
  153. ## DC.CircleSpiralMaterialProperty
  154. ### example
  155. ```js
  156. let material = new DC.CircleSpiralMaterialProperty({
  157. color: DC.Color.WHITE,
  158. })
  159. ```
  160. ### creation
  161. - **_constructor([options])_**
  162. - parameters
  163. - `{Object} options`
  164. - returns `materialProperty`
  165. ```json
  166. // options(optional)
  167. {
  168. "color": DC.Color.WHITE,
  169. "speed": 10
  170. }
  171. ```
  172. ### properties
  173. - `{DC.Color} color`
  174. - `{Number} speed`
  175. ## DC.CircleVaryMaterialProperty
  176. ### example
  177. ```js
  178. let material = new DC.CircleVaryMaterialProperty({
  179. color: DC.Color.WHITE,
  180. })
  181. ```
  182. ### creation
  183. - **_constructor([options])_**
  184. - parameters
  185. - `{Object} options`
  186. - returns `material`
  187. ```json
  188. // options(optional)
  189. {
  190. "color": DC.Color.WHITE,
  191. "speed": 10
  192. }
  193. ```
  194. ### properties
  195. - `{DC.Color} color`
  196. - `{Number} speed`
  197. ## DC.CircleWaveMaterialProperty
  198. ### example
  199. ```js
  200. let material = new DC.CircleWaveMaterialProperty({
  201. color: DC.Color.WHITE,
  202. })
  203. ```
  204. ### creation
  205. - **_constructor([options])_**
  206. - parameters
  207. - `{Object} options`
  208. - returns `material`
  209. ```json
  210. // options(optional)
  211. {
  212. "color": DC.Color.WHITE,
  213. "speed": 10,
  214. "count": 5,
  215. "gradient": 0.1
  216. }
  217. ```
  218. ### properties
  219. - `{Color} color`
  220. - `{Number} speed`
  221. - `{Number} count`
  222. - `{Number} gradient`
  223. ## DC.EllipsoidElectricMaterialProperty
  224. ### example
  225. ```js
  226. let material = new DC.EllipsoidElectricMaterialProperty({
  227. color: DC.Color.WHITE,
  228. })
  229. ```
  230. ### creation
  231. - **_constructor([options])_**
  232. - parameters
  233. - `{Object} options`
  234. - returns `materialProperty`
  235. ```json
  236. // options(optional)
  237. {
  238. "color": DC.Color.WHITE,
  239. "speed": 10
  240. }
  241. ```
  242. ### properties
  243. - `{DC.Color} color`
  244. - `{Number} speed`
  245. ## DC.EllipsoidTrailMaterialProperty
  246. ### example
  247. ```js
  248. let material = new DC.EllipsoidTrailMaterialProperty({
  249. color: DC.Color.WHITE,
  250. })
  251. ```
  252. ### creation
  253. - **_constructor([options])_**
  254. - parameters
  255. - `{Object} options`
  256. - returns `materialProperty`
  257. ```json
  258. // options(optional)
  259. {
  260. "color": DC.Color.WHITE,
  261. "speed": 10
  262. }
  263. ```
  264. ### properties
  265. - `{DC.Color} color`
  266. - `{Number} speed`
  267. ## DC.PolylineDashMaterialProperty
  268. ### example
  269. ```js
  270. let material = new DC.PolylineDashMaterialProperty({
  271. color: DC.Color.WHITE,
  272. })
  273. ```
  274. ### creation
  275. - **_constructor([options])_**
  276. - parameters
  277. - `{Object} options`
  278. - returns `materialProperty`
  279. ```json
  280. // options(optional)
  281. {
  282. "color": DC.Color.WHITE,
  283. "gapColor": DC.Color.TRANSPARENT,
  284. "dashLength": 16.0
  285. }
  286. ```
  287. ### properties
  288. - `{DC.Color} color`
  289. - `{DC.Color} gapColor`
  290. - `{Number} dashLength`
  291. ## DC.PolylineArrowMaterialProperty
  292. ### example
  293. ```js
  294. let material = new DC.PolylineArrowMaterialProperty(DC.Color.WHITE)
  295. ```
  296. ### creation
  297. - **_constructor(color)_**
  298. - parameters
  299. - `{DC.Color} color`
  300. - returns `materialProperty`
  301. ### properties
  302. - `{DC.Color} color`
  303. ## DC.PolylineOutlineMaterialProperty
  304. ### example
  305. ```js
  306. let material = new DC.PolylineOutlineMaterialProperty({
  307. color: DC.Color.WHITE,
  308. outlineColor: DC.Color.BLACK,
  309. })
  310. ```
  311. ### creation
  312. - **_constructor([options])_**
  313. - parameters
  314. - `{Object} options`
  315. - returns `materialProperty`
  316. ```json
  317. // options(optional)
  318. {
  319. "color": DC.Color.WHITE,
  320. "outlineColor": DC.Color.BLACK,
  321. "outlineWidth": 1
  322. }
  323. ```
  324. ### properties
  325. - `{DC.Color} color`
  326. - `{DC.Color} outlineColor`
  327. - `{Number} outlineWidth`
  328. ## DC.PolylineGlowMaterialProperty
  329. ### example
  330. ```js
  331. let material = new DC.PolylineGlowMaterialProperty({
  332. color: DC.Color.WHITE,
  333. glowPower: 0.25,
  334. })
  335. ```
  336. ### creation
  337. - **_constructor([options])_**
  338. - parameters
  339. - `{Object} options`
  340. - returns `materialProperty`
  341. ```json
  342. // options(optional)
  343. {
  344. "color": DC.Color.WHITE,
  345. "glowPower": 0.25,
  346. "taperPower": 1
  347. }
  348. ```
  349. ### properties
  350. - `{DC.Color} color`
  351. - `{Number} glowPower`
  352. - `{Number} taperPower`
  353. ## DC.PolylineFlickerMaterialProperty
  354. ### example
  355. ```js
  356. let material = new DC.PolylineFlickerMaterialProperty({
  357. color: DC.Color.WHITE,
  358. })
  359. ```
  360. ### creation
  361. - **_constructor([options])_**
  362. - parameters
  363. - `{Object} options`
  364. - returns `materialProperty`
  365. ```json
  366. // options(optional)
  367. {
  368. "color": DC.Color.WHITE,
  369. "speed": 10
  370. }
  371. ```
  372. ### properties
  373. - `{DC.Color} color`
  374. - `{Number} speed`
  375. ## DC.PolylineFlowMaterialProperty
  376. ### example
  377. ```js
  378. let material = new DC.PolylineFlowMaterialProperty({
  379. color: DC.Color.WHITE,
  380. })
  381. ```
  382. ### creation
  383. - **_constructor([options])_**
  384. - parameters
  385. - `{Object} options`
  386. - returns `materialProperty`
  387. ```json
  388. // options(optional)
  389. {
  390. "color": DC.Color.WHITE,
  391. "speed": 10,
  392. "percent": 0.3,
  393. "gradient": 0.1
  394. }
  395. ```
  396. ### properties
  397. - `{DC.Color} color`
  398. - `{Number} speed`
  399. - `{Number} percent`
  400. - `{Number} gradient`
  401. ## DC.PolylineImageTrailMaterialProperty
  402. ### example
  403. ```js
  404. let material = new DC.PolylineImageTrailMaterialProperty({
  405. color: DC.Color.WHITE,
  406. image: '**/*.png',
  407. repeat: { x: 10, y: 1 },
  408. })
  409. ```
  410. ### creation
  411. - **_constructor([options])_**
  412. - parameters
  413. - `{Object} options`
  414. - returns `materialProperty`
  415. ```json
  416. // options(optional)
  417. {
  418. "color": DC.Color.WHITE,
  419. "speed": 10,
  420. "image": "**/*.png",
  421. "repeat": { "x": 10, "y": 1 }
  422. }
  423. ```
  424. ### properties
  425. - `{DC.Color} color`
  426. - `{Number} speed`
  427. - `{String} image`
  428. - `{Object} repeat`
  429. ## DC.PolylineLightingMaterialProperty
  430. ### example
  431. ```js
  432. let material = new DC.PolylineLightingMaterialProperty({
  433. color: DC.Color.WHITE,
  434. })
  435. ```
  436. ### creation
  437. - **_constructor([options])_**
  438. - parameters
  439. - `{Object} options`
  440. - returns `materialProperty`
  441. ```json
  442. // options(optional)
  443. {
  444. "color": DC.Color.WHITE
  445. }
  446. ```
  447. ### properties
  448. - `{DC.Color} color`
  449. ## DC.PolylineLightingTrailMaterialProperty
  450. ### example
  451. ```js
  452. let material = new DC.PolylineLightingTrailMaterialProperty({
  453. color: DC.Color.WHITE,
  454. })
  455. ```
  456. ### creation
  457. - **_constructor([options])_**
  458. - parameters
  459. - `{Object} options`
  460. - returns `materialProperty`
  461. ```json
  462. // options(optional)
  463. {
  464. "color": DC.Color.WHITE,
  465. "speed": 10
  466. }
  467. ```
  468. ### properties
  469. - `{DC.Color} color`
  470. - `{Number} speed`
  471. ## DC.PolylineTrailMaterialProperty
  472. ### example
  473. ```js
  474. let material = new DC.PolylineTrailMaterialProperty({
  475. color: DC.Color.WHITE,
  476. })
  477. ```
  478. ### creation
  479. - **_constructor([options])_**
  480. - parameters
  481. - `{Object} options`
  482. - returns `materialProperty`
  483. ```json
  484. // options(optional)
  485. {
  486. "color": DC.Color.WHITE,
  487. "speed": 10
  488. }
  489. ```
  490. ### properties
  491. - `{DC.Color} color`
  492. - `{Number} speed`
  493. ## DC.RadarLineMaterialProperty
  494. ### example
  495. ```js
  496. let material = new DC.RadarLineMaterialProperty({
  497. color: DC.Color.WHITE,
  498. })
  499. ```
  500. ### creation
  501. - **_constructor([options])_**
  502. - parameters
  503. - `{Object} options`
  504. - returns `materialProperty`
  505. ```json
  506. // options(optional)
  507. {
  508. "color": DC.Color.WHITE,
  509. "speed": 10
  510. }
  511. ```
  512. ### properties
  513. - `{DC.Color} color`
  514. - `{Number} speed`
  515. ## DC.RadarWaveMaterialProperty
  516. ### example
  517. ```js
  518. let material = new DC.RadarWaveMaterialProperty({
  519. color: DC.Color.WHITE,
  520. })
  521. ```
  522. ### creation
  523. - **_constructor([options])_**
  524. - parameters
  525. - `{Object} options`
  526. - returns `materialProperty`
  527. ```json
  528. // options(optional)
  529. {
  530. "color": DC.Color.WHITE,
  531. "speed": 10
  532. }
  533. ```
  534. ### properties
  535. - `{DC.Color} color`
  536. - `{Number} speed`
  537. ## DC.WallImageTrailMaterialProperty
  538. ### example
  539. ```js
  540. let material = new DC.WallImageTrailMaterialProperty({
  541. color: DC.Color.WHITE,
  542. image: '**/*.png',
  543. repeat: { x: 10, y: 1 },
  544. })
  545. ```
  546. ### creation
  547. - **_constructor([options])_**
  548. - parameters
  549. - `{Object} options`
  550. - returns `materialProperty`
  551. ```json
  552. // options(optional)
  553. {
  554. "color": DC.Color.WHITE,
  555. "speed": 10,
  556. "image": "**/*.png",
  557. "repeat": { "x": 10, "y": 1 }
  558. }
  559. ```
  560. ### properties
  561. - `{DC.Color} color`
  562. - `{Number} speed`
  563. - `{String} image`
  564. - `{Object} repeat`
  565. ## DC.WallTrailMaterialProperty
  566. ### example
  567. ```js
  568. let material = new DC.WallTrailMaterialProperty({
  569. color: DC.Color.WHITE,
  570. })
  571. ```
  572. ### creation
  573. - **_constructor([options])_**
  574. - parameters
  575. - `{Object} options`
  576. - returns `material`
  577. ```json
  578. // options(optional)
  579. {
  580. "color": DC.Color.WHITE,
  581. "speed": 10
  582. }
  583. ```
  584. ### properties
  585. - `{DC.Color} color`
  586. - `{Number} speed`
  587. ## DC.WaterMaterialProperty
  588. ### example
  589. ```js
  590. let material = new DC.WaterMaterialProperty({
  591. baseWaterColor: DC.Color.WHITE,
  592. normalMap: '**/**.png',
  593. })
  594. ```
  595. ### creation
  596. - **_constructor([options])_**
  597. - parameters
  598. - `{Object} options`
  599. - returns `material`
  600. ```json
  601. // options(optional)
  602. {
  603. "baseWaterColor": DC.Color.WHITE,
  604. "blendColor": DC.Color.WHITE,
  605. "specularMap": "",
  606. "normalMap": "",
  607. "frequency": 1000,
  608. "animationSpeed": 0.03,
  609. "amplitude": 10,
  610. "specularIntensity": 10
  611. }
  612. ```
  613. ### properties
  614. - `{DC.Color} baseWaterColor`
  615. - `{DC.Color} blendColor`
  616. - `{String} normalMap`
  617. - `{String} specularMap`