@geoblocks/cesium-post-process 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (502) hide show
  1. package/dist/analog-video.d.ts +71 -0
  2. package/dist/analog-video.d.ts.map +1 -0
  3. package/dist/analog-video.js +128 -0
  4. package/dist/analog-video.js.map +1 -0
  5. package/dist/blur.d.ts +13 -0
  6. package/dist/blur.d.ts.map +1 -0
  7. package/dist/blur.js +36 -0
  8. package/dist/blur.js.map +1 -0
  9. package/dist/cesium-post-process.d.ts +30 -0
  10. package/dist/cesium-post-process.d.ts.map +1 -0
  11. package/dist/cesium-post-process.js +31 -0
  12. package/dist/cesium-post-process.js.map +1 -0
  13. package/dist/cloud-cover.d.ts +28 -0
  14. package/dist/cloud-cover.d.ts.map +1 -0
  15. package/dist/cloud-cover.js +45 -0
  16. package/dist/cloud-cover.js.map +1 -0
  17. package/dist/cloud-map.d.ts +7 -0
  18. package/dist/cloud-map.d.ts.map +1 -0
  19. package/dist/cloud-map.js +118 -0
  20. package/dist/cloud-map.js.map +1 -0
  21. package/dist/cloud-noise.d.ts +13 -0
  22. package/dist/cloud-noise.d.ts.map +1 -0
  23. package/dist/cloud-noise.js +222 -0
  24. package/dist/cloud-noise.js.map +1 -0
  25. package/dist/clouds.d.ts +275 -0
  26. package/dist/clouds.d.ts.map +1 -0
  27. package/dist/clouds.js +642 -0
  28. package/dist/clouds.js.map +1 -0
  29. package/dist/color-isolation.d.ts +38 -0
  30. package/dist/color-isolation.d.ts.map +1 -0
  31. package/dist/color-isolation.js +61 -0
  32. package/dist/color-isolation.js.map +1 -0
  33. package/dist/depth-test.d.ts +9 -0
  34. package/dist/depth-test.d.ts.map +1 -0
  35. package/dist/depth-test.js +35 -0
  36. package/dist/depth-test.js.map +1 -0
  37. package/dist/digital-video.d.ts +47 -0
  38. package/dist/digital-video.d.ts.map +1 -0
  39. package/dist/digital-video.js +102 -0
  40. package/dist/digital-video.js.map +1 -0
  41. package/dist/drone-display.d.ts +70 -0
  42. package/dist/drone-display.d.ts.map +1 -0
  43. package/dist/drone-display.js +158 -0
  44. package/dist/drone-display.js.map +1 -0
  45. package/dist/dufour.d.ts +108 -0
  46. package/dist/dufour.d.ts.map +1 -0
  47. package/dist/dufour.js +201 -0
  48. package/dist/dufour.js.map +1 -0
  49. package/dist/effect.d.ts +33 -0
  50. package/dist/effect.d.ts.map +1 -0
  51. package/dist/effect.js +60 -0
  52. package/dist/effect.js.map +1 -0
  53. package/dist/focus.d.ts +11 -0
  54. package/dist/focus.d.ts.map +1 -0
  55. package/dist/focus.js +23 -0
  56. package/dist/focus.js.map +1 -0
  57. package/dist/frame-clock.d.ts +11 -0
  58. package/dist/frame-clock.d.ts.map +1 -0
  59. package/dist/frame-clock.js +57 -0
  60. package/dist/frame-clock.js.map +1 -0
  61. package/dist/height.d.ts +12 -0
  62. package/dist/height.d.ts.map +1 -0
  63. package/dist/height.js +22 -0
  64. package/dist/height.js.map +1 -0
  65. package/dist/infrared.d.ts +23 -0
  66. package/dist/infrared.d.ts.map +1 -0
  67. package/dist/infrared.js +36 -0
  68. package/dist/infrared.js.map +1 -0
  69. package/dist/jello.d.ts +52 -0
  70. package/dist/jello.d.ts.map +1 -0
  71. package/dist/jello.js +136 -0
  72. package/dist/jello.js.map +1 -0
  73. package/dist/lens-distortion.d.ts +33 -0
  74. package/dist/lens-distortion.d.ts.map +1 -0
  75. package/dist/lens-distortion.js +61 -0
  76. package/dist/lens-distortion.js.map +1 -0
  77. package/dist/lightning.d.ts +124 -0
  78. package/dist/lightning.d.ts.map +1 -0
  79. package/dist/lightning.js +301 -0
  80. package/dist/lightning.js.map +1 -0
  81. package/dist/local-frame.d.ts +38 -0
  82. package/dist/local-frame.d.ts.map +1 -0
  83. package/dist/local-frame.js +52 -0
  84. package/dist/local-frame.js.map +1 -0
  85. package/dist/motion-blur.d.ts +50 -0
  86. package/dist/motion-blur.d.ts.map +1 -0
  87. package/dist/motion-blur.js +108 -0
  88. package/dist/motion-blur.js.map +1 -0
  89. package/dist/precipitation.d.ts +146 -0
  90. package/dist/precipitation.d.ts.map +1 -0
  91. package/dist/precipitation.js +454 -0
  92. package/dist/precipitation.js.map +1 -0
  93. package/dist/rain-rings.d.ts +100 -0
  94. package/dist/rain-rings.d.ts.map +1 -0
  95. package/dist/rain-rings.js +181 -0
  96. package/dist/rain-rings.js.map +1 -0
  97. package/dist/shaders/Alpenglow.d.ts +3 -0
  98. package/dist/shaders/Alpenglow.d.ts.map +1 -0
  99. package/dist/shaders/Alpenglow.js +3 -0
  100. package/dist/shaders/Alpenglow.js.map +1 -0
  101. package/dist/shaders/AnalogVideo.d.ts +3 -0
  102. package/dist/shaders/AnalogVideo.d.ts.map +1 -0
  103. package/dist/shaders/AnalogVideo.js +3 -0
  104. package/dist/shaders/AnalogVideo.js.map +1 -0
  105. package/dist/shaders/Beam.d.ts +3 -0
  106. package/dist/shaders/Beam.d.ts.map +1 -0
  107. package/dist/shaders/Beam.js +3 -0
  108. package/dist/shaders/Beam.js.map +1 -0
  109. package/dist/shaders/CloudsBlur.d.ts +3 -0
  110. package/dist/shaders/CloudsBlur.d.ts.map +1 -0
  111. package/dist/shaders/CloudsBlur.js +3 -0
  112. package/dist/shaders/CloudsBlur.js.map +1 -0
  113. package/dist/shaders/CloudsComposite.d.ts +3 -0
  114. package/dist/shaders/CloudsComposite.d.ts.map +1 -0
  115. package/dist/shaders/CloudsComposite.js +3 -0
  116. package/dist/shaders/CloudsComposite.js.map +1 -0
  117. package/dist/shaders/CloudsDensity.d.ts +3 -0
  118. package/dist/shaders/CloudsDensity.d.ts.map +1 -0
  119. package/dist/shaders/CloudsDensity.js +3 -0
  120. package/dist/shaders/CloudsDensity.js.map +1 -0
  121. package/dist/shaders/CloudsDepth.d.ts +3 -0
  122. package/dist/shaders/CloudsDepth.d.ts.map +1 -0
  123. package/dist/shaders/CloudsDepth.js +3 -0
  124. package/dist/shaders/CloudsDepth.js.map +1 -0
  125. package/dist/shaders/CloudsMarch.d.ts +3 -0
  126. package/dist/shaders/CloudsMarch.d.ts.map +1 -0
  127. package/dist/shaders/CloudsMarch.js +3 -0
  128. package/dist/shaders/CloudsMarch.js.map +1 -0
  129. package/dist/shaders/CloudsResolve.d.ts +3 -0
  130. package/dist/shaders/CloudsResolve.d.ts.map +1 -0
  131. package/dist/shaders/CloudsResolve.js +3 -0
  132. package/dist/shaders/CloudsResolve.js.map +1 -0
  133. package/dist/shaders/CloudsShadow.d.ts +3 -0
  134. package/dist/shaders/CloudsShadow.d.ts.map +1 -0
  135. package/dist/shaders/CloudsShadow.js +3 -0
  136. package/dist/shaders/CloudsShadow.js.map +1 -0
  137. package/dist/shaders/CloudsShadowMap.d.ts +3 -0
  138. package/dist/shaders/CloudsShadowMap.d.ts.map +1 -0
  139. package/dist/shaders/CloudsShadowMap.js +3 -0
  140. package/dist/shaders/CloudsShadowMap.js.map +1 -0
  141. package/dist/shaders/CloudsSlab.d.ts +3 -0
  142. package/dist/shaders/CloudsSlab.d.ts.map +1 -0
  143. package/dist/shaders/CloudsSlab.js +3 -0
  144. package/dist/shaders/CloudsSlab.js.map +1 -0
  145. package/dist/shaders/ColorIsolation.d.ts +3 -0
  146. package/dist/shaders/ColorIsolation.d.ts.map +1 -0
  147. package/dist/shaders/ColorIsolation.js +3 -0
  148. package/dist/shaders/ColorIsolation.js.map +1 -0
  149. package/dist/shaders/DepthEdges.d.ts +3 -0
  150. package/dist/shaders/DepthEdges.d.ts.map +1 -0
  151. package/dist/shaders/DepthEdges.js +3 -0
  152. package/dist/shaders/DepthEdges.js.map +1 -0
  153. package/dist/shaders/DigitalVideo.d.ts +3 -0
  154. package/dist/shaders/DigitalVideo.d.ts.map +1 -0
  155. package/dist/shaders/DigitalVideo.js +3 -0
  156. package/dist/shaders/DigitalVideo.js.map +1 -0
  157. package/dist/shaders/DroneDisplay.d.ts +3 -0
  158. package/dist/shaders/DroneDisplay.d.ts.map +1 -0
  159. package/dist/shaders/DroneDisplay.js +3 -0
  160. package/dist/shaders/DroneDisplay.js.map +1 -0
  161. package/dist/shaders/Dufour.d.ts +3 -0
  162. package/dist/shaders/Dufour.d.ts.map +1 -0
  163. package/dist/shaders/Dufour.js +3 -0
  164. package/dist/shaders/Dufour.js.map +1 -0
  165. package/dist/shaders/EyeFromDepth.d.ts +3 -0
  166. package/dist/shaders/EyeFromDepth.d.ts.map +1 -0
  167. package/dist/shaders/EyeFromDepth.js +3 -0
  168. package/dist/shaders/EyeFromDepth.js.map +1 -0
  169. package/dist/shaders/Filmic.d.ts +3 -0
  170. package/dist/shaders/Filmic.d.ts.map +1 -0
  171. package/dist/shaders/Filmic.js +3 -0
  172. package/dist/shaders/Filmic.js.map +1 -0
  173. package/dist/shaders/Flashlight.d.ts +3 -0
  174. package/dist/shaders/Flashlight.d.ts.map +1 -0
  175. package/dist/shaders/Flashlight.js +3 -0
  176. package/dist/shaders/Flashlight.js.map +1 -0
  177. package/dist/shaders/Fog.d.ts +3 -0
  178. package/dist/shaders/Fog.d.ts.map +1 -0
  179. package/dist/shaders/Fog.js +3 -0
  180. package/dist/shaders/Fog.js.map +1 -0
  181. package/dist/shaders/Frame.d.ts +3 -0
  182. package/dist/shaders/Frame.d.ts.map +1 -0
  183. package/dist/shaders/Frame.js +3 -0
  184. package/dist/shaders/Frame.js.map +1 -0
  185. package/dist/shaders/Hash.d.ts +3 -0
  186. package/dist/shaders/Hash.d.ts.map +1 -0
  187. package/dist/shaders/Hash.js +3 -0
  188. package/dist/shaders/Hash.js.map +1 -0
  189. package/dist/shaders/Height.d.ts +3 -0
  190. package/dist/shaders/Height.d.ts.map +1 -0
  191. package/dist/shaders/Height.js +3 -0
  192. package/dist/shaders/Height.js.map +1 -0
  193. package/dist/shaders/Infrared.d.ts +3 -0
  194. package/dist/shaders/Infrared.d.ts.map +1 -0
  195. package/dist/shaders/Infrared.js +3 -0
  196. package/dist/shaders/Infrared.js.map +1 -0
  197. package/dist/shaders/Jello.d.ts +3 -0
  198. package/dist/shaders/Jello.d.ts.map +1 -0
  199. package/dist/shaders/Jello.js +3 -0
  200. package/dist/shaders/Jello.js.map +1 -0
  201. package/dist/shaders/LensDistortion.d.ts +3 -0
  202. package/dist/shaders/LensDistortion.d.ts.map +1 -0
  203. package/dist/shaders/LensDistortion.js +3 -0
  204. package/dist/shaders/LensDistortion.js.map +1 -0
  205. package/dist/shaders/Lightning.d.ts +3 -0
  206. package/dist/shaders/Lightning.d.ts.map +1 -0
  207. package/dist/shaders/Lightning.js +3 -0
  208. package/dist/shaders/Lightning.js.map +1 -0
  209. package/dist/shaders/MotionBlur.d.ts +3 -0
  210. package/dist/shaders/MotionBlur.d.ts.map +1 -0
  211. package/dist/shaders/MotionBlur.js +3 -0
  212. package/dist/shaders/MotionBlur.js.map +1 -0
  213. package/dist/shaders/MotionBlurVelocity.d.ts +3 -0
  214. package/dist/shaders/MotionBlurVelocity.d.ts.map +1 -0
  215. package/dist/shaders/MotionBlurVelocity.js +3 -0
  216. package/dist/shaders/MotionBlurVelocity.js.map +1 -0
  217. package/dist/shaders/Noise.d.ts +3 -0
  218. package/dist/shaders/Noise.d.ts.map +1 -0
  219. package/dist/shaders/Noise.js +3 -0
  220. package/dist/shaders/Noise.js.map +1 -0
  221. package/dist/shaders/Normal.d.ts +3 -0
  222. package/dist/shaders/Normal.d.ts.map +1 -0
  223. package/dist/shaders/Normal.js +3 -0
  224. package/dist/shaders/Normal.js.map +1 -0
  225. package/dist/shaders/Phase.d.ts +3 -0
  226. package/dist/shaders/Phase.d.ts.map +1 -0
  227. package/dist/shaders/Phase.js +3 -0
  228. package/dist/shaders/Phase.js.map +1 -0
  229. package/dist/shaders/Precipitation.d.ts +3 -0
  230. package/dist/shaders/Precipitation.d.ts.map +1 -0
  231. package/dist/shaders/Precipitation.js +3 -0
  232. package/dist/shaders/Precipitation.js.map +1 -0
  233. package/dist/shaders/PrecipitationShaftBlur.d.ts +3 -0
  234. package/dist/shaders/PrecipitationShaftBlur.d.ts.map +1 -0
  235. package/dist/shaders/PrecipitationShaftBlur.js +3 -0
  236. package/dist/shaders/PrecipitationShaftBlur.js.map +1 -0
  237. package/dist/shaders/PrecipitationShafts.d.ts +3 -0
  238. package/dist/shaders/PrecipitationShafts.d.ts.map +1 -0
  239. package/dist/shaders/PrecipitationShafts.js +3 -0
  240. package/dist/shaders/PrecipitationShafts.js.map +1 -0
  241. package/dist/shaders/PrecipitationWind.d.ts +3 -0
  242. package/dist/shaders/PrecipitationWind.d.ts.map +1 -0
  243. package/dist/shaders/PrecipitationWind.js +3 -0
  244. package/dist/shaders/PrecipitationWind.js.map +1 -0
  245. package/dist/shaders/RainHaze.d.ts +3 -0
  246. package/dist/shaders/RainHaze.d.ts.map +1 -0
  247. package/dist/shaders/RainHaze.js +3 -0
  248. package/dist/shaders/RainHaze.js.map +1 -0
  249. package/dist/shaders/RainRings.d.ts +3 -0
  250. package/dist/shaders/RainRings.d.ts.map +1 -0
  251. package/dist/shaders/RainRings.js +3 -0
  252. package/dist/shaders/RainRings.js.map +1 -0
  253. package/dist/shaders/Shockwave.d.ts +3 -0
  254. package/dist/shaders/Shockwave.d.ts.map +1 -0
  255. package/dist/shaders/Shockwave.js +3 -0
  256. package/dist/shaders/Shockwave.js.map +1 -0
  257. package/dist/shaders/SkyTable.d.ts +3 -0
  258. package/dist/shaders/SkyTable.d.ts.map +1 -0
  259. package/dist/shaders/SkyTable.js +3 -0
  260. package/dist/shaders/SkyTable.js.map +1 -0
  261. package/dist/shaders/SnowLine.d.ts +3 -0
  262. package/dist/shaders/SnowLine.d.ts.map +1 -0
  263. package/dist/shaders/SnowLine.js +3 -0
  264. package/dist/shaders/SnowLine.js.map +1 -0
  265. package/dist/shaders/SpeedLines.d.ts +3 -0
  266. package/dist/shaders/SpeedLines.d.ts.map +1 -0
  267. package/dist/shaders/SpeedLines.js +3 -0
  268. package/dist/shaders/SpeedLines.js.map +1 -0
  269. package/dist/shaders/Spotlight.d.ts +3 -0
  270. package/dist/shaders/Spotlight.d.ts.map +1 -0
  271. package/dist/shaders/Spotlight.js +3 -0
  272. package/dist/shaders/Spotlight.js.map +1 -0
  273. package/dist/shaders/SpotlightBeam.d.ts +3 -0
  274. package/dist/shaders/SpotlightBeam.d.ts.map +1 -0
  275. package/dist/shaders/SpotlightBeam.js +3 -0
  276. package/dist/shaders/SpotlightBeam.js.map +1 -0
  277. package/dist/shaders/SpotlightBeamBlur.d.ts +3 -0
  278. package/dist/shaders/SpotlightBeamBlur.d.ts.map +1 -0
  279. package/dist/shaders/SpotlightBeamBlur.js +3 -0
  280. package/dist/shaders/SpotlightBeamBlur.js.map +1 -0
  281. package/dist/shaders/SpotlightCone.d.ts +3 -0
  282. package/dist/shaders/SpotlightCone.d.ts.map +1 -0
  283. package/dist/shaders/SpotlightCone.js +3 -0
  284. package/dist/shaders/SpotlightCone.js.map +1 -0
  285. package/dist/shaders/Super8.d.ts +3 -0
  286. package/dist/shaders/Super8.d.ts.map +1 -0
  287. package/dist/shaders/Super8.js +3 -0
  288. package/dist/shaders/Super8.js.map +1 -0
  289. package/dist/shaders/Technicolor.d.ts +3 -0
  290. package/dist/shaders/Technicolor.d.ts.map +1 -0
  291. package/dist/shaders/Technicolor.js +3 -0
  292. package/dist/shaders/Technicolor.js.map +1 -0
  293. package/dist/shaders/TiltShift.d.ts +3 -0
  294. package/dist/shaders/TiltShift.d.ts.map +1 -0
  295. package/dist/shaders/TiltShift.js +3 -0
  296. package/dist/shaders/TiltShift.js.map +1 -0
  297. package/dist/shaders/Toy.d.ts +3 -0
  298. package/dist/shaders/Toy.d.ts.map +1 -0
  299. package/dist/shaders/Toy.js +3 -0
  300. package/dist/shaders/Toy.js.map +1 -0
  301. package/dist/shaders/Trails.d.ts +3 -0
  302. package/dist/shaders/Trails.d.ts.map +1 -0
  303. package/dist/shaders/Trails.js +3 -0
  304. package/dist/shaders/Trails.js.map +1 -0
  305. package/dist/shaders/ValleyFog.d.ts +3 -0
  306. package/dist/shaders/ValleyFog.d.ts.map +1 -0
  307. package/dist/shaders/ValleyFog.js +3 -0
  308. package/dist/shaders/ValleyFog.js.map +1 -0
  309. package/dist/shaders/WeatherMap.d.ts +3 -0
  310. package/dist/shaders/WeatherMap.d.ts.map +1 -0
  311. package/dist/shaders/WeatherMap.js +3 -0
  312. package/dist/shaders/WeatherMap.js.map +1 -0
  313. package/dist/shaders/WhiteModel.d.ts +3 -0
  314. package/dist/shaders/WhiteModel.d.ts.map +1 -0
  315. package/dist/shaders/WhiteModel.js +3 -0
  316. package/dist/shaders/WhiteModel.js.map +1 -0
  317. package/dist/snow-line.d.ts +117 -0
  318. package/dist/snow-line.d.ts.map +1 -0
  319. package/dist/snow-line.js +201 -0
  320. package/dist/snow-line.js.map +1 -0
  321. package/dist/speed-lines.d.ts +36 -0
  322. package/dist/speed-lines.d.ts.map +1 -0
  323. package/dist/speed-lines.js +65 -0
  324. package/dist/speed-lines.js.map +1 -0
  325. package/dist/spotlight.d.ts +84 -0
  326. package/dist/spotlight.d.ts.map +1 -0
  327. package/dist/spotlight.js +175 -0
  328. package/dist/spotlight.js.map +1 -0
  329. package/dist/strikes.d.ts +17 -0
  330. package/dist/strikes.d.ts.map +1 -0
  331. package/dist/strikes.js +30 -0
  332. package/dist/strikes.js.map +1 -0
  333. package/dist/super8.d.ts +78 -0
  334. package/dist/super8.d.ts.map +1 -0
  335. package/dist/super8.js +146 -0
  336. package/dist/super8.js.map +1 -0
  337. package/dist/technicolor.d.ts +32 -0
  338. package/dist/technicolor.d.ts.map +1 -0
  339. package/dist/technicolor.js +51 -0
  340. package/dist/technicolor.js.map +1 -0
  341. package/dist/tilt-shift.d.ts +60 -0
  342. package/dist/tilt-shift.d.ts.map +1 -0
  343. package/dist/tilt-shift.js +112 -0
  344. package/dist/tilt-shift.js.map +1 -0
  345. package/dist/toy.d.ts +110 -0
  346. package/dist/toy.d.ts.map +1 -0
  347. package/dist/toy.js +173 -0
  348. package/dist/toy.js.map +1 -0
  349. package/dist/valley-fog.d.ts +56 -0
  350. package/dist/valley-fog.d.ts.map +1 -0
  351. package/dist/valley-fog.js +94 -0
  352. package/dist/valley-fog.js.map +1 -0
  353. package/dist/weather-map.d.ts +132 -0
  354. package/dist/weather-map.d.ts.map +1 -0
  355. package/dist/weather-map.js +266 -0
  356. package/dist/weather-map.js.map +1 -0
  357. package/dist/white-model.d.ts +70 -0
  358. package/dist/white-model.d.ts.map +1 -0
  359. package/dist/white-model.js +94 -0
  360. package/dist/white-model.js.map +1 -0
  361. package/package.json +19 -40
  362. package/{cesium-post-process.js → src/cesium-post-process.js} +2 -0
  363. package/src/shaders/AnalogVideo.glsl +132 -0
  364. package/src/shaders/Beam.glsl +108 -0
  365. package/src/shaders/CloudsBlur.glsl +30 -0
  366. package/src/shaders/CloudsComposite.glsl +59 -0
  367. package/src/shaders/CloudsDensity.glsl +129 -0
  368. package/src/shaders/CloudsDepth.glsl +26 -0
  369. package/src/shaders/CloudsMarch.glsl +174 -0
  370. package/src/shaders/CloudsResolve.glsl +46 -0
  371. package/src/shaders/CloudsShadow.glsl +50 -0
  372. package/src/shaders/CloudsShadowMap.glsl +68 -0
  373. package/src/shaders/CloudsSlab.glsl +58 -0
  374. package/src/shaders/ColorIsolation.glsl +26 -0
  375. package/src/shaders/DepthEdges.glsl +81 -0
  376. package/src/shaders/DigitalVideo.glsl +65 -0
  377. package/src/shaders/DroneDisplay.glsl +337 -0
  378. package/src/shaders/Dufour.glsl +109 -0
  379. package/src/shaders/EyeFromDepth.glsl +36 -0
  380. package/src/shaders/Filmic.glsl +5 -0
  381. package/src/shaders/Fog.glsl +18 -0
  382. package/src/shaders/Frame.glsl +10 -0
  383. package/src/shaders/Hash.glsl +12 -0
  384. package/src/shaders/Height.glsl +25 -0
  385. package/src/shaders/Infrared.glsl +44 -0
  386. package/src/shaders/Jello.glsl +41 -0
  387. package/src/shaders/LensDistortion.glsl +24 -0
  388. package/src/shaders/Lightning.glsl +257 -0
  389. package/src/shaders/MotionBlur.glsl +71 -0
  390. package/src/shaders/MotionBlurVelocity.glsl +31 -0
  391. package/src/shaders/Noise.glsl +43 -0
  392. package/src/shaders/Normal.glsl +21 -0
  393. package/src/shaders/Phase.glsl +6 -0
  394. package/src/shaders/Precipitation.glsl +199 -0
  395. package/src/shaders/PrecipitationShaftBlur.glsl +21 -0
  396. package/src/shaders/PrecipitationShafts.glsl +84 -0
  397. package/src/shaders/PrecipitationWind.glsl +33 -0
  398. package/src/shaders/RainHaze.glsl +145 -0
  399. package/src/shaders/RainRings.glsl +64 -0
  400. package/src/shaders/SkyTable.glsl +23 -0
  401. package/src/shaders/SnowLine.glsl +97 -0
  402. package/src/shaders/SpeedLines.glsl +61 -0
  403. package/src/shaders/Spotlight.glsl +89 -0
  404. package/src/shaders/SpotlightBeam.glsl +49 -0
  405. package/src/shaders/SpotlightBeamBlur.glsl +27 -0
  406. package/src/shaders/SpotlightCone.glsl +37 -0
  407. package/src/shaders/Super8.glsl +90 -0
  408. package/src/shaders/Technicolor.glsl +30 -0
  409. package/src/shaders/TiltShift.glsl +34 -0
  410. package/src/shaders/Toy.glsl +46 -0
  411. package/src/shaders/ValleyFog.glsl +40 -0
  412. package/src/shaders/WeatherMap.glsl +33 -0
  413. package/src/shaders/WhiteModel.glsl +108 -0
  414. /package/{analog-video.js → src/analog-video.js} +0 -0
  415. /package/{blur.js → src/blur.js} +0 -0
  416. /package/{cloud-cover.js → src/cloud-cover.js} +0 -0
  417. /package/{cloud-map.js → src/cloud-map.js} +0 -0
  418. /package/{cloud-noise.js → src/cloud-noise.js} +0 -0
  419. /package/{clouds.js → src/clouds.js} +0 -0
  420. /package/{color-isolation.js → src/color-isolation.js} +0 -0
  421. /package/{depth-test.js → src/depth-test.js} +0 -0
  422. /package/{digital-video.js → src/digital-video.js} +0 -0
  423. /package/{drone-display.js → src/drone-display.js} +0 -0
  424. /package/{dufour.js → src/dufour.js} +0 -0
  425. /package/{effect.js → src/effect.js} +0 -0
  426. /package/{focus.js → src/focus.js} +0 -0
  427. /package/{frame-clock.js → src/frame-clock.js} +0 -0
  428. /package/{height.js → src/height.js} +0 -0
  429. /package/{infrared.js → src/infrared.js} +0 -0
  430. /package/{jello.js → src/jello.js} +0 -0
  431. /package/{lens-distortion.js → src/lens-distortion.js} +0 -0
  432. /package/{lightning.js → src/lightning.js} +0 -0
  433. /package/{local-frame.js → src/local-frame.js} +0 -0
  434. /package/{motion-blur.js → src/motion-blur.js} +0 -0
  435. /package/{precipitation.js → src/precipitation.js} +0 -0
  436. /package/{rain-rings.js → src/rain-rings.js} +0 -0
  437. /package/{shaders → src/shaders}/Alpenglow.js +0 -0
  438. /package/{shaders → src/shaders}/AnalogVideo.js +0 -0
  439. /package/{shaders → src/shaders}/Beam.js +0 -0
  440. /package/{shaders → src/shaders}/CloudsBlur.js +0 -0
  441. /package/{shaders → src/shaders}/CloudsComposite.js +0 -0
  442. /package/{shaders → src/shaders}/CloudsDensity.js +0 -0
  443. /package/{shaders → src/shaders}/CloudsDepth.js +0 -0
  444. /package/{shaders → src/shaders}/CloudsMarch.js +0 -0
  445. /package/{shaders → src/shaders}/CloudsResolve.js +0 -0
  446. /package/{shaders → src/shaders}/CloudsShadow.js +0 -0
  447. /package/{shaders → src/shaders}/CloudsShadowMap.js +0 -0
  448. /package/{shaders → src/shaders}/CloudsSlab.js +0 -0
  449. /package/{shaders → src/shaders}/ColorIsolation.js +0 -0
  450. /package/{shaders → src/shaders}/DepthEdges.js +0 -0
  451. /package/{shaders → src/shaders}/DigitalVideo.js +0 -0
  452. /package/{shaders → src/shaders}/DroneDisplay.js +0 -0
  453. /package/{shaders → src/shaders}/Dufour.js +0 -0
  454. /package/{shaders → src/shaders}/EyeFromDepth.js +0 -0
  455. /package/{shaders → src/shaders}/Filmic.js +0 -0
  456. /package/{shaders → src/shaders}/Flashlight.js +0 -0
  457. /package/{shaders → src/shaders}/Fog.js +0 -0
  458. /package/{shaders → src/shaders}/Frame.js +0 -0
  459. /package/{shaders → src/shaders}/Hash.js +0 -0
  460. /package/{shaders → src/shaders}/Height.js +0 -0
  461. /package/{shaders → src/shaders}/Infrared.js +0 -0
  462. /package/{shaders → src/shaders}/Jello.js +0 -0
  463. /package/{shaders → src/shaders}/LensDistortion.js +0 -0
  464. /package/{shaders → src/shaders}/Lightning.js +0 -0
  465. /package/{shaders → src/shaders}/MotionBlur.js +0 -0
  466. /package/{shaders → src/shaders}/MotionBlurVelocity.js +0 -0
  467. /package/{shaders → src/shaders}/Noise.js +0 -0
  468. /package/{shaders → src/shaders}/Normal.js +0 -0
  469. /package/{shaders → src/shaders}/Phase.js +0 -0
  470. /package/{shaders → src/shaders}/Precipitation.js +0 -0
  471. /package/{shaders → src/shaders}/PrecipitationShaftBlur.js +0 -0
  472. /package/{shaders → src/shaders}/PrecipitationShafts.js +0 -0
  473. /package/{shaders → src/shaders}/PrecipitationWind.js +0 -0
  474. /package/{shaders → src/shaders}/RainHaze.js +0 -0
  475. /package/{shaders → src/shaders}/RainRings.js +0 -0
  476. /package/{shaders → src/shaders}/Shockwave.js +0 -0
  477. /package/{shaders → src/shaders}/SkyTable.js +0 -0
  478. /package/{shaders → src/shaders}/SnowLine.js +0 -0
  479. /package/{shaders → src/shaders}/SpeedLines.js +0 -0
  480. /package/{shaders → src/shaders}/Spotlight.js +0 -0
  481. /package/{shaders → src/shaders}/SpotlightBeam.js +0 -0
  482. /package/{shaders → src/shaders}/SpotlightBeamBlur.js +0 -0
  483. /package/{shaders → src/shaders}/SpotlightCone.js +0 -0
  484. /package/{shaders → src/shaders}/Super8.js +0 -0
  485. /package/{shaders → src/shaders}/Technicolor.js +0 -0
  486. /package/{shaders → src/shaders}/TiltShift.js +0 -0
  487. /package/{shaders → src/shaders}/Toy.js +0 -0
  488. /package/{shaders → src/shaders}/Trails.js +0 -0
  489. /package/{shaders → src/shaders}/ValleyFog.js +0 -0
  490. /package/{shaders → src/shaders}/WeatherMap.js +0 -0
  491. /package/{shaders → src/shaders}/WhiteModel.js +0 -0
  492. /package/{snow-line.js → src/snow-line.js} +0 -0
  493. /package/{speed-lines.js → src/speed-lines.js} +0 -0
  494. /package/{spotlight.js → src/spotlight.js} +0 -0
  495. /package/{strikes.js → src/strikes.js} +0 -0
  496. /package/{super8.js → src/super8.js} +0 -0
  497. /package/{technicolor.js → src/technicolor.js} +0 -0
  498. /package/{tilt-shift.js → src/tilt-shift.js} +0 -0
  499. /package/{toy.js → src/toy.js} +0 -0
  500. /package/{valley-fog.js → src/valley-fog.js} +0 -0
  501. /package/{weather-map.js → src/weather-map.js} +0 -0
  502. /package/{white-model.js → src/white-model.js} +0 -0
@@ -0,0 +1,337 @@
1
+ // A drone's OSD, as ArduPilot draws it on an HD video system: 50 columns and 18 rows of 12 x 18
2
+ // pixel character cells over the whole picture, with the readouts near its edges, here in the
3
+ // blocky white glyphs of an analog chip with their black outline, and some in color. The layout
4
+ // follows a fixed-wing plane's display; the glyphs are drawn here, not copied from a font.
5
+ // - The horizon: 9 dots of 2 x 2 pixels around the middle, as ArduPilot's draw_horizon: pitch (at
6
+ // most 20 degrees) moves it a row per 5 degrees, and roll tilts it at its angle on the screen;
7
+ // each dot is at one of 9 heights in its cell, or past 45 degrees of roll, one per row at one of
8
+ // 9 places across its cell. A dot more than 4 cells from the middle is not drawn, and upside
9
+ // down the horizon blinks. It is a symbol, not lined up with the real horizon.
10
+ // - The flight mode, top left: FBWA, RTL in failsafe; the heading, top middle.
11
+ // - Top right, the link bar, green, orange then red as the link quality drops, and the battery,
12
+ // its symbol filled in green in 7 steps, and its voltage.
13
+ // - The right column: the altitude since the display turned on, under a mountain with a green
14
+ // dot; the vertical speed, with one or two green arrows; the throttle.
15
+ // - The air speed, bottom middle, after its pale blue label.
16
+ // - The FAILSAFE warning, blinking red in the lower part of the middle while the control link is
17
+ // lost.
18
+ precision highp sampler2D;
19
+ uniform sampler2D colorTexture;
20
+ // 0 to 1
21
+ uniform float opacity;
22
+ // degrees, negative looking down
23
+ uniform float pitch;
24
+ // degrees, positive to the right
25
+ uniform float roll;
26
+ // degrees, 0 to 360
27
+ uniform float heading;
28
+ // meters, since the display turned on
29
+ uniform float altitude;
30
+ // m/s, positive climbing
31
+ uniform float verticalSpeed;
32
+ // km/h
33
+ uniform float speed;
34
+ // volts
35
+ uniform float voltage;
36
+ // 0 to 99
37
+ uniform float linkQuality;
38
+ // percent
39
+ uniform float throttle;
40
+ // 1 while the control link is lost, 0 otherwise
41
+ uniform float failsafe;
42
+ // 1 or 0, twice per second: the blinking of the warning and of the horizon upside down
43
+ uniform float blink;
44
+ in vec2 v_textureCoordinates;
45
+
46
+ const float COLUMNS = 50.0;
47
+ const float ROWS = 18.0;
48
+ // a cell, in pixels
49
+ const float CELL_WIDTH = 12.0;
50
+ const float CELL_HEIGHT = 18.0;
51
+ // the middle cell, where the horizon is
52
+ const int MIDDLE_COLUMN = 24;
53
+ const int MIDDLE_ROW = 8;
54
+ // ArduPilot's horizon: its limit in pitch, rows per degree of it (16 rows per 80 degrees), and
55
+ // rows per column at 45 degrees of roll, for the line to tilt at its angle
56
+ const float MAX_PITCH = 20.0;
57
+ const float ROWS_PER_DEGREE = 0.2;
58
+ const float RATIO = CELL_WIDTH / CELL_HEIGHT;
59
+ // battery: volts full and empty of a 3S, and the steps of its symbol's fill (full, 5 to 1, empty)
60
+ const float FULL_VOLTS = 12.6;
61
+ const float EMPTY_VOLTS = 10.5;
62
+ const float BATTERY_STEPS = 6.0;
63
+ // the right column: the units in its last column, right of the numbers
64
+ const int UNIT_COLUMN = 41;
65
+ // the link bar: its first column, and its length in cells
66
+ const int LINK_COLUMN = 36;
67
+ const float LINK_CELLS = 6.0;
68
+
69
+ const vec3 WHITE = vec3(1.0);
70
+ const vec3 GREEN = vec3(0.2, 0.85, 0.35);
71
+ const vec3 ORANGE = vec3(1.0, 0.6, 0.1);
72
+ const vec3 RED = vec3(0.95, 0.15, 0.15);
73
+ const vec3 PALE_BLUE = vec3(0.55, 0.75, 0.95);
74
+
75
+ // the glyphs, at 12 x 18 pixels: one row of 12 bits each, the leftmost bit highest; the table is
76
+ // written by scripts/osd-font.js from its pixel drawings
77
+ const int DOT = 10;
78
+ const int SPACE = 11;
79
+ const int MINUS = 12;
80
+ const int VOLT = 13;
81
+ const int DEGREE = 14;
82
+ const int PERCENT = 15;
83
+ // the units of the altitude, the vertical speed and the air speed, and the air speed's label
84
+ const int ALTITUDE = 16;
85
+ const int METERS_PER_SECOND = 17;
86
+ const int KILOMETERS_PER_HOUR = 18;
87
+ const int AIR_SPEED = 19;
88
+ // the vertical speed's arrows
89
+ const int UP = 20;
90
+ const int UP_TWO = 21;
91
+ const int DOWN = 22;
92
+ const int DOWN_TWO = 23;
93
+ // the letters of the flight modes and the warning
94
+ const int LETTER_F = 24;
95
+ const int LETTER_B = 25;
96
+ const int LETTER_W = 26;
97
+ const int LETTER_A = 27;
98
+ const int LETTER_R = 28;
99
+ const int LETTER_T = 29;
100
+ const int LETTER_L = 30;
101
+ const int LETTER_I = 31;
102
+ const int LETTER_E = 32;
103
+ const int LETTER_S = 33;
104
+ // the warning's row and first column: FAILSAFE, centered under the middle
105
+ const int WARNING_ROW = 12;
106
+ const int WARNING_COLUMN = 21;
107
+
108
+ const int FONT[612] = int[612](
109
+ 0, 0, 0, 983040, 1671264, 1474704, 1474704, 1474704, 1474704, 1474704, 1474704, 1474704, 1671264, 983040, 0, 0, 0, 0, // 0
110
+ 0, 0, 0, 917504, 1704000, 1179840, 1704000, 655424, 655424, 655424, 655424, 1769536, 1114336, 2031616, 0, 0, 0, 0, // 1
111
+ 0, 0, 0, 983040, 1671264, 1474704, 1998864, 426000, 884768, 1769536, 1441920, 1540224, 1081584, 2064384, 0, 0, 0, 0, // 2
112
+ 0, 0, 0, 2031616, 1147104, 1998864, 163856, 950288, 622688, 950288, 163856, 1998864, 1147104, 2031616, 0, 0, 0, 0, // 3
113
+ 0, 0, 0, 2064384, 1474704, 1474704, 1474704, 1474704, 1081584, 1998864, 163856, 163856, 163856, 229376, 0, 0, 0, 0, // 4
114
+ 0, 0, 0, 2064384, 1081584, 1540224, 1507456, 1147104, 1998864, 163856, 1998864, 1474704, 1671264, 983040, 0, 0, 0, 0, // 5
115
+ 0, 0, 0, 983040, 1638496, 1507456, 1507456, 1147104, 1474704, 1474704, 1474704, 1474704, 1671264, 983040, 0, 0, 0, 0, // 6
116
+ 0, 0, 0, 2064384, 1081584, 1998864, 426000, 360480, 852000, 720960, 655424, 655424, 655424, 917504, 0, 0, 0, 0, // 7
117
+ 0, 0, 0, 983040, 1671264, 1474704, 1474704, 1474704, 1671264, 1474704, 1474704, 1474704, 1671264, 983040, 0, 0, 0, 0, // 8
118
+ 0, 0, 0, 983040, 1671264, 1474704, 1474704, 1474704, 1605744, 950288, 163856, 950288, 622688, 983040, 0, 0, 0, 0, // 9
119
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983040, 589920, 589920, 983040, 0, 0, 0, 0, // .
120
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // space
121
+ 0, 0, 0, 0, 0, 0, 0, 2064384, 1081584, 2064384, 0, 0, 0, 0, 0, 0, 0, 0, // -
122
+ 0, 0, 0, 0, 0, 0, 3899392, 2785552, 2785552, 3047696, 3506336, 1376416, 1769536, 917504, 0, 0, 0, 0, // v, volts
123
+ 0, 0, 1966080, 3342528, 2949408, 2949408, 3342528, 1966080, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // °, degrees
124
+ 0, 0, 0, 0, 7979008, 4932360, 5161744, 8224800, 1769536, 3653760, 7225624, 5915160, 7585792, 0, 0, 0, 0, 0, // %
125
+ 1835008, 3539072, 7061824, 14508584, 11973652, 6543362, 12611584, 0, 4128768, 2195936, 2785616, 2785616, 2785616, 4161536, 0, 0, 0, 0, // a mountain over m, the altitude; the shader adds a green dot inside
126
+ 0, 4128768, 2195936, 2785616, 2785616, 2785616, 4161536, 0, 983040, 1638496, 1507456, 1769536, 1900576, 1245376, 1966080, 0, 0, 0, // m over s, meters per second
127
+ 14680064, 12567552, 11036024, 10135124, 11183444, 11183444, 16769024, 917504, 655424, 720960, 622688, 688208, 688208, 1015808, 0, 0, 0, 0, // km over h, kilometers per hour
128
+ 0, 8257536, 14410304, 11445524, 9070424, 11191632, 11175248, 16744448, 15757312, 2022914, 7575750, 1400490, 13849290, 1547910, 16576512, 0, 0, 0, // Air over Spd, the air speed
129
+ 0, 0, 0, 0, 0, 0, 917504, 1769536, 3244256, 6341104, 4211704, 8372224, 0, 0, 0, 0, 0, 0, // an arrow up
130
+ 0, 0, 917504, 1769536, 3244256, 6341104, 4211704, 8372224, 0, 917504, 1769536, 3244256, 6341104, 4211704, 8372224, 0, 0, 0, // two arrows up
131
+ 0, 0, 0, 0, 0, 0, 8372224, 4211704, 6341104, 3244256, 1769536, 917504, 0, 0, 0, 0, 0, 0, // an arrow down
132
+ 0, 0, 8372224, 4211704, 6341104, 3244256, 1769536, 917504, 0, 8372224, 4211704, 6341104, 3244256, 1769536, 917504, 0, 0, 0, // two arrows down
133
+ 0, 0, 0, 2064384, 1081584, 1540224, 1310848, 1507456, 1114336, 1507456, 1310848, 1310848, 1310848, 1835008, 0, 0, 0, 0, // F
134
+ 0, 0, 0, 2031616, 1147104, 1474704, 1474704, 1474704, 1147104, 1474704, 1474704, 1474704, 1147104, 2031616, 0, 0, 0, 0, // B
135
+ 0, 0, 0, 3899392, 2785552, 2785552, 2785552, 3047696, 2785616, 2785616, 2785616, 2785616, 3506336, 2031616, 0, 0, 0, 0, // W
136
+ 0, 0, 0, 983040, 1671264, 1474704, 1474704, 1474704, 1081584, 1474704, 1474704, 1474704, 1474704, 2064384, 0, 0, 0, 0, // A
137
+ 0, 0, 0, 2031616, 1147104, 1474704, 1474704, 1474704, 1147104, 1409184, 1474704, 1474704, 1474704, 2064384, 0, 0, 0, 0, // R
138
+ 0, 0, 0, 4161536, 2130416, 3899456, 655424, 655424, 655424, 655424, 655424, 655424, 655424, 917504, 0, 0, 0, 0, // T
139
+ 0, 0, 0, 1835008, 1310848, 1310848, 1310848, 1310848, 1310848, 1310848, 1310848, 1540224, 1081584, 2064384, 0, 0, 0, 0, // L
140
+ 0, 0, 0, 2031616, 1114336, 1769536, 655424, 655424, 655424, 655424, 655424, 1769536, 1114336, 2031616, 0, 0, 0, 0, // I
141
+ 0, 0, 0, 2064384, 1081584, 1540224, 1310848, 1507456, 1114336, 1507456, 1310848, 1540224, 1081584, 2064384, 0, 0, 0, 0, // E
142
+ 0, 0, 0, 1015808, 1605744, 1540224, 1310848, 1507456, 1671264, 950288, 163856, 1998864, 1147104, 2031616, 0, 0, 0, 0 // S
143
+ );
144
+
145
+ int digit(float value, float power) {
146
+ return int(mod(floor(value / power), 10.0));
147
+ }
148
+
149
+ // 10 to the n, exactly: pow may be off by a little on the GPU
150
+ float powerOfTen(int n) {
151
+ return n == 3 ? 1000.0 : n == 2 ? 100.0 : n == 1 ? 10.0 : 1.0;
152
+ }
153
+
154
+ // a number right-aligned to end at the column last: its whole part, and its tenths after a dot,
155
+ // and a minus before it when negative; -1 left of it
156
+ int numberAt(float value, bool tenths, int column, int last) {
157
+ float scaled = floor(abs(value) * (tenths ? 10.0 : 1.0) + 0.5);
158
+ float whole = tenths ? floor(scaled / 10.0) : scaled;
159
+ int digits = whole >= 1000.0 ? 4 : whole >= 100.0 ? 3 : whole >= 10.0 ? 2 : 1;
160
+ int i = last - column;
161
+ if (tenths) {
162
+ if (i == 0) {
163
+ return digit(scaled, 1.0);
164
+ }
165
+ if (i == 1) {
166
+ return DOT;
167
+ }
168
+ i -= 2;
169
+ }
170
+ if (i >= 0 && i < digits) {
171
+ return digit(whole, powerOfTen(i));
172
+ }
173
+ return i == digits && value < 0.0 && scaled > 0.0 ? MINUS : -1;
174
+ }
175
+
176
+ // the glyph in this cell and its color, or -1
177
+ int glyphAt(int column, int row, out vec3 color) {
178
+ color = WHITE;
179
+ // the flight mode, top left
180
+ if (row == 1 && column >= 3 && column <= 6) {
181
+ int i = column - 3;
182
+ if (failsafe > 0.5) {
183
+ return i == 0 ? LETTER_R : i == 1 ? LETTER_T : i == 2 ? LETTER_L : -1;
184
+ }
185
+ return i == 0 ? LETTER_F : i == 1 ? LETTER_B : i == 2 ? LETTER_W : LETTER_A;
186
+ }
187
+ // the heading, top middle
188
+ if (row == 1 && column >= 23 && column <= 26) {
189
+ return column == 26 ? DEGREE : numberAt(mod(floor(heading + 0.5), 360.0), false, column, 25);
190
+ }
191
+ // the battery voltage, top right after its symbol: 12.0v
192
+ if (row == 2 && column > LINK_COLUMN && column <= UNIT_COLUMN) {
193
+ return column == UNIT_COLUMN ? VOLT : numberAt(clamp(voltage, 0.0, 99.9), true, column, UNIT_COLUMN - 1);
194
+ }
195
+ // the right column: the altitude, the vertical speed after its arrows, the throttle
196
+ bool right = column >= UNIT_COLUMN - 6 && column <= UNIT_COLUMN;
197
+ if (row == MIDDLE_ROW && right) {
198
+ return column == UNIT_COLUMN ? ALTITUDE : numberAt(clamp(altitude, -999.0, 9999.0), false, column, UNIT_COLUMN - 1);
199
+ }
200
+ if (row == MIDDLE_ROW + 1 && right) {
201
+ if (column == UNIT_COLUMN) {
202
+ return METERS_PER_SECOND;
203
+ }
204
+ float climb = min(abs(verticalSpeed), 99.9);
205
+ int width = climb >= 9.95 ? 4 : 3;
206
+ if (column == UNIT_COLUMN - 1 - width) {
207
+ color = GREEN;
208
+ bool up = verticalSpeed > 0.0;
209
+ return climb < 0.05 ? -1 : climb < 5.0 ? (up ? UP : DOWN) : (up ? UP_TWO : DOWN_TWO);
210
+ }
211
+ return numberAt(climb, true, column, UNIT_COLUMN - 1);
212
+ }
213
+ if (row == MIDDLE_ROW + 3 && right) {
214
+ return column == UNIT_COLUMN ? PERCENT : numberAt(clamp(throttle, 0.0, 100.0), false, column, UNIT_COLUMN - 1);
215
+ }
216
+ // the warning
217
+ if (failsafe > 0.5 && blink > 0.5 && row == WARNING_ROW && column >= WARNING_COLUMN && column < WARNING_COLUMN + 8) {
218
+ int i = column - WARNING_COLUMN;
219
+ color = RED;
220
+ return i == 0 ? LETTER_F : i == 1 ? LETTER_A : i == 2 ? LETTER_I : i == 3 ? LETTER_L : i == 4 ? LETTER_S : i == 5 ? LETTER_A : i == 6 ? LETTER_F : LETTER_E;
221
+ }
222
+ // the air speed, bottom middle: its label, whole km/h and the unit
223
+ if (row == 16 && column >= 20 && column <= 25) {
224
+ if (column == 20) {
225
+ color = PALE_BLUE;
226
+ return AIR_SPEED;
227
+ }
228
+ return column == 25 ? KILOMETERS_PER_HOUR : numberAt(clamp(speed, 0.0, 999.0), false, column, 24);
229
+ }
230
+ return -1;
231
+ }
232
+
233
+ // 2 where the glyph is drawn, 1 on its black outline, 0 elsewhere; x and y in the cell's pixels.
234
+ // A row of the table holds the glyph in its low 12 bits and the outline in the 12 above, the
235
+ // leftmost pixel highest
236
+ float glyphInk(int glyph, int x, int y) {
237
+ if (glyph < 0) {
238
+ return 0.0;
239
+ }
240
+ int row = FONT[glyph * int(CELL_HEIGHT) + y] >> (int(CELL_WIDTH) - 1 - x);
241
+ return (row & 1) == 1 ? 2.0 : ((row >> int(CELL_WIDTH)) & 1) == 1 ? 1.0 : 0.0;
242
+ }
243
+
244
+ // 2 inside the box, 1 on its outline a pixel around, 0 elsewhere; in pixels
245
+ float boxInk(vec2 p, vec2 low, vec2 high) {
246
+ if (all(greaterThanEqual(p, low)) && all(lessThan(p, high))) {
247
+ return 2.0;
248
+ }
249
+ return all(greaterThanEqual(p, low - 1.0)) && all(lessThan(p, high + 1.0)) ? 1.0 : 0.0;
250
+ }
251
+
252
+ // what is drawn over what is under it, its outline under what is drawn
253
+ void paint(inout float ink, inout vec3 fill, float layer, vec3 color) {
254
+ if (layer > ink) {
255
+ ink = layer;
256
+ fill = color;
257
+ }
258
+ }
259
+
260
+ void main() {
261
+ vec4 sceneColor = texture(colorTexture, v_textureCoordinates);
262
+ // the grid as large as fits the screen, centered, from its top left, in pixels
263
+ vec2 size = czm_viewport.zw;
264
+ vec2 grid = vec2(COLUMNS * CELL_WIDTH, ROWS * CELL_HEIGHT);
265
+ float scale = min(size.x / grid.x, size.y / grid.y);
266
+ vec2 fromCorner = vec2(gl_FragCoord.x - czm_viewport.x, czm_viewport.y + size.y - gl_FragCoord.y) - 0.5 * (size - grid * scale);
267
+ vec2 p = floor(fromCorner / scale);
268
+ int column = int(floor(p.x / CELL_WIDTH));
269
+ int row = int(floor(p.y / CELL_HEIGHT));
270
+ if (column < 0 || column >= int(COLUMNS) || row < 0 || row >= int(ROWS)) {
271
+ out_FragColor = sceneColor;
272
+ return;
273
+ }
274
+ vec2 inCell = p - vec2(float(column) * CELL_WIDTH, float(row) * CELL_HEIGHT);
275
+
276
+ vec3 glyphColor;
277
+ int glyph = glyphAt(column, row, glyphColor);
278
+ float ink = 0.0;
279
+ vec3 fill = WHITE;
280
+ paint(ink, fill, glyphInk(glyph, int(inCell.x), int(inCell.y)), glyphColor);
281
+
282
+ // the horizon, as ArduPilot's draw_horizon in rows and columns from the middle cell, with the
283
+ // pitch (positive nose down) raising it: a dot per column, at its height in the cell in ninths,
284
+ // or past 45 degrees of roll a dot per row, at its place across the cell in ninths
285
+ bool nearMiddle = abs(column - MIDDLE_COLUMN) <= 5 && abs(row - MIDDLE_ROW) <= 5;
286
+ if (nearMiddle && (abs(roll) < 90.0 || blink > 0.5)) {
287
+ float level = clamp(-pitch, -MAX_PITCH, MAX_PITCH) * ROWS_PER_DEGREE;
288
+ float ky = sin(radians(roll));
289
+ float kx = cos(radians(roll));
290
+ bool steep = abs(ky) >= abs(kx);
291
+ for (int k = -4; k <= 4; k++) {
292
+ float along = steep ? (float(k) - level) / RATIO * kx / ky + 0.5 : RATIO * float(k) * ky / kx + level + 0.5;
293
+ float cell = floor(along);
294
+ float ninth = floor((along - cell) * 9.0);
295
+ if (abs(cell) > 4.0) {
296
+ continue;
297
+ }
298
+ vec2 center = steep
299
+ ? vec2(float(MIDDLE_COLUMN) + cell, float(MIDDLE_ROW - k)) * vec2(CELL_WIDTH, CELL_HEIGHT) + vec2(2.0 + ninth, 9.0)
300
+ : vec2(float(MIDDLE_COLUMN + k), float(MIDDLE_ROW) - cell) * vec2(CELL_WIDTH, CELL_HEIGHT) + vec2(6.0, 17.0 - 2.0 * ninth);
301
+ float d = length(p + 0.5 - center);
302
+ paint(ink, fill, d < 1.0 ? 2.0 : d < 2.0 ? 1.0 : 0.0, WHITE);
303
+ }
304
+ }
305
+
306
+ // the link bar, top right: as long as the link quality, its color by it; full and red in
307
+ // failsafe
308
+ if (row == 1) {
309
+ float quality = failsafe > 0.5 ? 99.0 : clamp(linkQuality, 0.0, 99.0);
310
+ vec3 color = failsafe > 0.5 || quality < 40.0 ? RED : quality < 70.0 ? ORANGE : GREEN;
311
+ float left = float(LINK_COLUMN) * CELL_WIDTH;
312
+ float bar = floor(LINK_CELLS * CELL_WIDTH * (quality + 1.0) / 100.0);
313
+ if (bar > 0.0) {
314
+ paint(ink, fill, boxInk(p, vec2(left, CELL_HEIGHT + 7.0), vec2(left + bar, CELL_HEIGHT + 11.0)), color);
315
+ }
316
+ }
317
+
318
+ // the battery symbol, top right before its voltage: a white frame with a cap, filled in green
319
+ // from the bottom in steps as the voltage drops, black inside above the fill
320
+ if (column == LINK_COLUMN && row == 2) {
321
+ float charge = clamp((voltage - EMPTY_VOLTS) / (FULL_VOLTS - EMPTY_VOLTS), 0.0, 1.0);
322
+ float fillTop = 17.0 - 13.0 * ceil(charge * BATTERY_STEPS) / BATTERY_STEPS;
323
+ paint(ink, fill, max(boxInk(inCell, vec2(2.0, 3.0), vec2(10.0, 18.0)), boxInk(inCell, vec2(4.0, 1.0), vec2(8.0, 3.0))), WHITE);
324
+ if (all(greaterThanEqual(inCell, vec2(3.0, 4.0))) && all(lessThan(inCell, vec2(9.0, 17.0)))) {
325
+ ink = inCell.y >= fillTop ? 2.0 : 1.0;
326
+ fill = GREEN;
327
+ }
328
+ }
329
+
330
+ // the green dot inside the altitude's mountain
331
+ if (glyph == ALTITUDE) {
332
+ paint(ink, fill, all(greaterThanEqual(inCell, vec2(3.0, 4.0))) && all(lessThan(inCell, vec2(5.0, 6.0))) ? 2.0 : 0.0, GREEN);
333
+ }
334
+
335
+ vec3 color = ink == 2.0 ? fill : ink == 1.0 ? vec3(0.0) : sceneColor.rgb;
336
+ out_FragColor = vec4(mix(sceneColor.rgb, color, ink > 0.0 ? opacity : 0.0), sceneColor.a);
337
+ }
@@ -0,0 +1,109 @@
1
+ // The Dufour map's look, after EyeFromDepth, DepthEdges, Height, Normal and Hash: the slopes drawn in hachures, ink
2
+ // strokes down the steepest slope, broken along their length, thicker where it is steeper and on the slopes away from a
3
+ // light from the north-west, the flat ground left blank; the silhouettes outlined; black ink on white paper.
4
+ precision highp sampler2D;
5
+ uniform sampler2D colorTexture;
6
+ // the strokes' spacing on the screen, in pixels, their length in spacings, the ink's weight
7
+ uniform float spacing;
8
+ uniform float strokeLength;
9
+ uniform float weight;
10
+ // how much thinner the strokes facing the light, and thicker away from it, 0 to 1
11
+ uniform float oblique;
12
+ // the slope under which the ground is left blank, radians
13
+ uniform float flatSlope;
14
+ uniform float outline;
15
+ uniform vec3 paper;
16
+ uniform vec3 ink;
17
+ // the hachures' frame, in eye coordinates: its origin on the ground below the camera, east and north there (dufour.js)
18
+ uniform vec3 originEC;
19
+ uniform vec3 eastEC;
20
+ uniform vec3 northEC;
21
+ in vec2 v_textureCoordinates;
22
+
23
+ // the strokes' finest spacing, in meters
24
+ const float BASE = 1.0;
25
+ // the strokes' directions: the way down the slope snapped to one of these many, the two nearest blended, so that the
26
+ // strokes are straight lines, parallel on a slope, rather than turning with each pixel's normal
27
+ const float DIRECTIONS = 12.0;
28
+ // a stroke's breaks: its length in spacings, strokeLength long on average, and the share of it left blank
29
+ const float BREAK = 0.08;
30
+ // the light, from the north-west, in east and north
31
+ const vec2 LIGHT = vec2(-0.7071, 0.7071);
32
+ // the ink's share grows with the slope, none on the flat, all of it at 60 degrees (radians), Lehmann's scale
33
+ // stretched for the Alps, whose slopes are mostly past his 45; the
34
+ // widest share of the spacing a stroke covers, the paper showing between them, an engraving's
35
+ const float LEHMANN = 1.047;
36
+ const float MAX_COVER = 0.45;
37
+ // the slopes over which the strokes fade in above the flat ground, radians (2 degrees): the terrain's triangles,
38
+ // slightly tilted, would show as patches
39
+ const float FLAT_RAMP = 0.035;
40
+
41
+ // the strokes' ink at a point of the ground, en its east and north, s their spacing in meters, angle the direction
42
+ // down the slope they run along, cover the share of the spacing they cover. Each stroke is a straight line along it,
43
+ // broken every strokeLength spacings or so, its breaks staggered from the next stroke's: no line across the strokes
44
+ float hachuresAt(vec2 en, float angle, vec2 across, float cover, float s) {
45
+ vec2 down = vec2(-across.y, across.x);
46
+ // a phase of each direction, so that two directions' strokes do not meet in a pattern
47
+ float u = dot(en, across) / s + hash(vec2(angle, s));
48
+ float stroke = floor(u);
49
+ float w = dot(en, down) / (strokeLength * s) + hash(vec2(stroke, s));
50
+ float dash = step(BREAK, fract(w * mix(0.8, 1.25, hash(vec2(s, stroke)))));
51
+ // antialiased, and its mean, the share it covers, where the strokes grow too close to tell apart (a slope seen
52
+ // edge on): no ink where it covers none
53
+ float halfWidth = 0.5 * cover;
54
+ float aa = fwidth(u);
55
+ float sharp = 1.0 - smoothstep(halfWidth - aa, halfWidth + aa, abs(fract(u) - 0.5));
56
+ return mix(sharp * dash, 2.0 * halfWidth * (1.0 - BREAK), smoothstep(0.2, 0.5, aa)) * step(1e-3, halfWidth);
57
+ }
58
+
59
+ // the strokes in one direction, their spacing a power of two of meters, crossfaded with the next, so that they stay at
60
+ // least spacing pixels apart: taken from the ground a pixel covers across them, far more than its width where a slope
61
+ // is seen at a grazing angle
62
+ float directionAt(vec2 en, float angle, float cover) {
63
+ vec2 across = vec2(-sin(angle), cos(angle));
64
+ float lod = log2(max(spacing * fwidth(dot(en, across)), BASE) / BASE);
65
+ float s = BASE * exp2(floor(lod));
66
+ return mix(hachuresAt(en, angle, across, cover, s), hachuresAt(en, angle, across, cover, 2.0 * s), fract(lod));
67
+ }
68
+
69
+ // the strokes in both of the directions nearest the way down, blended
70
+ float strokesAt(vec2 en, vec2 down, float cover) {
71
+ // the strokes are lines: a direction and its opposite are the same
72
+ float t = mod(atan(down.y, down.x), czm_pi) / czm_pi * DIRECTIONS;
73
+ float bin = floor(t);
74
+ float width = czm_pi / DIRECTIONS;
75
+ return mix(directionAt(en, bin * width, cover), directionAt(en, (bin + 1.0) * width, cover), smoothstep(0.4, 0.6, fract(t)));
76
+ }
77
+
78
+ void main() {
79
+ vec2 uv = v_textureCoordinates;
80
+ vec4 sceneColor = texture(colorTexture, uv);
81
+ vec4 eye = eyeAt(depthTexture, uv);
82
+ if (eye.w == 0.0) {
83
+ out_FragColor = vec4(paper, 1.0);
84
+ return;
85
+ }
86
+ float px = czm_pixelRatio;
87
+ // averaged wider than smoothNormalAt: the slopes of the terrain's triangles would set the strokes' width
88
+ vec3 normal = normalize(normalAt(depthTexture, uv, eye.xyz, 4.0 * px) + normalAt(depthTexture, uv, eye.xyz, 12.0 * px) + normalAt(depthTexture, uv, eye.xyz, 24.0 * px));
89
+ float rise = dot(normal, up);
90
+ float slope = acos(clamp(rise, -1.0, 1.0));
91
+ float c = depthAt(uv);
92
+
93
+ // the way down the slope, the horizontal part of a normal smoothed wider: the strokes' direction would wobble with
94
+ // the terrain's triangles
95
+ vec3 wide = normalize(normal + normalAt(depthTexture, uv, eye.xyz, 32.0 * px));
96
+ vec3 horizontal = wide - dot(wide, up) * up;
97
+ vec2 down = normalize(vec2(dot(horizontal, eastEC), dot(horizontal, northEC)) + 1e-6);
98
+ vec3 rel = eye.xyz - originEC;
99
+ vec2 en = vec2(dot(rel, eastEC), dot(rel, northEC));
100
+ float steep = smoothstep(flatSlope, flatSlope + FLAT_RAMP, slope) * clamp(slope / LEHMANN, 0.0, 1.0);
101
+ float cover = clamp(weight * steep * (1.0 - oblique * dot(down, LIGHT)), 0.0, MAX_COVER);
102
+ // read everywhere, outside any branch, for its derivatives
103
+ float amount = strokesAt(en, down, cover);
104
+
105
+ if (outline > 0.0) {
106
+ amount = max(amount, outline * outlineAt(uv, c, vec4(0.0), 1.0, pixelAt(c)));
107
+ }
108
+ out_FragColor = vec4(mix(paper, ink, amount), sceneColor.a);
109
+ }
@@ -0,0 +1,36 @@
1
+ // Eye coordinates of the pixel at uv, from the depth texture; w is 0 for the sky. With a
2
+ // logarithmic depth buffer, czm_readDepth's perspective depth is about 1 beyond a few meters,
3
+ // so the distance is decoded from the logarithmic depth directly. An orthographic camera's depth
4
+ // is linear between the near and far planes Cesium fits to the scene each frame, not the
5
+ // projection's, and its rays are parallel; Cesium gives it no inverse projection (zero).
6
+
7
+ // A sampler's default precision is low: some phones' GPUs (Mali) then read the depth as a half float,
8
+ // steps of centimeters a few hundred meters away.
9
+ precision highp sampler2D;
10
+
11
+ vec4 eyeAt(sampler2D depthTexture, vec2 uv) {
12
+ float raw = texture(depthTexture, uv).r;
13
+ if (czm_orthographicIn3D == 1.0) {
14
+ vec2 xy = (2.0 * uv - 1.0 - czm_projection[3].xy) / vec2(czm_projection[0][0], czm_projection[1][1]);
15
+ return raw >= 1.0 ? vec4(0.0, 0.0, -1.0, 0.0) : vec4(xy, -mix(czm_currentFrustum.x, czm_currentFrustum.y, raw), 1.0);
16
+ }
17
+ // the pixel's view ray, through the near plane
18
+ vec4 ray = czm_inverseProjection * vec4(2.0 * uv - 1.0, -1.0, 1.0);
19
+ ray.xyz /= ray.w;
20
+ if (raw >= 1.0) {
21
+ return vec4(normalize(ray.xyz), 0.0);
22
+ }
23
+ #ifdef LOG_DEPTH
24
+ float viewDepth = exp2(raw * czm_log2FarDepthFromNearPlusOne) - 1.0 + czm_currentFrustum.x;
25
+ #else
26
+ vec4 eye = czm_inverseProjection * vec4(2.0 * uv - 1.0, 2.0 * raw - 1.0, 1.0);
27
+ float viewDepth = -eye.z / eye.w;
28
+ #endif
29
+ return vec4(ray.xyz * (viewDepth / -ray.z), 1.0);
30
+ }
31
+
32
+ // the distance to the pixel at uv, in meters, and the sky as far as a given distance
33
+ float eyeDistance(sampler2D depthTexture, vec2 uv, float skyDistance) {
34
+ vec4 eye = eyeAt(depthTexture, uv);
35
+ return eye.w == 0.0 ? skyDistance : length(eye.xyz);
36
+ }
@@ -0,0 +1,5 @@
1
+ // a filmic roll-off (ACES, Narkowicz's fit) for the effects that add light to the picture: Cesium
2
+ // has already tone mapped it, so their light would clip to flat white without it
3
+ vec3 filmic(vec3 x) {
4
+ return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
5
+ }
@@ -0,0 +1,18 @@
1
+ // What ValleyFog's fog and the rain's and the snow's haze share: the sky as a ray this long, and
2
+ // their light, lit by the sun as Cesium's fog, turning around sunset to a moonlit blue as bright as
3
+ // the scene's fog.minimumBrightness, rather than a flat gray. Needs Height.
4
+
5
+ // the sky is a ray this long, in meters
6
+ const float SKY_DISTANCE = 50000.0;
7
+ // tint of the fog at night, scaled by fog.minimumBrightness
8
+ const vec3 NIGHT = vec3(0.45, 0.55, 0.85);
9
+
10
+ // 0 at night to 1 by day, from the sun's height at the camera
11
+ float daylight() {
12
+ return smoothstep(-0.1, 0.3, dot(up, czm_sunDirectionEC));
13
+ }
14
+
15
+ // a fog's color by day, turning to the moonlit blue at night
16
+ vec3 byDaylight(vec3 color, float day) {
17
+ return mix(NIGHT * czm_fogMinimumBrightness, color, day);
18
+ }
@@ -0,0 +1,10 @@
1
+ // Size of the visible frame of the given width over height, centered in the canvas, in texture
2
+ // coordinates: bars above and below when the canvas is narrower than the ratio, on the sides when
3
+ // it is wider; the whole canvas for a ratio of 0.
4
+ vec2 frameSize(float aspectRatio) {
5
+ if (aspectRatio <= 0.0) {
6
+ return vec2(1.0);
7
+ }
8
+ float canvas = czm_viewport.z / czm_viewport.w;
9
+ return aspectRatio < canvas ? vec2(aspectRatio / canvas, 1.0) : vec2(1.0, canvas / aspectRatio);
10
+ }
@@ -0,0 +1,12 @@
1
+ // random in [0, 1) for a point, without sin, which GPUs compute poorly for large numbers
2
+ float hash(vec2 p) {
3
+ vec3 p3 = fract(p.xyx * 0.1031);
4
+ p3 += dot(p3, p3.yzx + 33.33);
5
+ return fract((p3.x + p3.y) * p3.z);
6
+ }
7
+
8
+ // per pixel noise in [0, 1), "interleaved gradient noise" (Jimenez 2014): a dither that
9
+ // spreads the sample positions of a blur between neighbouring pixels
10
+ float pixelNoise(vec2 pixel) {
11
+ return fract(52.9829189 * fract(dot(pixel, vec2(0.06711056, 0.00583715))));
12
+ }
@@ -0,0 +1,25 @@
1
+ // Height above the ellipsoid of a point in eye coordinates, computed relative to the camera: in
2
+ // world coordinates, single precision would round the position to about half a meter. The
3
+ // uniforms come from the CPU in double precision (height.js).
4
+ uniform float cameraHeight;
5
+ uniform vec3 up;
6
+ uniform float radius;
7
+
8
+ float heightAt(vec3 eye) {
9
+ // the camera is at the origin of eye coordinates; away from it horizontally, the ground falls
10
+ // below the horizontal by the Earth's curvature
11
+ float rise = dot(eye, up);
12
+ float across = dot(eye, eye) - rise * rise;
13
+ return cameraHeight + rise + across / (2.0 * radius);
14
+ }
15
+
16
+ // the part below a height of the ray from the camera to a point in eye coordinates, as shares of
17
+ // it, from its start to its end, the height taken as linear along it; none when both ends are above
18
+ vec2 belowHeight(vec3 rayEnd, float height) {
19
+ float h0 = cameraHeight;
20
+ float h1 = heightAt(rayEnd);
21
+ if (min(h0, h1) >= height) {
22
+ return vec2(0.0);
23
+ }
24
+ return vec2(h0 > height ? (h0 - height) / (h0 - h1) : 0.0, h1 > height ? (height - h0) / (h1 - h0) : 1.0);
25
+ }
@@ -0,0 +1,44 @@
1
+ // Black and white infrared film: foliage, which reflects the near infrared, turns bright, the sky
2
+ // and water dark. The gray is the lightness raised or lowered by a weight per hue. After prod80's
3
+ // ReShade Black & White (MIT), its Infrared preset, https://github.com/prod80/prod80-ReShade-Repository
4
+ precision highp sampler2D;
5
+ uniform sampler2D colorTexture;
6
+ // 0 to 1
7
+ uniform float strength;
8
+ in vec2 v_textureCoordinates;
9
+
10
+ // weights of the red, yellow, green, cyan, blue and magenta hues
11
+ const float RED = -1.35;
12
+ const float YELLOW = 2.35;
13
+ const float GREEN = 1.35;
14
+ const float CYAN = -1.35;
15
+ const float BLUE = -1.6;
16
+ const float MAGENTA = -1.07;
17
+ // shape of the hue selections
18
+ const float CURVE = 1.5;
19
+
20
+ float curve(float x, float k) {
21
+ float s = sign(x - 0.5);
22
+ float o = 0.5 * (1.0 + s);
23
+ return o - 0.5 * s * pow(max(2.0 * (o - s * x), 0.0), k);
24
+ }
25
+
26
+ // how much of the hue centered at center there is in hue
27
+ float hueWeight(float hue, float center) {
28
+ return curve(max(1.0 - abs((hue - center) * 6.0), 0.0), CURVE);
29
+ }
30
+
31
+ void main() {
32
+ vec4 sceneColor = texture(colorTexture, v_textureCoordinates);
33
+ vec3 hsl = czm_RGBToHSL(clamp(sceneColor.rgb, 0.0, 1.0));
34
+ float h = hsl.x;
35
+ float weight = RED * (hueWeight(h, 0.0) + hueWeight(h, 1.0))
36
+ + YELLOW * hueWeight(h, 1.0 / 6.0)
37
+ + GREEN * hueWeight(h, 2.0 / 6.0)
38
+ + CYAN * hueWeight(h, 3.0 / 6.0)
39
+ + BLUE * hueWeight(h, 4.0 / 6.0)
40
+ + MAGENTA * hueWeight(h, 5.0 / 6.0);
41
+ float saturation = hsl.y * (1.0 - hsl.y) + hsl.y;
42
+ float gray = clamp(hsl.z + hsl.z * weight * saturation * (1.0 - hsl.z), 0.0, 1.0);
43
+ out_FragColor = vec4(mix(sceneColor.rgb, vec3(gray), strength), sceneColor.a);
44
+ }
@@ -0,0 +1,41 @@
1
+ // The jello of a vibrating camera with a rolling shutter: the sensor reads its rows one after
2
+ // another, so each row sees the camera at a different moment of its shake, and straight edges
3
+ // wobble. After Readout's readout pass (stoatworks-labs, MIT): row r of H is read
4
+ // `readout * (1 - r / H)` before the frame, the camera's pose is taken at the middle of the row's
5
+ // exposure, and the shake is a few sinusoids in x, y and rotation. The phases come from the CPU,
6
+ // in double precision; the picture is magnified by zoom so that its edges do not show.
7
+ precision highp sampler2D;
8
+ uniform sampler2D colorTexture;
9
+ // the shake: frequencies in Hz, phases at the frame's time in radians, amplitudes in picture
10
+ // heights (x, y) and radians (rotation)
11
+ uniform vec4 shakeHz;
12
+ uniform vec4 phaseX;
13
+ uniform vec4 phaseY;
14
+ uniform vec4 phaseRotation;
15
+ uniform vec4 amplitudeX;
16
+ uniform vec4 amplitudeY;
17
+ uniform vec4 amplitudeRotation;
18
+ uniform float zoom;
19
+ in vec2 v_textureCoordinates;
20
+
21
+ // seconds to read all the rows, top down, and to expose each
22
+ const float READOUT = 0.02;
23
+ const float EXPOSURE = 0.004;
24
+
25
+ void main() {
26
+ vec2 size = czm_viewport.zw;
27
+ // the row, from the top, and how long before the frame it was read, at the middle of its exposure
28
+ float row = floor((1.0 - v_textureCoordinates.y) * size.y);
29
+ float tau = READOUT * (1.0 - row / size.y) + 0.5 * EXPOSURE;
30
+ vec4 arg = czm_twoPi * shakeHz * tau;
31
+ vec2 shift = vec2(dot(amplitudeX, sin(phaseX - arg)), dot(amplitudeY, sin(phaseY - arg)));
32
+ float rotation = dot(amplitudeRotation, sin(phaseRotation - arg));
33
+
34
+ // centred, in picture heights, so that a rotation is not a shear
35
+ float aspect = size.x / size.y;
36
+ vec2 p = vec2((v_textureCoordinates.x - 0.5) * aspect, v_textureCoordinates.y - 0.5);
37
+ float c = cos(rotation);
38
+ float s = sin(rotation);
39
+ p = (vec2(p.x * c - p.y * s, p.x * s + p.y * c) + shift) / zoom;
40
+ out_FragColor = texture(colorTexture, vec2(p.x / aspect + 0.5, p.y + 0.5));
41
+ }