three-stdlib 2.35.11 → 2.35.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (529) hide show
  1. package/animation/AnimationClipCreator.d.ts +1 -1
  2. package/animation/CCDIKSolver.d.ts +1 -1
  3. package/animation/MMDAnimationHelper.d.ts +3 -3
  4. package/animation/MMDPhysics.d.ts +1 -1
  5. package/cameras/CinematicCamera.d.ts +2 -2
  6. package/controls/ArcballControls.d.ts +4 -4
  7. package/controls/DeviceOrientationControls.d.ts +4 -4
  8. package/controls/DragControls.d.ts +3 -3
  9. package/controls/FirstPersonControls.d.ts +2 -2
  10. package/controls/FlyControls.d.ts +3 -3
  11. package/controls/OrbitControls.d.ts +4 -4
  12. package/controls/PointerLockControls.d.ts +3 -3
  13. package/controls/TrackballControls.d.ts +4 -4
  14. package/controls/TransformControls.d.ts +2 -2
  15. package/controls/experimental/CameraControls.d.ts +3 -3
  16. package/csm/CSM.d.ts +2 -2
  17. package/csm/CSMFrustum.d.ts +2 -2
  18. package/csm/CSMHelper.d.ts +2 -2
  19. package/curves/CurveExtras.d.ts +1 -1
  20. package/curves/NURBSCurve.d.ts +1 -1
  21. package/curves/NURBSSurface.d.ts +1 -1
  22. package/curves/NURBSUtils.d.ts +1 -1
  23. package/deprecated/Geometry.d.ts +1 -1
  24. package/effects/AnaglyphEffect.d.ts +1 -1
  25. package/effects/AsciiEffect.d.ts +1 -1
  26. package/effects/OutlineEffect.d.ts +1 -1
  27. package/effects/ParallaxBarrierEffect.d.ts +1 -1
  28. package/effects/PeppersGhostEffect.d.ts +1 -1
  29. package/effects/StereoEffect.d.ts +1 -1
  30. package/environments/RoomEnvironment.d.ts +2 -2
  31. package/exporters/ColladaExporter.d.ts +2 -2
  32. package/exporters/DRACOExporter.d.ts +2 -2
  33. package/exporters/GLTFExporter.d.ts +4 -4
  34. package/exporters/MMDExporter.d.ts +2 -2
  35. package/exporters/OBJExporter.d.ts +2 -2
  36. package/exporters/PLYExporter.d.ts +2 -2
  37. package/exporters/STLExporter.d.ts +1 -1
  38. package/exporters/USDZExporter.d.ts +2 -2
  39. package/geometries/BoxLineGeometry.d.ts +1 -1
  40. package/geometries/ConvexGeometry.d.ts +1 -1
  41. package/geometries/DecalGeometry.d.ts +1 -1
  42. package/geometries/LightningStrike.d.ts +1 -1
  43. package/geometries/ParametricGeometries.d.ts +3 -3
  44. package/geometries/ParametricGeometry.d.ts +2 -2
  45. package/geometries/RoundedBoxGeometry.d.ts +1 -1
  46. package/geometries/TeapotGeometry.d.ts +1 -1
  47. package/geometries/TextGeometry.d.ts +3 -3
  48. package/helpers/LightProbeHelper.d.ts +1 -1
  49. package/helpers/PositionalAudioHelper.d.ts +1 -1
  50. package/helpers/RaycasterHelper.d.ts +2 -2
  51. package/helpers/RectAreaLightHelper.d.ts +1 -1
  52. package/helpers/VertexNormalsHelper.d.ts +1 -1
  53. package/helpers/VertexTangentsHelper.d.ts +1 -1
  54. package/index.d.ts +262 -262
  55. package/interactive/HTMLMesh.d.ts +1 -1
  56. package/interactive/InteractiveGroup.d.ts +1 -1
  57. package/interactive/SelectionBox.d.ts +1 -1
  58. package/interactive/SelectionHelper.d.ts +2 -2
  59. package/libs/MeshoptDecoder.d.ts +1 -1
  60. package/libs/MotionControllers.d.ts +1 -1
  61. package/lights/LightProbeGenerator.d.ts +2 -2
  62. package/lights/RectAreaLightUniformsLib.d.ts +1 -1
  63. package/lines/Line2.d.ts +3 -3
  64. package/lines/LineGeometry.d.ts +2 -2
  65. package/lines/LineMaterial.d.ts +1 -1
  66. package/lines/LineSegments2.d.ts +3 -3
  67. package/lines/LineSegmentsGeometry.d.ts +1 -1
  68. package/lines/Wireframe.d.ts +3 -3
  69. package/lines/WireframeGeometry2.d.ts +2 -2
  70. package/loaders/3DMLoader.d.ts +1 -1
  71. package/loaders/3MFLoader.d.ts +1 -1
  72. package/loaders/AMFLoader.d.ts +1 -1
  73. package/loaders/AssimpLoader.d.ts +1 -1
  74. package/loaders/BVHLoader.d.ts +1 -1
  75. package/loaders/BasisTextureLoader.d.ts +1 -1
  76. package/loaders/ColladaLoader.d.ts +1 -1
  77. package/loaders/DDSLoader.d.ts +1 -1
  78. package/loaders/DRACOLoader.d.ts +1 -1
  79. package/loaders/EXRLoader.d.ts +1 -1
  80. package/loaders/FBXLoader.d.ts +1 -1
  81. package/loaders/FontLoader.d.ts +2 -2
  82. package/loaders/GCodeLoader.d.ts +1 -1
  83. package/loaders/GLTFLoader.d.ts +3 -3
  84. package/loaders/HDRCubeTextureLoader.d.ts +2 -2
  85. package/loaders/KMZLoader.d.ts +2 -2
  86. package/loaders/KTX2Loader.d.ts +1 -1
  87. package/loaders/KTXLoader.d.ts +1 -1
  88. package/loaders/LDrawLoader.d.ts +1 -1
  89. package/loaders/LUT3dlLoader.d.ts +1 -1
  90. package/loaders/LUTCubeLoader.d.ts +1 -1
  91. package/loaders/LWOLoader.d.ts +1 -1
  92. package/loaders/LottieLoader.d.ts +1 -1
  93. package/loaders/MD2Loader.d.ts +1 -1
  94. package/loaders/MDDLoader.d.ts +1 -1
  95. package/loaders/MMDLoader.d.ts +1 -1
  96. package/loaders/MTLLoader.d.ts +1 -1
  97. package/loaders/NRRDLoader.d.ts +2 -2
  98. package/loaders/OBJLoader.d.ts +2 -2
  99. package/loaders/PCDLoader.d.ts +1 -1
  100. package/loaders/PDBLoader.d.ts +1 -1
  101. package/loaders/PLYLoader.d.ts +1 -1
  102. package/loaders/PRWMLoader.d.ts +1 -1
  103. package/loaders/PVRLoader.d.ts +1 -1
  104. package/loaders/RGBELoader.d.ts +1 -1
  105. package/loaders/RGBMLoader.d.ts +1 -1
  106. package/loaders/STLLoader.d.ts +1 -1
  107. package/loaders/SVGLoader.d.ts +1 -1
  108. package/loaders/TDSLoader.d.ts +1 -1
  109. package/loaders/TGALoader.d.ts +1 -1
  110. package/loaders/TTFLoader.d.ts +1 -1
  111. package/loaders/TiltLoader.d.ts +1 -1
  112. package/loaders/VOXLoader.d.ts +1 -1
  113. package/loaders/VRMLLoader.d.ts +1 -1
  114. package/loaders/VRMLoader.d.ts +3 -3
  115. package/loaders/VTKLoader.d.ts +1 -1
  116. package/loaders/XLoader.d.ts +1 -1
  117. package/loaders/XYZLoader.d.ts +1 -1
  118. package/math/Capsule.d.ts +1 -1
  119. package/math/ColorConverter.d.ts +2 -2
  120. package/math/ConvexHull.d.ts +1 -1
  121. package/math/Lut.d.ts +1 -1
  122. package/math/MeshSurfaceSampler.d.ts +1 -1
  123. package/math/OBB.d.ts +1 -1
  124. package/math/Octree.d.ts +2 -2
  125. package/misc/ConvexObjectBreaker.d.ts +1 -1
  126. package/misc/GPUComputationRenderer.d.ts +1 -1
  127. package/misc/Gyroscope.d.ts +1 -1
  128. package/misc/MD2Character.d.ts +1 -1
  129. package/misc/MD2CharacterComplex.d.ts +1 -1
  130. package/misc/MorphAnimMesh.d.ts +1 -1
  131. package/misc/MorphBlendMesh.d.ts +1 -1
  132. package/misc/ProgressiveLightmap.d.ts +1 -1
  133. package/misc/RollerCoaster.d.ts +1 -1
  134. package/misc/Timer.d.ts +1 -1
  135. package/misc/TubePainter.d.ts +1 -1
  136. package/misc/Volume.d.ts +2 -2
  137. package/misc/VolumeSlice.d.ts +2 -2
  138. package/modifiers/CurveModifier.d.ts +1 -1
  139. package/modifiers/EdgeSplitModifier.d.ts +2 -2
  140. package/modifiers/SimplifyModifier.d.ts +2 -2
  141. package/modifiers/TessellateModifier.d.ts +2 -2
  142. package/objects/BatchedMesh.d.ts +2 -2
  143. package/objects/GroundProjectedEnv.d.ts +1 -1
  144. package/objects/Lensflare.d.ts +1 -1
  145. package/objects/LightningStorm.d.ts +2 -2
  146. package/objects/MarchingCubes.d.ts +1 -1
  147. package/objects/Reflector.d.ts +2 -2
  148. package/objects/ReflectorForSSRPass.d.ts +1 -1
  149. package/objects/ReflectorRTT.d.ts +3 -3
  150. package/objects/Refractor.d.ts +2 -2
  151. package/objects/ShadowMesh.d.ts +1 -1
  152. package/objects/Sky.d.ts +2 -2
  153. package/objects/Water.d.ts +1 -1
  154. package/objects/Water2.d.ts +2 -2
  155. package/package.json +5 -11
  156. package/physics/AmmoPhysics.d.ts +1 -1
  157. package/postprocessing/AdaptiveToneMappingPass.d.ts +2 -2
  158. package/postprocessing/AfterimagePass.d.ts +3 -3
  159. package/postprocessing/BloomPass.d.ts +4 -4
  160. package/postprocessing/BokehPass.d.ts +3 -3
  161. package/postprocessing/ClearPass.d.ts +3 -3
  162. package/postprocessing/CubeTexturePass.d.ts +2 -2
  163. package/postprocessing/DotScreenPass.d.ts +4 -4
  164. package/postprocessing/EffectComposer.d.ts +3 -3
  165. package/postprocessing/FilmPass.d.ts +4 -4
  166. package/postprocessing/GlitchPass.d.ts +4 -4
  167. package/postprocessing/HalftonePass.d.ts +3 -3
  168. package/postprocessing/LUTPass.d.ts +2 -2
  169. package/postprocessing/MaskPass.d.ts +3 -3
  170. package/postprocessing/OutlinePass.d.ts +3 -3
  171. package/postprocessing/Pass.d.ts +2 -2
  172. package/postprocessing/RenderPass.d.ts +3 -3
  173. package/postprocessing/RenderPixelatedPass.d.ts +2 -2
  174. package/postprocessing/SAOPass.d.ts +2 -2
  175. package/postprocessing/SMAAPass.d.ts +2 -2
  176. package/postprocessing/SSAARenderPass.d.ts +2 -2
  177. package/postprocessing/SSAOPass.d.ts +2 -2
  178. package/postprocessing/SSRPass.d.ts +3 -3
  179. package/postprocessing/SavePass.d.ts +2 -2
  180. package/postprocessing/ShaderPass.d.ts +4 -4
  181. package/postprocessing/TAARenderPass.d.ts +2 -2
  182. package/postprocessing/TexturePass.d.ts +2 -2
  183. package/postprocessing/UnrealBloomPass.d.ts +2 -2
  184. package/postprocessing/WaterPass.d.ts +3 -3
  185. package/renderers/CSS2DRenderer.d.ts +1 -1
  186. package/renderers/CSS3DRenderer.d.ts +1 -1
  187. package/renderers/Projector.d.ts +1 -1
  188. package/renderers/SVGRenderer.d.ts +1 -1
  189. package/shaders/ACESFilmicToneMappingShader.cjs +35 -35
  190. package/shaders/ACESFilmicToneMappingShader.cjs.map +1 -1
  191. package/shaders/ACESFilmicToneMappingShader.d.ts +1 -1
  192. package/shaders/ACESFilmicToneMappingShader.js +35 -35
  193. package/shaders/ACESFilmicToneMappingShader.js.map +1 -1
  194. package/shaders/AfterimageShader.d.ts +1 -1
  195. package/shaders/BasicShader.d.ts +1 -1
  196. package/shaders/BleachBypassShader.d.ts +1 -1
  197. package/shaders/BokehShader.d.ts +1 -1
  198. package/shaders/BokehShader2.d.ts +1 -1
  199. package/shaders/ColorCorrectionShader.d.ts +1 -1
  200. package/shaders/ColorifyShader.d.ts +1 -1
  201. package/shaders/ConvolutionShader.d.ts +2 -2
  202. package/shaders/CopyShader.d.ts +1 -1
  203. package/shaders/DepthLimitedBlurShader.d.ts +2 -2
  204. package/shaders/DotScreenShader.d.ts +1 -1
  205. package/shaders/FXAAShader.cjs +4 -4
  206. package/shaders/FXAAShader.cjs.map +1 -1
  207. package/shaders/FXAAShader.d.ts +1 -1
  208. package/shaders/FXAAShader.js +4 -4
  209. package/shaders/FXAAShader.js.map +1 -1
  210. package/shaders/FreiChenShader.d.ts +1 -1
  211. package/shaders/GammaCorrectionShader.d.ts +1 -1
  212. package/shaders/GodRaysShader.cjs +4 -4
  213. package/shaders/GodRaysShader.cjs.map +1 -1
  214. package/shaders/GodRaysShader.d.ts +1 -1
  215. package/shaders/GodRaysShader.js +4 -4
  216. package/shaders/GodRaysShader.js.map +1 -1
  217. package/shaders/HorizontalBlurShader.d.ts +1 -1
  218. package/shaders/LuminosityHighPassShader.d.ts +1 -1
  219. package/shaders/NormalMapShader.d.ts +1 -1
  220. package/shaders/ParallaxShader.cjs +1 -1
  221. package/shaders/ParallaxShader.cjs.map +1 -1
  222. package/shaders/ParallaxShader.js +1 -1
  223. package/shaders/ParallaxShader.js.map +1 -1
  224. package/shaders/SAOShader.d.ts +2 -2
  225. package/shaders/SMAAShader.d.ts +1 -1
  226. package/shaders/SSAOShader.d.ts +1 -1
  227. package/shaders/SSRShader.d.ts +1 -1
  228. package/shaders/SobelOperatorShader.d.ts +1 -1
  229. package/shaders/ToonShader.d.ts +1 -1
  230. package/shaders/TriangleBlurShader.d.ts +1 -1
  231. package/shaders/VerticalBlurShader.d.ts +1 -1
  232. package/shaders/VignetteShader.cjs +4 -4
  233. package/shaders/VignetteShader.cjs.map +1 -1
  234. package/shaders/VignetteShader.js +4 -4
  235. package/shaders/VignetteShader.js.map +1 -1
  236. package/shaders/VolumeShader.d.ts +1 -1
  237. package/textures/FlakesTexture.d.ts +1 -1
  238. package/types/shared.d.ts +1 -1
  239. package/utils/BufferGeometryUtils.d.ts +1 -1
  240. package/utils/GeometryCompressionUtils.d.ts +2 -2
  241. package/utils/GeometryUtils.d.ts +1 -1
  242. package/utils/LDrawUtils.d.ts +2 -2
  243. package/utils/RoughnessMipmapper.d.ts +1 -1
  244. package/utils/SceneUtils.d.ts +2 -2
  245. package/utils/ShadowMapViewer.d.ts +1 -1
  246. package/utils/SkeletonUtils.d.ts +2 -2
  247. package/utils/UVsDebug.d.ts +1 -1
  248. package/webxr/ARButton.d.ts +2 -2
  249. package/webxr/OculusHandModel.d.ts +3 -3
  250. package/webxr/OculusHandPointerModel.d.ts +1 -1
  251. package/webxr/Text2D.d.ts +1 -1
  252. package/webxr/VRButton.d.ts +2 -2
  253. package/webxr/XRControllerModelFactory.d.ts +4 -4
  254. package/webxr/XREstimatedLight.d.ts +1 -1
  255. package/webxr/XRHandMeshModel.d.ts +2 -2
  256. package/webxr/XRHandModelFactory.d.ts +3 -3
  257. package/webxr/XRHandPrimitiveModel.d.ts +2 -2
  258. package/_polyfill/constants.d.cts +0 -1
  259. package/_polyfill/uv1.d.cts +0 -5
  260. package/animation/AnimationClipCreator.d.cts +0 -12
  261. package/animation/CCDIKSolver.d.cts +0 -30
  262. package/animation/MMDAnimationHelper.d.cts +0 -93
  263. package/animation/MMDPhysics.d.cts +0 -119
  264. package/cameras/CinematicCamera.d.cts +0 -34
  265. package/controls/ArcballControls.d.cts +0 -376
  266. package/controls/DeviceOrientationControls.d.cts +0 -29
  267. package/controls/DragControls.d.cts +0 -67
  268. package/controls/EventDispatcher.d.cts +0 -41
  269. package/controls/FirstPersonControls.d.cts +0 -49
  270. package/controls/FlyControls.d.cts +0 -39
  271. package/controls/OrbitControls.d.cts +0 -74
  272. package/controls/PointerLockControls.d.cts +0 -39
  273. package/controls/StandardControlsEventMap.d.cts +0 -14
  274. package/controls/TrackballControls.d.cts +0 -97
  275. package/controls/TransformControls.d.cts +0 -151
  276. package/controls/experimental/CameraControls.d.cts +0 -213
  277. package/csm/CSM.d.cts +0 -61
  278. package/csm/CSMFrustum.d.cts +0 -19
  279. package/csm/CSMHelper.d.cts +0 -26
  280. package/csm/CSMShader.d.cts +0 -4
  281. package/curves/CurveExtras.d.cts +0 -68
  282. package/curves/NURBSCurve.d.cts +0 -11
  283. package/curves/NURBSSurface.d.cts +0 -13
  284. package/curves/NURBSUtils.d.cts +0 -20
  285. package/deprecated/Geometry.d.cts +0 -341
  286. package/effects/AnaglyphEffect.d.cts +0 -11
  287. package/effects/AsciiEffect.d.cts +0 -18
  288. package/effects/OutlineEffect.d.cts +0 -28
  289. package/effects/ParallaxBarrierEffect.d.cts +0 -8
  290. package/effects/PeppersGhostEffect.d.cts +0 -10
  291. package/effects/StereoEffect.d.cts +0 -9
  292. package/environments/RoomEnvironment.d.cts +0 -6
  293. package/exporters/ColladaExporter.d.cts +0 -50
  294. package/exporters/DRACOExporter.d.cts +0 -36
  295. package/exporters/GLTFExporter.d.cts +0 -114
  296. package/exporters/MMDExporter.d.cts +0 -12
  297. package/exporters/OBJExporter.d.cts +0 -18
  298. package/exporters/PLYExporter.d.cts +0 -23
  299. package/exporters/STLExporter.d.cts +0 -28
  300. package/exporters/USDZExporter.d.cts +0 -27
  301. package/geometries/BoxLineGeometry.d.cts +0 -12
  302. package/geometries/ConvexGeometry.d.cts +0 -5
  303. package/geometries/DecalGeometry.d.cts +0 -10
  304. package/geometries/LightningStrike.d.cts +0 -108
  305. package/geometries/ParametricGeometries.d.cts +0 -26
  306. package/geometries/ParametricGeometry.d.cts +0 -18
  307. package/geometries/RoundedBoxGeometry.d.cts +0 -5
  308. package/geometries/TeapotGeometry.d.cts +0 -13
  309. package/geometries/TextGeometry.d.cts +0 -18
  310. package/helpers/LightProbeHelper.d.cts +0 -10
  311. package/helpers/PositionalAudioHelper.d.cts +0 -13
  312. package/helpers/RaycasterHelper.d.cts +0 -33
  313. package/helpers/RectAreaLightHelper.d.cts +0 -11
  314. package/helpers/VertexNormalsHelper.d.cts +0 -13
  315. package/helpers/VertexTangentsHelper.d.cts +0 -13
  316. package/index.d.cts +0 -262
  317. package/interactive/HTMLMesh.d.cts +0 -6
  318. package/interactive/InteractiveGroup.d.cts +0 -5
  319. package/interactive/SelectionBox.d.cts +0 -15
  320. package/interactive/SelectionHelper.d.cts +0 -17
  321. package/libs/MeshoptDecoder.d.cts +0 -12
  322. package/libs/MotionControllers.d.cts +0 -176
  323. package/libs/zstddec.d.cts +0 -8
  324. package/lights/LightProbeGenerator.d.cts +0 -6
  325. package/lights/RectAreaLightUniformsLib.d.cts +0 -3
  326. package/lines/Line2.d.cts +0 -11
  327. package/lines/LineGeometry.d.cts +0 -10
  328. package/lines/LineMaterial.d.cts +0 -31
  329. package/lines/LineSegments2.d.cts +0 -14
  330. package/lines/LineSegmentsGeometry.d.cts +0 -16
  331. package/lines/Wireframe.d.cts +0 -11
  332. package/lines/WireframeGeometry2.d.cts +0 -8
  333. package/loaders/3DMLoader.d.cts +0 -17
  334. package/loaders/3MFLoader.d.cts +0 -16
  335. package/loaders/AMFLoader.d.cts +0 -14
  336. package/loaders/AssimpLoader.d.cts +0 -19
  337. package/loaders/BVHLoader.d.cts +0 -21
  338. package/loaders/BasisTextureLoader.d.cts +0 -32
  339. package/loaders/ColladaLoader.d.cts +0 -20
  340. package/loaders/DDSLoader.d.cts +0 -16
  341. package/loaders/DRACOLoader.d.cts +0 -18
  342. package/loaders/EXRLoader.d.cts +0 -18
  343. package/loaders/FBXLoader.d.cts +0 -14
  344. package/loaders/FontLoader.d.cts +0 -37
  345. package/loaders/GCodeLoader.d.cts +0 -15
  346. package/loaders/GLTFLoader.d.cts +0 -155
  347. package/loaders/HDRCubeTextureLoader.d.cts +0 -18
  348. package/loaders/KMZLoader.d.cts +0 -16
  349. package/loaders/KTX2Loader.d.cts +0 -10
  350. package/loaders/KTXLoader.d.cts +0 -16
  351. package/loaders/LDrawLoader.d.cts +0 -26
  352. package/loaders/LUT3dlLoader.d.cts +0 -20
  353. package/loaders/LUTCubeLoader.d.cts +0 -23
  354. package/loaders/LWOLoader.d.cts +0 -26
  355. package/loaders/LottieLoader.d.cts +0 -15
  356. package/loaders/MD2Loader.d.cts +0 -14
  357. package/loaders/MDDLoader.d.cts +0 -19
  358. package/loaders/MMDLoader.d.cts +0 -63
  359. package/loaders/MTLLoader.d.cts +0 -100
  360. package/loaders/NRRDLoader.d.cts +0 -22
  361. package/loaders/OBJLoader.d.cts +0 -17
  362. package/loaders/PCDLoader.d.cts +0 -15
  363. package/loaders/PDBLoader.d.cts +0 -22
  364. package/loaders/PLYLoader.d.cts +0 -16
  365. package/loaders/PRWMLoader.d.cts +0 -16
  366. package/loaders/PVRLoader.d.cts +0 -16
  367. package/loaders/RGBELoader.d.cts +0 -20
  368. package/loaders/RGBMLoader.d.cts +0 -32
  369. package/loaders/STLLoader.d.cts +0 -14
  370. package/loaders/SVGLoader.d.cts +0 -63
  371. package/loaders/TDSLoader.d.cts +0 -42
  372. package/loaders/TGALoader.d.cts +0 -14
  373. package/loaders/TTFLoader.d.cts +0 -15
  374. package/loaders/TiltLoader.d.cts +0 -14
  375. package/loaders/VOXLoader.d.cts +0 -29
  376. package/loaders/VRMLLoader.d.cts +0 -14
  377. package/loaders/VRMLoader.d.cts +0 -19
  378. package/loaders/VTKLoader.d.cts +0 -14
  379. package/loaders/XLoader.d.cts +0 -19
  380. package/loaders/XYZLoader.d.cts +0 -14
  381. package/math/Capsule.d.cts +0 -27
  382. package/math/ColorConverter.d.cts +0 -21
  383. package/math/ConvexHull.d.cts +0 -89
  384. package/math/ImprovedNoise.d.cts +0 -4
  385. package/math/Lut.d.cts +0 -27
  386. package/math/MeshSurfaceSampler.d.cts +0 -18
  387. package/math/OBB.d.cts +0 -24
  388. package/math/Octree.d.cts +0 -24
  389. package/math/SimplexNoise.d.cts +0 -21
  390. package/misc/ConvexObjectBreaker.d.cts +0 -25
  391. package/misc/GPUComputationRenderer.d.cts +0 -53
  392. package/misc/Gyroscope.d.cts +0 -5
  393. package/misc/MD2Character.d.cts +0 -33
  394. package/misc/MD2CharacterComplex.d.cts +0 -47
  395. package/misc/MorphAnimMesh.d.cts +0 -13
  396. package/misc/MorphBlendMesh.d.cts +0 -21
  397. package/misc/ProgressiveLightmap.d.cts +0 -60
  398. package/misc/RollerCoaster.d.cts +0 -21
  399. package/misc/Timer.d.cts +0 -27
  400. package/misc/TubePainter.d.cts +0 -10
  401. package/misc/Volume.d.cts +0 -37
  402. package/misc/VolumeSlice.d.cts +0 -28
  403. package/misc/WebGL.d.cts +0 -5
  404. package/modifiers/CurveModifier.d.cts +0 -91
  405. package/modifiers/EdgeSplitModifier.d.cts +0 -19
  406. package/modifiers/SimplifyModifier.d.cts +0 -19
  407. package/modifiers/TessellateModifier.d.cts +0 -11
  408. package/objects/BatchedMesh.d.cts +0 -48
  409. package/objects/GroundProjectedEnv.d.cts +0 -12
  410. package/objects/Lensflare.d.cts +0 -17
  411. package/objects/LightningStorm.d.cts +0 -32
  412. package/objects/MarchingCubes.d.cts +0 -76
  413. package/objects/Reflector.d.cts +0 -23
  414. package/objects/ReflectorForSSRPass.d.cts +0 -48
  415. package/objects/ReflectorRTT.d.cts +0 -6
  416. package/objects/Refractor.d.cts +0 -23
  417. package/objects/ShadowMesh.d.cts +0 -10
  418. package/objects/Sky.d.cts +0 -18
  419. package/objects/Water.d.cts +0 -22
  420. package/objects/Water2.d.cts +0 -23
  421. package/physics/AmmoPhysics.d.cts +0 -7
  422. package/postprocessing/AdaptiveToneMappingPass.d.cts +0 -29
  423. package/postprocessing/AfterimagePass.d.cts +0 -15
  424. package/postprocessing/BloomPass.d.cts +0 -29
  425. package/postprocessing/BokehPass.d.cts +0 -26
  426. package/postprocessing/ClearPass.d.cts +0 -10
  427. package/postprocessing/CubeTexturePass.d.cts +0 -14
  428. package/postprocessing/DotScreenPass.d.cts +0 -11
  429. package/postprocessing/EffectComposer.d.cts +0 -28
  430. package/postprocessing/FilmPass.d.cts +0 -11
  431. package/postprocessing/GlitchPass.d.cts +0 -16
  432. package/postprocessing/HalftonePass.d.cts +0 -26
  433. package/postprocessing/LUTPass.d.cts +0 -13
  434. package/postprocessing/MaskPass.d.cts +0 -14
  435. package/postprocessing/OutlinePass.d.cts +0 -53
  436. package/postprocessing/Pass.d.cts +0 -21
  437. package/postprocessing/RenderPass.d.cts +0 -14
  438. package/postprocessing/RenderPixelatedPass.d.cts +0 -34
  439. package/postprocessing/SAOPass.d.cts +0 -78
  440. package/postprocessing/SMAAPass.d.cts +0 -21
  441. package/postprocessing/SSAARenderPass.d.cts +0 -17
  442. package/postprocessing/SSAOPass.d.cts +0 -70
  443. package/postprocessing/SSRPass.d.cts +0 -123
  444. package/postprocessing/SavePass.d.cts +0 -12
  445. package/postprocessing/ShaderPass.d.cts +0 -13
  446. package/postprocessing/TAARenderPass.d.cts +0 -8
  447. package/postprocessing/TexturePass.d.cts +0 -12
  448. package/postprocessing/UnrealBloomPass.d.cts +0 -31
  449. package/postprocessing/WaterPass.d.cts +0 -35
  450. package/renderers/CSS2DRenderer.d.cts +0 -23
  451. package/renderers/CSS3DRenderer.d.cts +0 -26
  452. package/renderers/Projector.d.cts +0 -60
  453. package/renderers/SVGRenderer.d.cts +0 -25
  454. package/shaders/ACESFilmicToneMappingShader.d.cts +0 -16
  455. package/shaders/AfterimageShader.d.cts +0 -15
  456. package/shaders/BasicShader.d.cts +0 -8
  457. package/shaders/BleachBypassShader.d.cts +0 -14
  458. package/shaders/BlendShader.d.cts +0 -21
  459. package/shaders/BokehShader.d.cts +0 -24
  460. package/shaders/BokehShader2.d.cts +0 -50
  461. package/shaders/BrightnessContrastShader.d.cts +0 -21
  462. package/shaders/ColorCorrectionShader.d.cts +0 -22
  463. package/shaders/ColorifyShader.d.cts +0 -16
  464. package/shaders/ConvolutionShader.d.cts +0 -21
  465. package/shaders/CopyShader.d.cts +0 -12
  466. package/shaders/DOFMipMapShader.d.cts +0 -23
  467. package/shaders/DepthLimitedBlurShader.d.cts +0 -28
  468. package/shaders/DigitalGlitch.d.cts +0 -39
  469. package/shaders/DotScreenShader.d.cts +0 -27
  470. package/shaders/FXAAShader.d.cts +0 -19
  471. package/shaders/FilmShader.d.cts +0 -43
  472. package/shaders/FocusShader.d.cts +0 -26
  473. package/shaders/FreiChenShader.d.cts +0 -19
  474. package/shaders/FresnelShader.d.cts +0 -24
  475. package/shaders/GammaCorrectionShader.d.cts +0 -12
  476. package/shaders/GodRaysShader.d.cts +0 -97
  477. package/shaders/HalftoneShader.d.cts +0 -51
  478. package/shaders/HorizontalBlurShader.d.cts +0 -18
  479. package/shaders/HorizontalTiltShiftShader.d.cts +0 -23
  480. package/shaders/HueSaturationShader.d.cts +0 -21
  481. package/shaders/KaleidoShader.d.cts +0 -24
  482. package/shaders/LuminosityHighPassShader.d.cts +0 -27
  483. package/shaders/LuminosityShader.d.cts +0 -13
  484. package/shaders/MirrorShader.d.cts +0 -18
  485. package/shaders/NormalMapShader.d.cts +0 -23
  486. package/shaders/ParallaxShader.d.cts +0 -28
  487. package/shaders/PixelShader.d.cts +0 -18
  488. package/shaders/RGBShiftShader.d.cts +0 -24
  489. package/shaders/SAOShader.d.cts +0 -25
  490. package/shaders/SMAAShader.d.cts +0 -60
  491. package/shaders/SSAOShader.d.cts +0 -86
  492. package/shaders/SSRShader.d.cts +0 -94
  493. package/shaders/SepiaShader.d.cts +0 -17
  494. package/shaders/SobelOperatorShader.d.cts +0 -19
  495. package/shaders/SubsurfaceScatteringShader.d.cts +0 -5
  496. package/shaders/TechnicolorShader.d.cts +0 -15
  497. package/shaders/ToneMapShader.d.cts +0 -27
  498. package/shaders/ToonShader.d.cts +0 -108
  499. package/shaders/TriangleBlurShader.d.cts +0 -22
  500. package/shaders/UnpackDepthRGBAShader.d.cts +0 -16
  501. package/shaders/VerticalBlurShader.d.cts +0 -18
  502. package/shaders/VerticalTiltShiftShader.d.cts +0 -23
  503. package/shaders/VignetteShader.d.cts +0 -20
  504. package/shaders/VolumeShader.d.cts +0 -30
  505. package/shaders/WaterRefractionShader.d.cts +0 -21
  506. package/shaders/types.d.cts +0 -13
  507. package/textures/FlakesTexture.d.cts +0 -4
  508. package/types/helpers.d.cts +0 -1
  509. package/types/shared.d.cts +0 -9
  510. package/types/utils.d.cts +0 -3
  511. package/utils/BufferGeometryUtils.d.cts +0 -63
  512. package/utils/GeometryCompressionUtils.d.cts +0 -7
  513. package/utils/GeometryUtils.d.cts +0 -6
  514. package/utils/LDrawUtils.d.cts +0 -5
  515. package/utils/RoughnessMipmapper.d.cts +0 -8
  516. package/utils/SceneUtils.d.cts +0 -9
  517. package/utils/ShadowMapViewer.d.cts +0 -24
  518. package/utils/SkeletonUtils.d.cts +0 -14
  519. package/utils/UVsDebug.d.cts +0 -3
  520. package/webxr/ARButton.d.cts +0 -6
  521. package/webxr/OculusHandModel.d.cts +0 -23
  522. package/webxr/OculusHandPointerModel.d.cts +0 -65
  523. package/webxr/Text2D.d.cts +0 -3
  524. package/webxr/VRButton.d.cts +0 -11
  525. package/webxr/XRControllerModelFactory.d.cts +0 -23
  526. package/webxr/XREstimatedLight.d.cts +0 -33
  527. package/webxr/XRHandMeshModel.d.cts +0 -9
  528. package/webxr/XRHandModelFactory.d.cts +0 -25
  529. package/webxr/XRHandPrimitiveModel.d.cts +0 -24
@@ -1 +1 @@
1
- {"version":3,"file":"FXAAShader.js","sources":["../../src/shaders/FXAAShader.ts"],"sourcesContent":["import { Vector2 } from 'three'\n\n/**\n * NVIDIA FXAA by Timothy Lottes\n * http://timothylottes.blogspot.com/2011/06/fxaa3-source-released.html\n * - WebGL port by @supereggbert\n * http://www.glge.org/demos/fxaa/\n */\n\nexport const FXAAShader = {\n uniforms: {\n tDiffuse: { value: null },\n resolution: { value: /* @__PURE__ */ new Vector2(1 / 1024, 1 / 512) },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n precision highp float;\n \n uniform sampler2D tDiffuse;\n \n uniform vec2 resolution;\n \n varying vec2 vUv;\n \n // FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)\n \n //----------------------------------------------------------------------------------\n // File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag\n // SDK Version: v3.00\n // Email: gameworks@nvidia.com\n // Site: http://developer.nvidia.com/\n //\n // Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.\n //\n // Redistribution and use in source and binary forms, with or without\n // modification, are permitted provided that the following conditions\n // are met:\n // * Redistributions of source code must retain the above copyright\n // notice, this list of conditions and the following disclaimer.\n // * Redistributions in binary form must reproduce the above copyright\n // notice, this list of conditions and the following disclaimer in the\n // documentation and/or other materials provided with the distribution.\n // * Neither the name of NVIDIA CORPORATION nor the names of its\n // contributors may be used to endorse or promote products derived\n // from this software without specific prior written permission.\n //\n \"// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AS IS AND ANY\",\n // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n //\n //----------------------------------------------------------------------------------\n \n #define FXAA_PC 1\n #define FXAA_GLSL_100 1\n #define FXAA_QUALITY_PRESET 12\n \n #define FXAA_GREEN_AS_LUMA 1\n \n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_PC_CONSOLE\n //\n // The console algorithm for PC is included\n // for developers targeting really low spec machines.\n // Likely better to just run FXAA_PC, and use a really low preset.\n //\n #define FXAA_PC_CONSOLE 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GLSL_120\n #define FXAA_GLSL_120 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GLSL_130\n #define FXAA_GLSL_130 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_3\n #define FXAA_HLSL_3 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_4\n #define FXAA_HLSL_4 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_5\n #define FXAA_HLSL_5 0\n #endif\n /*==========================================================================*/\n #ifndef FXAA_GREEN_AS_LUMA\n //\n // For those using non-linear color,\n // and either not able to get luma in alpha, or not wanting to,\n // this enables FXAA to run using green as a proxy for luma.\n // So with this enabled, no need to pack luma in alpha.\n //\n // This will turn off AA on anything which lacks some amount of green.\n // Pure red and blue or combination of only R and B, will get no AA.\n //\n // Might want to lower the settings for both,\n // fxaaConsoleEdgeThresholdMin\n // fxaaQualityEdgeThresholdMin\n // In order to insure AA does not get turned off on colors\n // which contain a minor amount of green.\n //\n // 1 = On.\n // 0 = Off.\n //\n #define FXAA_GREEN_AS_LUMA 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_EARLY_EXIT\n //\n \" // Controls algorithms early exit path.\",\n // On PS3 turning this ON adds 2 cycles to the shader.\n // On 360 turning this OFF adds 10ths of a millisecond to the shader.\n // Turning this off on console will result in a more blurry image.\n // So this defaults to on.\n //\n // 1 = On.\n // 0 = Off.\n //\n #define FXAA_EARLY_EXIT 1\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_DISCARD\n //\n // Only valid for PC OpenGL currently.\n // Probably will not work when FXAA_GREEN_AS_LUMA = 1.\n //\n \" // 1 = Use discard on pixels which dont need AA.\",\n // For APIs which enable concurrent TEX+ROP from same surface.\n \" // 0 = Return unchanged color on pixels which dont need AA.\",\n //\n #define FXAA_DISCARD 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_FAST_PIXEL_OFFSET\n //\n // Used for GLSL 120 only.\n //\n // 1 = GL API supports fast pixel offsets\n // 0 = do not use fast pixel offsets\n //\n #ifdef GL_EXT_gpu_shader4\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifdef GL_NV_gpu_shader5\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifdef GL_ARB_gpu_shader5\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifndef FXAA_FAST_PIXEL_OFFSET\n #define FXAA_FAST_PIXEL_OFFSET 0\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GATHER4_ALPHA\n //\n // 1 = API supports gather4 on alpha channel.\n // 0 = API does not support gather4 on alpha channel.\n //\n #if (FXAA_HLSL_5 == 1)\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifdef GL_ARB_gpu_shader5\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifdef GL_NV_gpu_shader5\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifndef FXAA_GATHER4_ALPHA\n #define FXAA_GATHER4_ALPHA 0\n #endif\n #endif\n \n \n /*============================================================================\n FXAA QUALITY - TUNING KNOBS\n ------------------------------------------------------------------------------\n NOTE the other tuning knobs are now in the shader function inputs!\n ============================================================================*/\n #ifndef FXAA_QUALITY_PRESET\n //\n // Choose the quality preset.\n // This needs to be compiled into the shader as it effects code.\n // Best option to include multiple presets is to\n // in each shader define the preset, then include this file.\n //\n // OPTIONS\n // -----------------------------------------------------------------------\n // 10 to 15 - default medium dither (10=fastest, 15=highest quality)\n // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)\n // 39 - no dither, very expensive\n //\n // NOTES\n // -----------------------------------------------------------------------\n // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)\n // 13 = about same speed as FXAA 3.9 and better than 12\n // 23 = closest to FXAA 3.9 visually and performance wise\n // _ = the lowest digit is directly related to performance\n // _ = the highest digit is directly related to style\n //\n #define FXAA_QUALITY_PRESET 12\n #endif\n \n \n /*============================================================================\n \n FXAA QUALITY - PRESETS\n \n ============================================================================*/\n \n /*============================================================================\n FXAA QUALITY - MEDIUM DITHER PRESETS\n ============================================================================*/\n #if (FXAA_QUALITY_PRESET == 10)\n #define FXAA_QUALITY_PS 3\n #define FXAA_QUALITY_P0 1.5\n #define FXAA_QUALITY_P1 3.0\n #define FXAA_QUALITY_P2 12.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 11)\n #define FXAA_QUALITY_PS 4\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 3.0\n #define FXAA_QUALITY_P3 12.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 12)\n #define FXAA_QUALITY_PS 5\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 4.0\n #define FXAA_QUALITY_P4 12.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 13)\n #define FXAA_QUALITY_PS 6\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 4.0\n #define FXAA_QUALITY_P5 12.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 14)\n #define FXAA_QUALITY_PS 7\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 4.0\n #define FXAA_QUALITY_P6 12.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 15)\n #define FXAA_QUALITY_PS 8\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 4.0\n #define FXAA_QUALITY_P7 12.0\n #endif\n \n /*============================================================================\n FXAA QUALITY - LOW DITHER PRESETS\n ============================================================================*/\n #if (FXAA_QUALITY_PRESET == 20)\n #define FXAA_QUALITY_PS 3\n #define FXAA_QUALITY_P0 1.5\n #define FXAA_QUALITY_P1 2.0\n #define FXAA_QUALITY_P2 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 21)\n #define FXAA_QUALITY_PS 4\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 22)\n #define FXAA_QUALITY_PS 5\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 23)\n #define FXAA_QUALITY_PS 6\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 24)\n #define FXAA_QUALITY_PS 7\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 3.0\n #define FXAA_QUALITY_P6 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 25)\n #define FXAA_QUALITY_PS 8\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 4.0\n #define FXAA_QUALITY_P7 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 26)\n #define FXAA_QUALITY_PS 9\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 2.0\n #define FXAA_QUALITY_P7 4.0\n #define FXAA_QUALITY_P8 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 27)\n #define FXAA_QUALITY_PS 10\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 2.0\n #define FXAA_QUALITY_P7 2.0\n #define FXAA_QUALITY_P8 4.0\n #define FXAA_QUALITY_P9 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 28)\n #define FXAA_QUALITY_PS 11\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 2.0\n #define FXAA_QUALITY_P7 2.0\n #define FXAA_QUALITY_P8 2.0\n #define FXAA_QUALITY_P9 4.0\n #define FXAA_QUALITY_P10 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 29)\n #define FXAA_QUALITY_PS 12\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 2.0\n #define FXAA_QUALITY_P7 2.0\n #define FXAA_QUALITY_P8 2.0\n #define FXAA_QUALITY_P9 2.0\n #define FXAA_QUALITY_P10 4.0\n #define FXAA_QUALITY_P11 8.0\n #endif\n \n /*============================================================================\n FXAA QUALITY - EXTREME QUALITY\n ============================================================================*/\n #if (FXAA_QUALITY_PRESET == 39)\n #define FXAA_QUALITY_PS 12\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.0\n #define FXAA_QUALITY_P2 1.0\n #define FXAA_QUALITY_P3 1.0\n #define FXAA_QUALITY_P4 1.0\n #define FXAA_QUALITY_P5 1.5\n #define FXAA_QUALITY_P6 2.0\n #define FXAA_QUALITY_P7 2.0\n #define FXAA_QUALITY_P8 2.0\n #define FXAA_QUALITY_P9 2.0\n #define FXAA_QUALITY_P10 4.0\n #define FXAA_QUALITY_P11 8.0\n #endif\n \n \n \n /*============================================================================\n \n API PORTING\n \n ============================================================================*/\n #if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)\n #define FxaaBool bool\n #define FxaaDiscard discard\n #define FxaaFloat float\n #define FxaaFloat2 vec2\n #define FxaaFloat3 vec3\n #define FxaaFloat4 vec4\n #define FxaaHalf float\n #define FxaaHalf2 vec2\n #define FxaaHalf3 vec3\n #define FxaaHalf4 vec4\n #define FxaaInt2 ivec2\n #define FxaaSat(x) clamp(x, 0.0, 1.0)\n #define FxaaTex sampler2D\n #else\n #define FxaaBool bool\n #define FxaaDiscard clip(-1)\n #define FxaaFloat float\n #define FxaaFloat2 float2\n #define FxaaFloat3 float3\n #define FxaaFloat4 float4\n #define FxaaHalf half\n #define FxaaHalf2 half2\n #define FxaaHalf3 half3\n #define FxaaHalf4 half4\n #define FxaaSat(x) saturate(x)\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_GLSL_100 == 1)\n #define FxaaTexTop(t, p) texture2D(t, p, 0.0)\n #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_GLSL_120 == 1)\n // Requires,\n // #version 120\n // And at least,\n // #extension GL_EXT_gpu_shader4 : enable\n // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)\n #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)\n #if (FXAA_FAST_PIXEL_OFFSET == 1)\n #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)\n #else\n #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)\n #endif\n #if (FXAA_GATHER4_ALPHA == 1)\n // use #extension GL_ARB_gpu_shader5 : enable\n #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)\n #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)\n #define FxaaTexGreen4(t, p) textureGather(t, p, 1)\n #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_GLSL_130 == 1)\n // Requires \"#version 130\" or better\n #define FxaaTexTop(t, p) textureLod(t, p, 0.0)\n #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)\n #if (FXAA_GATHER4_ALPHA == 1)\n // use #extension GL_ARB_gpu_shader5 : enable\n #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)\n #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)\n #define FxaaTexGreen4(t, p) textureGather(t, p, 1)\n #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_HLSL_3 == 1)\n #define FxaaInt2 float2\n #define FxaaTex sampler2D\n #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))\n #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_HLSL_4 == 1)\n #define FxaaInt2 int2\n struct FxaaTex { SamplerState smpl; Texture2D tex; };\n #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)\n #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_HLSL_5 == 1)\n #define FxaaInt2 int2\n struct FxaaTex { SamplerState smpl; Texture2D tex; };\n #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)\n #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)\n #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)\n #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)\n #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)\n #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)\n #endif\n \n \n /*============================================================================\n GREEN AS LUMA OPTION SUPPORT FUNCTION\n ============================================================================*/\n #if (FXAA_GREEN_AS_LUMA == 0)\n FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }\n #else\n FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\n #endif\n \n \n \n \n /*============================================================================\n \n FXAA3 QUALITY - PC\n \n ============================================================================*/\n #if (FXAA_PC == 1)\n /*--------------------------------------------------------------------------*/\n FxaaFloat4 FxaaPixelShader(\n //\n // Use noperspective interpolation here (turn off perspective interpolation).\n // {xy} = center of pixel\n FxaaFloat2 pos,\n //\n // Used only for FXAA Console, and not used on the 360 version.\n // Use noperspective interpolation here (turn off perspective interpolation).\n // {xy_} = upper left of pixel\n // {_zw} = lower right of pixel\n FxaaFloat4 fxaaConsolePosPos,\n //\n // Input color texture.\n // {rgb_} = color in linear or perceptual color space\n // if (FXAA_GREEN_AS_LUMA == 0)\n // {__a} = luma in perceptual color space (not linear)\n FxaaTex tex,\n //\n // Only used on the optimized 360 version of FXAA Console.\n // For everything but 360, just use the same input here as for \"tex\".\n // For 360, same texture, just alias with a 2nd sampler.\n // This sampler needs to have an exponent bias of -1.\n FxaaTex fxaaConsole360TexExpBiasNegOne,\n //\n // Only used on the optimized 360 version of FXAA Console.\n // For everything but 360, just use the same input here as for \"tex\".\n // For 360, same texture, just alias with a 3nd sampler.\n // This sampler needs to have an exponent bias of -2.\n FxaaTex fxaaConsole360TexExpBiasNegTwo,\n //\n // Only used on FXAA Quality.\n // This must be from a constant/uniform.\n // {x_} = 1.0/screenWidthInPixels\n // {_y} = 1.0/screenHeightInPixels\n FxaaFloat2 fxaaQualityRcpFrame,\n //\n // Only used on FXAA Console.\n // This must be from a constant/uniform.\n // This effects sub-pixel AA quality and inversely sharpness.\n // Where N ranges between,\n // N = 0.50 (default)\n // N = 0.33 (sharper)\n // {x__} = -N/screenWidthInPixels\n // {_y_} = -N/screenHeightInPixels\n // {_z_} = N/screenWidthInPixels\n // {__w} = N/screenHeightInPixels\n FxaaFloat4 fxaaConsoleRcpFrameOpt,\n //\n // Only used on FXAA Console.\n // Not used on 360, but used on PS3 and PC.\n // This must be from a constant/uniform.\n // {x__} = -2.0/screenWidthInPixels\n // {_y_} = -2.0/screenHeightInPixels\n // {_z_} = 2.0/screenWidthInPixels\n // {__w} = 2.0/screenHeightInPixels\n FxaaFloat4 fxaaConsoleRcpFrameOpt2,\n //\n // Only used on FXAA Console.\n // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.\n // This must be from a constant/uniform.\n // {x__} = 8.0/screenWidthInPixels\n // {_y_} = 8.0/screenHeightInPixels\n // {_z_} = -4.0/screenWidthInPixels\n // {__w} = -4.0/screenHeightInPixels\n FxaaFloat4 fxaaConsole360RcpFrameOpt2,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITY_SUBPIX define.\n // It is here now to allow easier tuning.\n // Choose the amount of sub-pixel aliasing removal.\n // This can effect sharpness.\n // 1.00 - upper limit (softer)\n // 0.75 - default amount of filtering\n // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)\n // 0.25 - almost off\n // 0.00 - completely off\n FxaaFloat fxaaQualitySubpix,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.\n // It is here now to allow easier tuning.\n // The minimum amount of local contrast required to apply algorithm.\n // 0.333 - too little (faster)\n // 0.250 - low quality\n // 0.166 - default\n // 0.125 - high quality\n // 0.063 - overkill (slower)\n FxaaFloat fxaaQualityEdgeThreshold,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.\n // It is here now to allow easier tuning.\n // Trims the algorithm from processing darks.\n // 0.0833 - upper limit (default, the start of visible unfiltered edges)\n // 0.0625 - high quality (faster)\n // 0.0312 - visible limit (slower)\n // Special notes when using FXAA_GREEN_AS_LUMA,\n // Likely want to set this to zero.\n // As colors that are mostly not-green\n // will appear very dark in the green channel!\n // Tune by looking at mostly non-green content,\n // then start at zero and increase until aliasing is a problem.\n FxaaFloat fxaaQualityEdgeThresholdMin,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define.\n // It is here now to allow easier tuning.\n // This does not effect PS3, as this needs to be compiled in.\n // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3.\n // Due to the PS3 being ALU bound,\n // there are only three safe values here: 2 and 4 and 8.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n // For all other platforms can be a non-power of two.\n // 8.0 is sharper (default!!!)\n // 4.0 is softer\n // 2.0 is really soft (good only for vector graphics inputs)\n FxaaFloat fxaaConsoleEdgeSharpness,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define.\n // It is here now to allow easier tuning.\n // This does not effect PS3, as this needs to be compiled in.\n // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3.\n // Due to the PS3 being ALU bound,\n // there are only two safe values here: 1/4 and 1/8.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n // The console setting has a different mapping than the quality setting.\n // Other platforms can use other values.\n // 0.125 leaves less aliasing, but is softer (default!!!)\n // 0.25 leaves more aliasing, and is sharper\n FxaaFloat fxaaConsoleEdgeThreshold,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define.\n // It is here now to allow easier tuning.\n // Trims the algorithm from processing darks.\n // The console setting has a different mapping than the quality setting.\n // This only applies when FXAA_EARLY_EXIT is 1.\n // This does not apply to PS3,\n // PS3 was simplified to avoid more shader instructions.\n // 0.06 - faster but more aliasing in darks\n // 0.05 - default\n // 0.04 - slower and less aliasing in darks\n // Special notes when using FXAA_GREEN_AS_LUMA,\n // Likely want to set this to zero.\n // As colors that are mostly not-green\n // will appear very dark in the green channel!\n // Tune by looking at mostly non-green content,\n // then start at zero and increase until aliasing is a problem.\n FxaaFloat fxaaConsoleEdgeThresholdMin,\n //\n // Extra constants for 360 FXAA Console only.\n // Use zeros or anything else for other platforms.\n // These must be in physical constant registers and NOT immediates.\n // Immediates will result in compiler un-optimizing.\n // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)\n FxaaFloat4 fxaaConsole360ConstDir\n ) {\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posM;\n posM.x = pos.x;\n posM.y = pos.y;\n #if (FXAA_GATHER4_ALPHA == 1)\n #if (FXAA_DISCARD == 0)\n FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n #if (FXAA_GREEN_AS_LUMA == 0)\n #define lumaM rgbyM.w\n #else\n #define lumaM rgbyM.y\n #endif\n #endif\n #if (FXAA_GREEN_AS_LUMA == 0)\n FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);\n FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));\n #else\n FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);\n FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));\n #endif\n #if (FXAA_DISCARD == 1)\n #define lumaM luma4A.w\n #endif\n #define lumaE luma4A.z\n #define lumaS luma4A.x\n #define lumaSE luma4A.y\n #define lumaNW luma4B.w\n #define lumaN luma4B.z\n #define lumaW luma4B.x\n #else\n FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n #if (FXAA_GREEN_AS_LUMA == 0)\n #define lumaM rgbyM.w\n #else\n #define lumaM rgbyM.y\n #endif\n #if (FXAA_GLSL_100 == 1)\n FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));\n #else\n FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n FxaaFloat maxSM = max(lumaS, lumaM);\n FxaaFloat minSM = min(lumaS, lumaM);\n FxaaFloat maxESM = max(lumaE, maxSM);\n FxaaFloat minESM = min(lumaE, minSM);\n FxaaFloat maxWN = max(lumaN, lumaW);\n FxaaFloat minWN = min(lumaN, lumaW);\n FxaaFloat rangeMax = max(maxWN, maxESM);\n FxaaFloat rangeMin = min(minWN, minESM);\n FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\n FxaaFloat range = rangeMax - rangeMin;\n FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\n FxaaBool earlyExit = range < rangeMaxClamped;\n /*--------------------------------------------------------------------------*/\n if(earlyExit)\n #if (FXAA_DISCARD == 1)\n FxaaDiscard;\n #else\n return rgbyM;\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_GATHER4_ALPHA == 0)\n #if (FXAA_GLSL_100 == 1)\n FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));\n #else\n FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\n #endif\n #else\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\n #endif\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNS = lumaN + lumaS;\n FxaaFloat lumaWE = lumaW + lumaE;\n FxaaFloat subpixRcpRange = 1.0/range;\n FxaaFloat subpixNSWE = lumaNS + lumaWE;\n FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\n FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNESE = lumaNE + lumaSE;\n FxaaFloat lumaNWNE = lumaNW + lumaNE;\n FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\n FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNWSW = lumaNW + lumaSW;\n FxaaFloat lumaSWSE = lumaSW + lumaSE;\n FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\n FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\n FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\n FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\n FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\n FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\n /*--------------------------------------------------------------------------*/\n FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\n FxaaFloat lengthSign = fxaaQualityRcpFrame.x;\n FxaaBool horzSpan = edgeHorz >= edgeVert;\n FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\n /*--------------------------------------------------------------------------*/\n if(!horzSpan) lumaN = lumaW;\n if(!horzSpan) lumaS = lumaE;\n if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;\n FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;\n /*--------------------------------------------------------------------------*/\n FxaaFloat gradientN = lumaN - lumaM;\n FxaaFloat gradientS = lumaS - lumaM;\n FxaaFloat lumaNN = lumaN + lumaM;\n FxaaFloat lumaSS = lumaS + lumaM;\n FxaaBool pairN = abs(gradientN) >= abs(gradientS);\n FxaaFloat gradient = max(abs(gradientN), abs(gradientS));\n if(pairN) lengthSign = -lengthSign;\n FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posB;\n posB.x = posM.x;\n posB.y = posM.y;\n FxaaFloat2 offNP;\n offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\n offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\n if(!horzSpan) posB.x += lengthSign * 0.5;\n if( horzSpan) posB.y += lengthSign * 0.5;\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posN;\n posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\n posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\n FxaaFloat2 posP;\n posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\n posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\n FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\n FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\n FxaaFloat subpixE = subpixC * subpixC;\n FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\n /*--------------------------------------------------------------------------*/\n if(!pairN) lumaNN = lumaSS;\n FxaaFloat gradientScaled = gradient * 1.0/4.0;\n FxaaFloat lumaMM = lumaM - lumaNN * 0.5;\n FxaaFloat subpixF = subpixD * subpixE;\n FxaaBool lumaMLTZero = lumaMM < 0.0;\n /*--------------------------------------------------------------------------*/\n lumaEndN -= lumaNN * 0.5;\n lumaEndP -= lumaNN * 0.5;\n FxaaBool doneN = abs(lumaEndN) >= gradientScaled;\n FxaaBool doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\n FxaaBool doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\n /*--------------------------------------------------------------------------*/\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 3)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 4)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 5)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 6)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 7)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 8)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 9)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 10)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 11)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 12)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n /*--------------------------------------------------------------------------*/\n FxaaFloat dstN = posM.x - posN.x;\n FxaaFloat dstP = posP.x - posM.x;\n if(!horzSpan) dstN = posM.y - posN.y;\n if(!horzSpan) dstP = posP.y - posM.y;\n /*--------------------------------------------------------------------------*/\n FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\n FxaaFloat spanLength = (dstP + dstN);\n FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\n FxaaFloat spanLengthRcp = 1.0/spanLength;\n /*--------------------------------------------------------------------------*/\n FxaaBool directionN = dstN < dstP;\n FxaaFloat dst = min(dstN, dstP);\n FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\n FxaaFloat subpixG = subpixF * subpixF;\n FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\n FxaaFloat subpixH = subpixG * fxaaQualitySubpix;\n /*--------------------------------------------------------------------------*/\n FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\n FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\n if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\n if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\n #if (FXAA_DISCARD == 1)\n return FxaaTexTop(tex, posM);\n #else\n return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\n #endif\n }\n /*==========================================================================*/\n #endif\n \n void main() {\n gl_FragColor = FxaaPixelShader(\n vUv,\n vec4(0.0),\n tDiffuse,\n tDiffuse,\n tDiffuse,\n resolution,\n vec4(0.0),\n vec4(0.0),\n vec4(0.0),\n 0.75,\n 0.166,\n 0.0833,\n 0.0,\n 0.0,\n 0.0,\n vec4(0.0)\n );\n \n // TODO avoid querying texture twice for same texel\n gl_FragColor.a = texture2D(tDiffuse, vUv).a;\n }\n `,\n}\n"],"names":[],"mappings":";AASO,MAAM,aAAa;AAAA,EACxB,UAAU;AAAA,IACR,UAAU,EAAE,OAAO,KAAK;AAAA,IACxB,YAAY,EAAE,OAAuB,oBAAI,QAAQ,IAAI,MAAM,IAAI,GAAG,EAAE;AAAA,EACtE;AAAA,EAEA;AAAA;AAAA,IAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWzB;AAAA;AAAA,IAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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"sourcesContent":["import { Vector2 } from 'three'\n\n/**\n * NVIDIA FXAA by Timothy Lottes\n * http://timothylottes.blogspot.com/2011/06/fxaa3-source-released.html\n * - WebGL port by @supereggbert\n * http://www.glge.org/demos/fxaa/\n */\n\nexport const FXAAShader = {\n uniforms: {\n tDiffuse: { value: null },\n resolution: { value: /* @__PURE__ */ new Vector2(1 / 1024, 1 / 512) },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n precision highp float;\n \n uniform sampler2D tDiffuse;\n \n uniform vec2 resolution;\n \n varying vec2 vUv;\n \n // FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)\n \n //----------------------------------------------------------------------------------\n // File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag\n // SDK Version: v3.00\n // Email: gameworks@nvidia.com\n // Site: http://developer.nvidia.com/\n //\n // Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.\n //\n // Redistribution and use in source and binary forms, with or without\n // modification, are permitted provided that the following conditions\n // are met:\n // * Redistributions of source code must retain the above copyright\n // notice, this list of conditions and the following disclaimer.\n // * Redistributions in binary form must reproduce the above copyright\n // notice, this list of conditions and the following disclaimer in the\n // documentation and/or other materials provided with the distribution.\n // * Neither the name of NVIDIA CORPORATION nor the names of its\n // contributors may be used to endorse or promote products derived\n // from this software without specific prior written permission.\n //\n // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AS IS AND ANY\n // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n //\n //----------------------------------------------------------------------------------\n \n #define FXAA_PC 1\n #define FXAA_GLSL_100 1\n #define FXAA_QUALITY_PRESET 12\n \n #define FXAA_GREEN_AS_LUMA 1\n \n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_PC_CONSOLE\n //\n // The console algorithm for PC is included\n // for developers targeting really low spec machines.\n // Likely better to just run FXAA_PC, and use a really low preset.\n //\n #define FXAA_PC_CONSOLE 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GLSL_120\n #define FXAA_GLSL_120 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GLSL_130\n #define FXAA_GLSL_130 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_3\n #define FXAA_HLSL_3 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_4\n #define FXAA_HLSL_4 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_5\n #define FXAA_HLSL_5 0\n #endif\n /*==========================================================================*/\n #ifndef FXAA_GREEN_AS_LUMA\n //\n // For those using non-linear color,\n // and either not able to get luma in alpha, or not wanting to,\n // this enables FXAA to run using green as a proxy for luma.\n // So with this enabled, no need to pack luma in alpha.\n //\n // This will turn off AA on anything which lacks some amount of green.\n // Pure red and blue or combination of only R and B, will get no AA.\n //\n // Might want to lower the settings for both,\n // fxaaConsoleEdgeThresholdMin\n // fxaaQualityEdgeThresholdMin\n // In order to insure AA does not get turned off on colors\n // which contain a minor amount of green.\n //\n // 1 = On.\n // 0 = Off.\n //\n #define FXAA_GREEN_AS_LUMA 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_EARLY_EXIT\n //\n // Controls algorithms early exit path.\n // On PS3 turning this ON adds 2 cycles to the shader.\n // On 360 turning this OFF adds 10ths of a millisecond to the shader.\n // Turning this off on console will result in a more blurry image.\n // So this defaults to on.\n //\n // 1 = On.\n // 0 = Off.\n //\n #define FXAA_EARLY_EXIT 1\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_DISCARD\n //\n // Only valid for PC OpenGL currently.\n // Probably will not work when FXAA_GREEN_AS_LUMA = 1.\n //\n // 1 = Use discard on pixels which dont need AA.\n // For APIs which enable concurrent TEX+ROP from same surface.\n // 0 = Return unchanged color on pixels which dont need AA.\n //\n #define FXAA_DISCARD 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_FAST_PIXEL_OFFSET\n //\n // Used for GLSL 120 only.\n //\n // 1 = GL API supports fast pixel offsets\n // 0 = do not use fast pixel offsets\n //\n #ifdef GL_EXT_gpu_shader4\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifdef GL_NV_gpu_shader5\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifdef GL_ARB_gpu_shader5\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifndef FXAA_FAST_PIXEL_OFFSET\n #define FXAA_FAST_PIXEL_OFFSET 0\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GATHER4_ALPHA\n //\n // 1 = API supports gather4 on alpha channel.\n // 0 = API does not support gather4 on alpha channel.\n //\n #if (FXAA_HLSL_5 == 1)\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifdef GL_ARB_gpu_shader5\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifdef GL_NV_gpu_shader5\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifndef FXAA_GATHER4_ALPHA\n #define FXAA_GATHER4_ALPHA 0\n #endif\n #endif\n \n \n /*============================================================================\n FXAA QUALITY - TUNING KNOBS\n ------------------------------------------------------------------------------\n NOTE the other tuning knobs are now in the shader function inputs!\n ============================================================================*/\n #ifndef FXAA_QUALITY_PRESET\n //\n // Choose the quality preset.\n // This needs to be compiled into the shader as it effects code.\n // Best option to include multiple presets is to\n // in each shader define the preset, then include this file.\n //\n // OPTIONS\n // -----------------------------------------------------------------------\n // 10 to 15 - default medium dither (10=fastest, 15=highest quality)\n // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)\n // 39 - no dither, very expensive\n //\n // NOTES\n // -----------------------------------------------------------------------\n // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)\n // 13 = about same speed as FXAA 3.9 and better than 12\n // 23 = closest to FXAA 3.9 visually and performance wise\n // _ = the lowest digit is directly related to performance\n // _ = the highest digit is directly related to style\n //\n #define FXAA_QUALITY_PRESET 12\n #endif\n \n \n /*============================================================================\n \n FXAA QUALITY - PRESETS\n \n ============================================================================*/\n \n /*============================================================================\n FXAA QUALITY - MEDIUM DITHER PRESETS\n ============================================================================*/\n #if (FXAA_QUALITY_PRESET == 10)\n #define FXAA_QUALITY_PS 3\n #define FXAA_QUALITY_P0 1.5\n #define FXAA_QUALITY_P1 3.0\n #define FXAA_QUALITY_P2 12.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 11)\n #define FXAA_QUALITY_PS 4\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 3.0\n #define FXAA_QUALITY_P3 12.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 12)\n #define FXAA_QUALITY_PS 5\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 4.0\n #define FXAA_QUALITY_P4 12.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 13)\n #define FXAA_QUALITY_PS 6\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 4.0\n #define FXAA_QUALITY_P5 12.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 14)\n #define FXAA_QUALITY_PS 7\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 4.0\n #define FXAA_QUALITY_P6 12.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 15)\n #define FXAA_QUALITY_PS 8\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 4.0\n #define FXAA_QUALITY_P7 12.0\n #endif\n \n /*============================================================================\n FXAA QUALITY - LOW DITHER PRESETS\n ============================================================================*/\n #if (FXAA_QUALITY_PRESET == 20)\n #define FXAA_QUALITY_PS 3\n #define FXAA_QUALITY_P0 1.5\n #define FXAA_QUALITY_P1 2.0\n #define FXAA_QUALITY_P2 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 21)\n #define FXAA_QUALITY_PS 4\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 22)\n #define FXAA_QUALITY_PS 5\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 23)\n #define FXAA_QUALITY_PS 6\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 24)\n #define FXAA_QUALITY_PS 7\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 3.0\n #define FXAA_QUALITY_P6 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 25)\n #define FXAA_QUALITY_PS 8\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 4.0\n #define FXAA_QUALITY_P7 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 26)\n #define FXAA_QUALITY_PS 9\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 2.0\n #define FXAA_QUALITY_P7 4.0\n #define FXAA_QUALITY_P8 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 27)\n #define FXAA_QUALITY_PS 10\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 2.0\n #define FXAA_QUALITY_P7 2.0\n #define FXAA_QUALITY_P8 4.0\n #define FXAA_QUALITY_P9 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 28)\n #define FXAA_QUALITY_PS 11\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 2.0\n #define FXAA_QUALITY_P7 2.0\n #define FXAA_QUALITY_P8 2.0\n #define FXAA_QUALITY_P9 4.0\n #define FXAA_QUALITY_P10 8.0\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PRESET == 29)\n #define FXAA_QUALITY_PS 12\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 2.0\n #define FXAA_QUALITY_P7 2.0\n #define FXAA_QUALITY_P8 2.0\n #define FXAA_QUALITY_P9 2.0\n #define FXAA_QUALITY_P10 4.0\n #define FXAA_QUALITY_P11 8.0\n #endif\n \n /*============================================================================\n FXAA QUALITY - EXTREME QUALITY\n ============================================================================*/\n #if (FXAA_QUALITY_PRESET == 39)\n #define FXAA_QUALITY_PS 12\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.0\n #define FXAA_QUALITY_P2 1.0\n #define FXAA_QUALITY_P3 1.0\n #define FXAA_QUALITY_P4 1.0\n #define FXAA_QUALITY_P5 1.5\n #define FXAA_QUALITY_P6 2.0\n #define FXAA_QUALITY_P7 2.0\n #define FXAA_QUALITY_P8 2.0\n #define FXAA_QUALITY_P9 2.0\n #define FXAA_QUALITY_P10 4.0\n #define FXAA_QUALITY_P11 8.0\n #endif\n \n \n \n /*============================================================================\n \n API PORTING\n \n ============================================================================*/\n #if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)\n #define FxaaBool bool\n #define FxaaDiscard discard\n #define FxaaFloat float\n #define FxaaFloat2 vec2\n #define FxaaFloat3 vec3\n #define FxaaFloat4 vec4\n #define FxaaHalf float\n #define FxaaHalf2 vec2\n #define FxaaHalf3 vec3\n #define FxaaHalf4 vec4\n #define FxaaInt2 ivec2\n #define FxaaSat(x) clamp(x, 0.0, 1.0)\n #define FxaaTex sampler2D\n #else\n #define FxaaBool bool\n #define FxaaDiscard clip(-1)\n #define FxaaFloat float\n #define FxaaFloat2 float2\n #define FxaaFloat3 float3\n #define FxaaFloat4 float4\n #define FxaaHalf half\n #define FxaaHalf2 half2\n #define FxaaHalf3 half3\n #define FxaaHalf4 half4\n #define FxaaSat(x) saturate(x)\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_GLSL_100 == 1)\n #define FxaaTexTop(t, p) texture2D(t, p, 0.0)\n #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_GLSL_120 == 1)\n // Requires,\n // #version 120\n // And at least,\n // #extension GL_EXT_gpu_shader4 : enable\n // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)\n #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)\n #if (FXAA_FAST_PIXEL_OFFSET == 1)\n #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)\n #else\n #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)\n #endif\n #if (FXAA_GATHER4_ALPHA == 1)\n // use #extension GL_ARB_gpu_shader5 : enable\n #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)\n #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)\n #define FxaaTexGreen4(t, p) textureGather(t, p, 1)\n #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_GLSL_130 == 1)\n // Requires \"#version 130\" or better\n #define FxaaTexTop(t, p) textureLod(t, p, 0.0)\n #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)\n #if (FXAA_GATHER4_ALPHA == 1)\n // use #extension GL_ARB_gpu_shader5 : enable\n #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)\n #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)\n #define FxaaTexGreen4(t, p) textureGather(t, p, 1)\n #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_HLSL_3 == 1)\n #define FxaaInt2 float2\n #define FxaaTex sampler2D\n #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))\n #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_HLSL_4 == 1)\n #define FxaaInt2 int2\n struct FxaaTex { SamplerState smpl; Texture2D tex; };\n #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)\n #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_HLSL_5 == 1)\n #define FxaaInt2 int2\n struct FxaaTex { SamplerState smpl; Texture2D tex; };\n #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)\n #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)\n #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)\n #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)\n #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)\n #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)\n #endif\n \n \n /*============================================================================\n GREEN AS LUMA OPTION SUPPORT FUNCTION\n ============================================================================*/\n #if (FXAA_GREEN_AS_LUMA == 0)\n FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }\n #else\n FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\n #endif\n \n \n \n \n /*============================================================================\n \n FXAA3 QUALITY - PC\n \n ============================================================================*/\n #if (FXAA_PC == 1)\n /*--------------------------------------------------------------------------*/\n FxaaFloat4 FxaaPixelShader(\n //\n // Use noperspective interpolation here (turn off perspective interpolation).\n // {xy} = center of pixel\n FxaaFloat2 pos,\n //\n // Used only for FXAA Console, and not used on the 360 version.\n // Use noperspective interpolation here (turn off perspective interpolation).\n // {xy_} = upper left of pixel\n // {_zw} = lower right of pixel\n FxaaFloat4 fxaaConsolePosPos,\n //\n // Input color texture.\n // {rgb_} = color in linear or perceptual color space\n // if (FXAA_GREEN_AS_LUMA == 0)\n // {__a} = luma in perceptual color space (not linear)\n FxaaTex tex,\n //\n // Only used on the optimized 360 version of FXAA Console.\n // For everything but 360, just use the same input here as for \"tex\".\n // For 360, same texture, just alias with a 2nd sampler.\n // This sampler needs to have an exponent bias of -1.\n FxaaTex fxaaConsole360TexExpBiasNegOne,\n //\n // Only used on the optimized 360 version of FXAA Console.\n // For everything but 360, just use the same input here as for \"tex\".\n // For 360, same texture, just alias with a 3nd sampler.\n // This sampler needs to have an exponent bias of -2.\n FxaaTex fxaaConsole360TexExpBiasNegTwo,\n //\n // Only used on FXAA Quality.\n // This must be from a constant/uniform.\n // {x_} = 1.0/screenWidthInPixels\n // {_y} = 1.0/screenHeightInPixels\n FxaaFloat2 fxaaQualityRcpFrame,\n //\n // Only used on FXAA Console.\n // This must be from a constant/uniform.\n // This effects sub-pixel AA quality and inversely sharpness.\n // Where N ranges between,\n // N = 0.50 (default)\n // N = 0.33 (sharper)\n // {x__} = -N/screenWidthInPixels\n // {_y_} = -N/screenHeightInPixels\n // {_z_} = N/screenWidthInPixels\n // {__w} = N/screenHeightInPixels\n FxaaFloat4 fxaaConsoleRcpFrameOpt,\n //\n // Only used on FXAA Console.\n // Not used on 360, but used on PS3 and PC.\n // This must be from a constant/uniform.\n // {x__} = -2.0/screenWidthInPixels\n // {_y_} = -2.0/screenHeightInPixels\n // {_z_} = 2.0/screenWidthInPixels\n // {__w} = 2.0/screenHeightInPixels\n FxaaFloat4 fxaaConsoleRcpFrameOpt2,\n //\n // Only used on FXAA Console.\n // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.\n // This must be from a constant/uniform.\n // {x__} = 8.0/screenWidthInPixels\n // {_y_} = 8.0/screenHeightInPixels\n // {_z_} = -4.0/screenWidthInPixels\n // {__w} = -4.0/screenHeightInPixels\n FxaaFloat4 fxaaConsole360RcpFrameOpt2,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITY_SUBPIX define.\n // It is here now to allow easier tuning.\n // Choose the amount of sub-pixel aliasing removal.\n // This can effect sharpness.\n // 1.00 - upper limit (softer)\n // 0.75 - default amount of filtering\n // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)\n // 0.25 - almost off\n // 0.00 - completely off\n FxaaFloat fxaaQualitySubpix,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.\n // It is here now to allow easier tuning.\n // The minimum amount of local contrast required to apply algorithm.\n // 0.333 - too little (faster)\n // 0.250 - low quality\n // 0.166 - default\n // 0.125 - high quality\n // 0.063 - overkill (slower)\n FxaaFloat fxaaQualityEdgeThreshold,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.\n // It is here now to allow easier tuning.\n // Trims the algorithm from processing darks.\n // 0.0833 - upper limit (default, the start of visible unfiltered edges)\n // 0.0625 - high quality (faster)\n // 0.0312 - visible limit (slower)\n // Special notes when using FXAA_GREEN_AS_LUMA,\n // Likely want to set this to zero.\n // As colors that are mostly not-green\n // will appear very dark in the green channel!\n // Tune by looking at mostly non-green content,\n // then start at zero and increase until aliasing is a problem.\n FxaaFloat fxaaQualityEdgeThresholdMin,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define.\n // It is here now to allow easier tuning.\n // This does not effect PS3, as this needs to be compiled in.\n // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3.\n // Due to the PS3 being ALU bound,\n // there are only three safe values here: 2 and 4 and 8.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n // For all other platforms can be a non-power of two.\n // 8.0 is sharper (default!!!)\n // 4.0 is softer\n // 2.0 is really soft (good only for vector graphics inputs)\n FxaaFloat fxaaConsoleEdgeSharpness,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define.\n // It is here now to allow easier tuning.\n // This does not effect PS3, as this needs to be compiled in.\n // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3.\n // Due to the PS3 being ALU bound,\n // there are only two safe values here: 1/4 and 1/8.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n // The console setting has a different mapping than the quality setting.\n // Other platforms can use other values.\n // 0.125 leaves less aliasing, but is softer (default!!!)\n // 0.25 leaves more aliasing, and is sharper\n FxaaFloat fxaaConsoleEdgeThreshold,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define.\n // It is here now to allow easier tuning.\n // Trims the algorithm from processing darks.\n // The console setting has a different mapping than the quality setting.\n // This only applies when FXAA_EARLY_EXIT is 1.\n // This does not apply to PS3,\n // PS3 was simplified to avoid more shader instructions.\n // 0.06 - faster but more aliasing in darks\n // 0.05 - default\n // 0.04 - slower and less aliasing in darks\n // Special notes when using FXAA_GREEN_AS_LUMA,\n // Likely want to set this to zero.\n // As colors that are mostly not-green\n // will appear very dark in the green channel!\n // Tune by looking at mostly non-green content,\n // then start at zero and increase until aliasing is a problem.\n FxaaFloat fxaaConsoleEdgeThresholdMin,\n //\n // Extra constants for 360 FXAA Console only.\n // Use zeros or anything else for other platforms.\n // These must be in physical constant registers and NOT immediates.\n // Immediates will result in compiler un-optimizing.\n // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)\n FxaaFloat4 fxaaConsole360ConstDir\n ) {\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posM;\n posM.x = pos.x;\n posM.y = pos.y;\n #if (FXAA_GATHER4_ALPHA == 1)\n #if (FXAA_DISCARD == 0)\n FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n #if (FXAA_GREEN_AS_LUMA == 0)\n #define lumaM rgbyM.w\n #else\n #define lumaM rgbyM.y\n #endif\n #endif\n #if (FXAA_GREEN_AS_LUMA == 0)\n FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);\n FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));\n #else\n FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);\n FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));\n #endif\n #if (FXAA_DISCARD == 1)\n #define lumaM luma4A.w\n #endif\n #define lumaE luma4A.z\n #define lumaS luma4A.x\n #define lumaSE luma4A.y\n #define lumaNW luma4B.w\n #define lumaN luma4B.z\n #define lumaW luma4B.x\n #else\n FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n #if (FXAA_GREEN_AS_LUMA == 0)\n #define lumaM rgbyM.w\n #else\n #define lumaM rgbyM.y\n #endif\n #if (FXAA_GLSL_100 == 1)\n FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));\n #else\n FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n FxaaFloat maxSM = max(lumaS, lumaM);\n FxaaFloat minSM = min(lumaS, lumaM);\n FxaaFloat maxESM = max(lumaE, maxSM);\n FxaaFloat minESM = min(lumaE, minSM);\n FxaaFloat maxWN = max(lumaN, lumaW);\n FxaaFloat minWN = min(lumaN, lumaW);\n FxaaFloat rangeMax = max(maxWN, maxESM);\n FxaaFloat rangeMin = min(minWN, minESM);\n FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\n FxaaFloat range = rangeMax - rangeMin;\n FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\n FxaaBool earlyExit = range < rangeMaxClamped;\n /*--------------------------------------------------------------------------*/\n if(earlyExit)\n #if (FXAA_DISCARD == 1)\n FxaaDiscard;\n #else\n return rgbyM;\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_GATHER4_ALPHA == 0)\n #if (FXAA_GLSL_100 == 1)\n FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));\n #else\n FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\n #endif\n #else\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\n #endif\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNS = lumaN + lumaS;\n FxaaFloat lumaWE = lumaW + lumaE;\n FxaaFloat subpixRcpRange = 1.0/range;\n FxaaFloat subpixNSWE = lumaNS + lumaWE;\n FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\n FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNESE = lumaNE + lumaSE;\n FxaaFloat lumaNWNE = lumaNW + lumaNE;\n FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\n FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNWSW = lumaNW + lumaSW;\n FxaaFloat lumaSWSE = lumaSW + lumaSE;\n FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\n FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\n FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\n FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\n FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\n FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\n /*--------------------------------------------------------------------------*/\n FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\n FxaaFloat lengthSign = fxaaQualityRcpFrame.x;\n FxaaBool horzSpan = edgeHorz >= edgeVert;\n FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\n /*--------------------------------------------------------------------------*/\n if(!horzSpan) lumaN = lumaW;\n if(!horzSpan) lumaS = lumaE;\n if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;\n FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;\n /*--------------------------------------------------------------------------*/\n FxaaFloat gradientN = lumaN - lumaM;\n FxaaFloat gradientS = lumaS - lumaM;\n FxaaFloat lumaNN = lumaN + lumaM;\n FxaaFloat lumaSS = lumaS + lumaM;\n FxaaBool pairN = abs(gradientN) >= abs(gradientS);\n FxaaFloat gradient = max(abs(gradientN), abs(gradientS));\n if(pairN) lengthSign = -lengthSign;\n FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posB;\n posB.x = posM.x;\n posB.y = posM.y;\n FxaaFloat2 offNP;\n offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\n offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\n if(!horzSpan) posB.x += lengthSign * 0.5;\n if( horzSpan) posB.y += lengthSign * 0.5;\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posN;\n posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\n posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\n FxaaFloat2 posP;\n posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\n posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\n FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\n FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\n FxaaFloat subpixE = subpixC * subpixC;\n FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\n /*--------------------------------------------------------------------------*/\n if(!pairN) lumaNN = lumaSS;\n FxaaFloat gradientScaled = gradient * 1.0/4.0;\n FxaaFloat lumaMM = lumaM - lumaNN * 0.5;\n FxaaFloat subpixF = subpixD * subpixE;\n FxaaBool lumaMLTZero = lumaMM < 0.0;\n /*--------------------------------------------------------------------------*/\n lumaEndN -= lumaNN * 0.5;\n lumaEndP -= lumaNN * 0.5;\n FxaaBool doneN = abs(lumaEndN) >= gradientScaled;\n FxaaBool doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\n FxaaBool doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\n /*--------------------------------------------------------------------------*/\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 3)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 4)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 5)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 6)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 7)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 8)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 9)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 10)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 11)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITY_PS > 12)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n /*--------------------------------------------------------------------------*/\n FxaaFloat dstN = posM.x - posN.x;\n FxaaFloat dstP = posP.x - posM.x;\n if(!horzSpan) dstN = posM.y - posN.y;\n if(!horzSpan) dstP = posP.y - posM.y;\n /*--------------------------------------------------------------------------*/\n FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\n FxaaFloat spanLength = (dstP + dstN);\n FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\n FxaaFloat spanLengthRcp = 1.0/spanLength;\n /*--------------------------------------------------------------------------*/\n FxaaBool directionN = dstN < dstP;\n FxaaFloat dst = min(dstN, dstP);\n FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\n FxaaFloat subpixG = subpixF * subpixF;\n FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\n FxaaFloat subpixH = subpixG * fxaaQualitySubpix;\n /*--------------------------------------------------------------------------*/\n FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\n FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\n if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\n if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\n #if (FXAA_DISCARD == 1)\n return FxaaTexTop(tex, posM);\n #else\n return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\n #endif\n }\n /*==========================================================================*/\n #endif\n \n void main() {\n gl_FragColor = FxaaPixelShader(\n vUv,\n vec4(0.0),\n tDiffuse,\n tDiffuse,\n tDiffuse,\n resolution,\n vec4(0.0),\n vec4(0.0),\n vec4(0.0),\n 0.75,\n 0.166,\n 0.0833,\n 0.0,\n 0.0,\n 0.0,\n vec4(0.0)\n );\n \n // TODO avoid querying texture twice for same texel\n gl_FragColor.a = texture2D(tDiffuse, vUv).a;\n }\n `,\n}\n"],"names":[],"mappings":";AASO,MAAM,aAAa;AAAA,EACxB,UAAU;AAAA,IACR,UAAU,EAAE,OAAO,KAAK;AAAA,IACxB,YAAY,EAAE,OAAuB,oBAAI,QAAQ,IAAI,MAAM,IAAI,GAAG,EAAE;AAAA,EACtE;AAAA,EAEA;AAAA;AAAA,IAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWzB;AAAA;AAAA,IAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AA;AAAA;AAyjC7B;"}
@@ -1,4 +1,4 @@
1
- import type { Vector2 } from 'three';
1
+ import { Vector2 } from 'three';
2
2
  /**
3
3
  * Edge Detection Shader using Frei-Chen filter
4
4
  * Based on http://rastergrid.com/blog/2011/01/frei-chen-edge-detector
@@ -3,7 +3,7 @@
3
3
  * http://en.wikipedia.org/wiki/gamma_correction
4
4
  */
5
5
  import type { IUniform, Texture } from 'three';
6
- import type { IShader } from './types.d.ts';
6
+ import type { IShader } from './types';
7
7
  export type GammaCorrectionShaderUniforms = {
8
8
  tDiffuse: IUniform<Texture | null>;
9
9
  };
@@ -97,7 +97,7 @@ const GodRaysGenerateShader = {
97
97
  // Unrolling didnt do much on my hardware (ATI Mobility Radeon 3450),
98
98
  // so ive just left the loop
99
99
 
100
- "for ( float i = 0.0; i < TAPS_PER_PASS; i += 1.0 ) {",
100
+ for ( float i = 0.0; i < TAPS_PER_PASS; i += 1.0 ) {
101
101
 
102
102
  // Accumulate samples, making sure we dont walk past the light source.
103
103
 
@@ -107,10 +107,10 @@ const GodRaysGenerateShader = {
107
107
  // sun is to the left, right or bottom of screen as these cases are
108
108
  // not specifically handled.
109
109
 
110
- " col += ( i <= iters && uv.y < 1.0 ? texture2D( tInput, uv ).r : 0.0 );",
111
- " uv += stepv;",
110
+ col += ( i <= iters && uv.y < 1.0 ? texture2D( tInput, uv ).r : 0.0 );
111
+ uv += stepv;
112
112
 
113
- "}",
113
+ }
114
114
  */
115
115
 
116
116
  // Unrolling loop manually makes it work in ANGLE
@@ -1 +1 @@
1
- {"version":3,"file":"GodRaysShader.cjs","sources":["../../src/shaders/GodRaysShader.ts"],"sourcesContent":["import { Color, Vector3 } from 'three'\n\n/**\n * God-rays (crepuscular rays)\n *\n * Similar implementation to the one used by Crytek for CryEngine 2 [Sousa2008].\n * Blurs a mask generated from the depth map along radial lines emanating from the light\n * source. The blur repeatedly applies a blur filter of increasing support but constant\n * sample count to produce a blur filter with large support.\n *\n * My implementation performs 3 passes, similar to the implementation from Sousa. I found\n * just 6 samples per pass produced acceptible results. The blur is applied three times,\n * with decreasing filter support. The result is equivalent to a single pass with\n * 6*6*6 = 216 samples.\n *\n * References:\n *\n * Sousa2008 - Crysis Next Gen Effects, GDC2008, http://www.crytek.com/sites/default/files/GDC08_SousaT_CrysisEffects.ppt\n */\n\nexport const GodRaysDepthMaskShader = {\n uniforms: {\n tInput: {\n value: null,\n },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n varying vec2 vUv;\n\n uniform sampler2D tInput;\n\n void main() {\n\n \tgl_FragColor = vec4( 1.0 ) - texture2D( tInput, vUv );\n\n }\n `,\n}\n\n/**\n * The god-ray generation shader.\n *\n * First pass:\n *\n * The depth map is blurred along radial lines towards the \"sun\". The\n * output is written to a temporary render target (I used a 1/4 sized\n * target).\n *\n * Pass two & three:\n *\n * The results of the previous pass are re-blurred, each time with a\n * decreased distance between samples.\n */\n\nexport const GodRaysGenerateShader = {\n uniforms: {\n tInput: {\n value: null,\n },\n fStepSize: {\n value: 1.0,\n },\n vSunPositionScreenSpace: {\n value: /* @__PURE__ */ new Vector3(),\n },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n #define TAPS_PER_PASS 6.0\n\n varying vec2 vUv;\n\n uniform sampler2D tInput;\n\n uniform vec3 vSunPositionScreenSpace;\n uniform float fStepSize; // filter step size\n\n void main() {\n\n // delta from current pixel to \"sun\" position\n\n \tvec2 delta = vSunPositionScreenSpace.xy - vUv;\n \tfloat dist = length( delta );\n\n // Step vector (uv space)\n\n \tvec2 stepv = fStepSize * delta / dist;\n\n // Number of iterations between pixel and sun\n\n \tfloat iters = dist/fStepSize;\n\n \tvec2 uv = vUv.xy;\n \tfloat col = 0.0;\n\n // This breaks ANGLE in Chrome 22\n //\t- see http://code.google.com/p/chromium/issues/detail?id=153105\n\n /*\n\t\t// Unrolling didnt do much on my hardware (ATI Mobility Radeon 3450),\n\t\t// so ive just left the loop\n\n\t\t\"for ( float i = 0.0; i < TAPS_PER_PASS; i += 1.0 ) {\",\n\n\t\t// Accumulate samples, making sure we dont walk past the light source.\n\n\t\t// The check for uv.y < 1 would not be necessary with \"border\" UV wrap\n\t\t// mode, with a black border color. I dont think this is currently\n\t\t// exposed by three.js. As a result there might be artifacts when the\n\t\t// sun is to the left, right or bottom of screen as these cases are\n\t\t// not specifically handled.\n\n\t\t\"\tcol += ( i <= iters && uv.y < 1.0 ? texture2D( tInput, uv ).r : 0.0 );\",\n\t\t\"\tuv += stepv;\",\n\n\t\t\"}\",\n\t\t*/\n\n // Unrolling loop manually makes it work in ANGLE\n\n \tfloat f = min( 1.0, max( vSunPositionScreenSpace.z / 1000.0, 0.0 ) ); // used to fade out godrays\n\n \tif ( 0.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 1.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 2.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 3.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 4.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 5.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n // Should technically be dividing by iters but TAPS_PER_PASS smooths out\n // objectionable artifacts, in particular near the sun position. The side\n // effect is that the result is darker than it should be around the sun, as\n // TAPS_PER_PASS is greater than the number of samples actually accumulated.\n // When the result is inverted (in the shader godrays_combine this produces\n // a slight bright spot at the position of the sun, even when it is occluded.\n\n \tgl_FragColor = vec4( col/TAPS_PER_PASS );\n \tgl_FragColor.a = 1.0;\n\n }\n `,\n}\n\n/**\n * Additively applies god rays from texture tGodRays to a background (tColors).\n * fGodRayIntensity attenuates the god rays.\n */\n\nexport const GodRaysCombineShader = {\n uniforms: {\n tColors: {\n value: null,\n },\n\n tGodRays: {\n value: null,\n },\n\n fGodRayIntensity: {\n value: 0.69,\n },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n varying vec2 vUv;\n\n uniform sampler2D tColors;\n uniform sampler2D tGodRays;\n\n uniform float fGodRayIntensity;\n\n void main() {\n\n // Since THREE.MeshDepthMaterial renders foreground objects white and background\n // objects black, the god-rays will be white streaks. Therefore value is inverted\n // before being combined with tColors\n\n \tgl_FragColor = texture2D( tColors, vUv ) + fGodRayIntensity * vec4( 1.0 - texture2D( tGodRays, vUv ).r );\n \tgl_FragColor.a = 1.0;\n\n }\n `,\n}\n\n/**\n * A dodgy sun/sky shader. Makes a bright spot at the sun location. Would be\n * cheaper/faster/simpler to implement this as a simple sun sprite.\n */\n\nexport const GodRaysFakeSunShader = {\n uniforms: {\n vSunPositionScreenSpace: {\n value: /* @__PURE__ */ new Vector3(),\n },\n\n fAspect: {\n value: 1.0,\n },\n\n sunColor: {\n value: /* @__PURE__ */ new Color(0xffee00),\n },\n\n bgColor: {\n value: /* @__PURE__ */ new Color(0x000000),\n },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n varying vec2 vUv;\n\n uniform vec3 vSunPositionScreenSpace;\n uniform float fAspect;\n\n uniform vec3 sunColor;\n uniform vec3 bgColor;\n\n void main() {\n\n \tvec2 diff = vUv - vSunPositionScreenSpace.xy;\n\n // Correct for aspect ratio\n\n \tdiff.x *= fAspect;\n\n \tfloat prop = clamp( length( diff ) / 0.5, 0.0, 1.0 );\n \tprop = 0.35 * pow( 1.0 - prop, 3.0 );\n\n \tgl_FragColor.xyz = ( vSunPositionScreenSpace.z > 0.0 ) ? mix( sunColor, bgColor, 1.0 - prop ) : bgColor;\n \tgl_FragColor.w = 1.0;\n\n }\n `,\n}\n"],"names":["Vector3","Color"],"mappings":";;;AAoBO,MAAM,yBAAyB;AAAA,EACpC,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EAEA;AAAA;AAAA,IAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWzB;AAAA;AAAA,IAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW7B;AAiBO,MAAM,wBAAwB;AAAA,EACnC,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,OAAO;AAAA,IACT;AAAA,IACA,WAAW;AAAA,MACT,OAAO;AAAA,IACT;AAAA,IACA,yBAAyB;AAAA,MACvB,2BAA2BA,MAAAA,QAAQ;AAAA,IACrC;AAAA,EACF;AAAA,EAEA;AAAA;AAAA,IAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWzB;AAAA;AAAA,IAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyB7B;;;;;"}
1
+ {"version":3,"file":"GodRaysShader.cjs","sources":["../../src/shaders/GodRaysShader.ts"],"sourcesContent":["import { Color, Vector3 } from 'three'\n\n/**\n * God-rays (crepuscular rays)\n *\n * Similar implementation to the one used by Crytek for CryEngine 2 [Sousa2008].\n * Blurs a mask generated from the depth map along radial lines emanating from the light\n * source. The blur repeatedly applies a blur filter of increasing support but constant\n * sample count to produce a blur filter with large support.\n *\n * My implementation performs 3 passes, similar to the implementation from Sousa. I found\n * just 6 samples per pass produced acceptible results. The blur is applied three times,\n * with decreasing filter support. The result is equivalent to a single pass with\n * 6*6*6 = 216 samples.\n *\n * References:\n *\n * Sousa2008 - Crysis Next Gen Effects, GDC2008, http://www.crytek.com/sites/default/files/GDC08_SousaT_CrysisEffects.ppt\n */\n\nexport const GodRaysDepthMaskShader = {\n uniforms: {\n tInput: {\n value: null,\n },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n varying vec2 vUv;\n\n uniform sampler2D tInput;\n\n void main() {\n\n \tgl_FragColor = vec4( 1.0 ) - texture2D( tInput, vUv );\n\n }\n `,\n}\n\n/**\n * The god-ray generation shader.\n *\n * First pass:\n *\n * The depth map is blurred along radial lines towards the \"sun\". The\n * output is written to a temporary render target (I used a 1/4 sized\n * target).\n *\n * Pass two & three:\n *\n * The results of the previous pass are re-blurred, each time with a\n * decreased distance between samples.\n */\n\nexport const GodRaysGenerateShader = {\n uniforms: {\n tInput: {\n value: null,\n },\n fStepSize: {\n value: 1.0,\n },\n vSunPositionScreenSpace: {\n value: /* @__PURE__ */ new Vector3(),\n },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n #define TAPS_PER_PASS 6.0\n\n varying vec2 vUv;\n\n uniform sampler2D tInput;\n\n uniform vec3 vSunPositionScreenSpace;\n uniform float fStepSize; // filter step size\n\n void main() {\n\n // delta from current pixel to \"sun\" position\n\n \tvec2 delta = vSunPositionScreenSpace.xy - vUv;\n \tfloat dist = length( delta );\n\n // Step vector (uv space)\n\n \tvec2 stepv = fStepSize * delta / dist;\n\n // Number of iterations between pixel and sun\n\n \tfloat iters = dist/fStepSize;\n\n \tvec2 uv = vUv.xy;\n \tfloat col = 0.0;\n\n // This breaks ANGLE in Chrome 22\n //\t- see http://code.google.com/p/chromium/issues/detail?id=153105\n\n /*\n\t\t// Unrolling didnt do much on my hardware (ATI Mobility Radeon 3450),\n\t\t// so ive just left the loop\n\n\t\tfor ( float i = 0.0; i < TAPS_PER_PASS; i += 1.0 ) {\n\n\t\t// Accumulate samples, making sure we dont walk past the light source.\n\n\t\t// The check for uv.y < 1 would not be necessary with \"border\" UV wrap\n\t\t// mode, with a black border color. I dont think this is currently\n\t\t// exposed by three.js. As a result there might be artifacts when the\n\t\t// sun is to the left, right or bottom of screen as these cases are\n\t\t// not specifically handled.\n\n\t\tcol += ( i <= iters && uv.y < 1.0 ? texture2D( tInput, uv ).r : 0.0 );\n\t\tuv += stepv;\n\n\t\t}\n\t\t*/\n\n // Unrolling loop manually makes it work in ANGLE\n\n \tfloat f = min( 1.0, max( vSunPositionScreenSpace.z / 1000.0, 0.0 ) ); // used to fade out godrays\n\n \tif ( 0.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 1.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 2.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 3.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 4.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 5.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n // Should technically be dividing by iters but TAPS_PER_PASS smooths out\n // objectionable artifacts, in particular near the sun position. The side\n // effect is that the result is darker than it should be around the sun, as\n // TAPS_PER_PASS is greater than the number of samples actually accumulated.\n // When the result is inverted (in the shader godrays_combine this produces\n // a slight bright spot at the position of the sun, even when it is occluded.\n\n \tgl_FragColor = vec4( col/TAPS_PER_PASS );\n \tgl_FragColor.a = 1.0;\n\n }\n `,\n}\n\n/**\n * Additively applies god rays from texture tGodRays to a background (tColors).\n * fGodRayIntensity attenuates the god rays.\n */\n\nexport const GodRaysCombineShader = {\n uniforms: {\n tColors: {\n value: null,\n },\n\n tGodRays: {\n value: null,\n },\n\n fGodRayIntensity: {\n value: 0.69,\n },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n varying vec2 vUv;\n\n uniform sampler2D tColors;\n uniform sampler2D tGodRays;\n\n uniform float fGodRayIntensity;\n\n void main() {\n\n // Since THREE.MeshDepthMaterial renders foreground objects white and background\n // objects black, the god-rays will be white streaks. Therefore value is inverted\n // before being combined with tColors\n\n \tgl_FragColor = texture2D( tColors, vUv ) + fGodRayIntensity * vec4( 1.0 - texture2D( tGodRays, vUv ).r );\n \tgl_FragColor.a = 1.0;\n\n }\n `,\n}\n\n/**\n * A dodgy sun/sky shader. Makes a bright spot at the sun location. Would be\n * cheaper/faster/simpler to implement this as a simple sun sprite.\n */\n\nexport const GodRaysFakeSunShader = {\n uniforms: {\n vSunPositionScreenSpace: {\n value: /* @__PURE__ */ new Vector3(),\n },\n\n fAspect: {\n value: 1.0,\n },\n\n sunColor: {\n value: /* @__PURE__ */ new Color(0xffee00),\n },\n\n bgColor: {\n value: /* @__PURE__ */ new Color(0x000000),\n },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n varying vec2 vUv;\n\n uniform vec3 vSunPositionScreenSpace;\n uniform float fAspect;\n\n uniform vec3 sunColor;\n uniform vec3 bgColor;\n\n void main() {\n\n \tvec2 diff = vUv - vSunPositionScreenSpace.xy;\n\n // Correct for aspect ratio\n\n \tdiff.x *= fAspect;\n\n \tfloat prop = clamp( length( diff ) / 0.5, 0.0, 1.0 );\n \tprop = 0.35 * pow( 1.0 - prop, 3.0 );\n\n \tgl_FragColor.xyz = ( vSunPositionScreenSpace.z > 0.0 ) ? mix( sunColor, bgColor, 1.0 - prop ) : bgColor;\n \tgl_FragColor.w = 1.0;\n\n }\n `,\n}\n"],"names":["Vector3","Color"],"mappings":";;;AAoBO,MAAM,yBAAyB;AAAA,EACpC,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EAEA;AAAA;AAAA,IAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWzB;AAAA;AAAA,IAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW7B;AAiBO,MAAM,wBAAwB;AAAA,EACnC,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,OAAO;AAAA,IACT;AAAA,IACA,WAAW;AAAA,MACT,OAAO;AAAA,IACT;AAAA,IACA,yBAAyB;AAAA,MACvB,2BAA2BA,MAAAA,QAAQ;AAAA,IACrC;AAAA,EACF;AAAA,EAEA;AAAA;AAAA,IAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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C;AAAA,IAEA,SAAS;AAAA,MACP,OAA2B,oBAAAA,MAAA,MAAM,CAAQ;AAAA,IAC3C;AAAA,EACF;AAAA,EAEA;AAAA;AAAA,IAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWzB;AAAA;AAAA,IAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyB7B;;;;;"}
@@ -1,4 +1,4 @@
1
- import type { Color, Vector3 } from 'three';
1
+ import { Color, Vector3 } from 'three';
2
2
  /**
3
3
  * God-rays (crepuscular rays)
4
4
  *
@@ -95,7 +95,7 @@ const GodRaysGenerateShader = {
95
95
  // Unrolling didnt do much on my hardware (ATI Mobility Radeon 3450),
96
96
  // so ive just left the loop
97
97
 
98
- "for ( float i = 0.0; i < TAPS_PER_PASS; i += 1.0 ) {",
98
+ for ( float i = 0.0; i < TAPS_PER_PASS; i += 1.0 ) {
99
99
 
100
100
  // Accumulate samples, making sure we dont walk past the light source.
101
101
 
@@ -105,10 +105,10 @@ const GodRaysGenerateShader = {
105
105
  // sun is to the left, right or bottom of screen as these cases are
106
106
  // not specifically handled.
107
107
 
108
- " col += ( i <= iters && uv.y < 1.0 ? texture2D( tInput, uv ).r : 0.0 );",
109
- " uv += stepv;",
108
+ col += ( i <= iters && uv.y < 1.0 ? texture2D( tInput, uv ).r : 0.0 );
109
+ uv += stepv;
110
110
 
111
- "}",
111
+ }
112
112
  */
113
113
 
114
114
  // Unrolling loop manually makes it work in ANGLE
@@ -1 +1 @@
1
- {"version":3,"file":"GodRaysShader.js","sources":["../../src/shaders/GodRaysShader.ts"],"sourcesContent":["import { Color, Vector3 } from 'three'\n\n/**\n * God-rays (crepuscular rays)\n *\n * Similar implementation to the one used by Crytek for CryEngine 2 [Sousa2008].\n * Blurs a mask generated from the depth map along radial lines emanating from the light\n * source. The blur repeatedly applies a blur filter of increasing support but constant\n * sample count to produce a blur filter with large support.\n *\n * My implementation performs 3 passes, similar to the implementation from Sousa. I found\n * just 6 samples per pass produced acceptible results. The blur is applied three times,\n * with decreasing filter support. The result is equivalent to a single pass with\n * 6*6*6 = 216 samples.\n *\n * References:\n *\n * Sousa2008 - Crysis Next Gen Effects, GDC2008, http://www.crytek.com/sites/default/files/GDC08_SousaT_CrysisEffects.ppt\n */\n\nexport const GodRaysDepthMaskShader = {\n uniforms: {\n tInput: {\n value: null,\n },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n varying vec2 vUv;\n\n uniform sampler2D tInput;\n\n void main() {\n\n \tgl_FragColor = vec4( 1.0 ) - texture2D( tInput, vUv );\n\n }\n `,\n}\n\n/**\n * The god-ray generation shader.\n *\n * First pass:\n *\n * The depth map is blurred along radial lines towards the \"sun\". The\n * output is written to a temporary render target (I used a 1/4 sized\n * target).\n *\n * Pass two & three:\n *\n * The results of the previous pass are re-blurred, each time with a\n * decreased distance between samples.\n */\n\nexport const GodRaysGenerateShader = {\n uniforms: {\n tInput: {\n value: null,\n },\n fStepSize: {\n value: 1.0,\n },\n vSunPositionScreenSpace: {\n value: /* @__PURE__ */ new Vector3(),\n },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n #define TAPS_PER_PASS 6.0\n\n varying vec2 vUv;\n\n uniform sampler2D tInput;\n\n uniform vec3 vSunPositionScreenSpace;\n uniform float fStepSize; // filter step size\n\n void main() {\n\n // delta from current pixel to \"sun\" position\n\n \tvec2 delta = vSunPositionScreenSpace.xy - vUv;\n \tfloat dist = length( delta );\n\n // Step vector (uv space)\n\n \tvec2 stepv = fStepSize * delta / dist;\n\n // Number of iterations between pixel and sun\n\n \tfloat iters = dist/fStepSize;\n\n \tvec2 uv = vUv.xy;\n \tfloat col = 0.0;\n\n // This breaks ANGLE in Chrome 22\n //\t- see http://code.google.com/p/chromium/issues/detail?id=153105\n\n /*\n\t\t// Unrolling didnt do much on my hardware (ATI Mobility Radeon 3450),\n\t\t// so ive just left the loop\n\n\t\t\"for ( float i = 0.0; i < TAPS_PER_PASS; i += 1.0 ) {\",\n\n\t\t// Accumulate samples, making sure we dont walk past the light source.\n\n\t\t// The check for uv.y < 1 would not be necessary with \"border\" UV wrap\n\t\t// mode, with a black border color. I dont think this is currently\n\t\t// exposed by three.js. As a result there might be artifacts when the\n\t\t// sun is to the left, right or bottom of screen as these cases are\n\t\t// not specifically handled.\n\n\t\t\"\tcol += ( i <= iters && uv.y < 1.0 ? texture2D( tInput, uv ).r : 0.0 );\",\n\t\t\"\tuv += stepv;\",\n\n\t\t\"}\",\n\t\t*/\n\n // Unrolling loop manually makes it work in ANGLE\n\n \tfloat f = min( 1.0, max( vSunPositionScreenSpace.z / 1000.0, 0.0 ) ); // used to fade out godrays\n\n \tif ( 0.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 1.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 2.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 3.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 4.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 5.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n // Should technically be dividing by iters but TAPS_PER_PASS smooths out\n // objectionable artifacts, in particular near the sun position. The side\n // effect is that the result is darker than it should be around the sun, as\n // TAPS_PER_PASS is greater than the number of samples actually accumulated.\n // When the result is inverted (in the shader godrays_combine this produces\n // a slight bright spot at the position of the sun, even when it is occluded.\n\n \tgl_FragColor = vec4( col/TAPS_PER_PASS );\n \tgl_FragColor.a = 1.0;\n\n }\n `,\n}\n\n/**\n * Additively applies god rays from texture tGodRays to a background (tColors).\n * fGodRayIntensity attenuates the god rays.\n */\n\nexport const GodRaysCombineShader = {\n uniforms: {\n tColors: {\n value: null,\n },\n\n tGodRays: {\n value: null,\n },\n\n fGodRayIntensity: {\n value: 0.69,\n },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n varying vec2 vUv;\n\n uniform sampler2D tColors;\n uniform sampler2D tGodRays;\n\n uniform float fGodRayIntensity;\n\n void main() {\n\n // Since THREE.MeshDepthMaterial renders foreground objects white and background\n // objects black, the god-rays will be white streaks. Therefore value is inverted\n // before being combined with tColors\n\n \tgl_FragColor = texture2D( tColors, vUv ) + fGodRayIntensity * vec4( 1.0 - texture2D( tGodRays, vUv ).r );\n \tgl_FragColor.a = 1.0;\n\n }\n `,\n}\n\n/**\n * A dodgy sun/sky shader. Makes a bright spot at the sun location. Would be\n * cheaper/faster/simpler to implement this as a simple sun sprite.\n */\n\nexport const GodRaysFakeSunShader = {\n uniforms: {\n vSunPositionScreenSpace: {\n value: /* @__PURE__ */ new Vector3(),\n },\n\n fAspect: {\n value: 1.0,\n },\n\n sunColor: {\n value: /* @__PURE__ */ new Color(0xffee00),\n },\n\n bgColor: {\n value: /* @__PURE__ */ new Color(0x000000),\n },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n varying vec2 vUv;\n\n uniform vec3 vSunPositionScreenSpace;\n uniform float fAspect;\n\n uniform vec3 sunColor;\n uniform vec3 bgColor;\n\n void main() {\n\n \tvec2 diff = vUv - vSunPositionScreenSpace.xy;\n\n // Correct for aspect ratio\n\n \tdiff.x *= fAspect;\n\n \tfloat prop = clamp( length( diff ) / 0.5, 0.0, 1.0 );\n \tprop = 0.35 * pow( 1.0 - prop, 3.0 );\n\n \tgl_FragColor.xyz = ( vSunPositionScreenSpace.z > 0.0 ) ? mix( sunColor, bgColor, 1.0 - prop ) : bgColor;\n \tgl_FragColor.w = 1.0;\n\n }\n `,\n}\n"],"names":[],"mappings":";AAoBO,MAAM,yBAAyB;AAAA,EACpC,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EAEA;AAAA;AAAA,IAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWzB;AAAA;AAAA,IAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW7B;AAiBO,MAAM,wBAAwB;AAAA,EACnC,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,OAAO;AAAA,IACT;AAAA,IACA,WAAW;AAAA,MACT,OAAO;AAAA,IACT;AAAA,IACA,yBAAyB;AAAA,MACvB,2BAA2B,QAAQ;AAAA,IACrC;AAAA,EACF;AAAA,EAEA;AAAA;AAAA,IAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWzB;AAAA;AAAA,IAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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AA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyB7B;"}
1
+ {"version":3,"file":"GodRaysShader.js","sources":["../../src/shaders/GodRaysShader.ts"],"sourcesContent":["import { Color, Vector3 } from 'three'\n\n/**\n * God-rays (crepuscular rays)\n *\n * Similar implementation to the one used by Crytek for CryEngine 2 [Sousa2008].\n * Blurs a mask generated from the depth map along radial lines emanating from the light\n * source. The blur repeatedly applies a blur filter of increasing support but constant\n * sample count to produce a blur filter with large support.\n *\n * My implementation performs 3 passes, similar to the implementation from Sousa. I found\n * just 6 samples per pass produced acceptible results. The blur is applied three times,\n * with decreasing filter support. The result is equivalent to a single pass with\n * 6*6*6 = 216 samples.\n *\n * References:\n *\n * Sousa2008 - Crysis Next Gen Effects, GDC2008, http://www.crytek.com/sites/default/files/GDC08_SousaT_CrysisEffects.ppt\n */\n\nexport const GodRaysDepthMaskShader = {\n uniforms: {\n tInput: {\n value: null,\n },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n varying vec2 vUv;\n\n uniform sampler2D tInput;\n\n void main() {\n\n \tgl_FragColor = vec4( 1.0 ) - texture2D( tInput, vUv );\n\n }\n `,\n}\n\n/**\n * The god-ray generation shader.\n *\n * First pass:\n *\n * The depth map is blurred along radial lines towards the \"sun\". The\n * output is written to a temporary render target (I used a 1/4 sized\n * target).\n *\n * Pass two & three:\n *\n * The results of the previous pass are re-blurred, each time with a\n * decreased distance between samples.\n */\n\nexport const GodRaysGenerateShader = {\n uniforms: {\n tInput: {\n value: null,\n },\n fStepSize: {\n value: 1.0,\n },\n vSunPositionScreenSpace: {\n value: /* @__PURE__ */ new Vector3(),\n },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n #define TAPS_PER_PASS 6.0\n\n varying vec2 vUv;\n\n uniform sampler2D tInput;\n\n uniform vec3 vSunPositionScreenSpace;\n uniform float fStepSize; // filter step size\n\n void main() {\n\n // delta from current pixel to \"sun\" position\n\n \tvec2 delta = vSunPositionScreenSpace.xy - vUv;\n \tfloat dist = length( delta );\n\n // Step vector (uv space)\n\n \tvec2 stepv = fStepSize * delta / dist;\n\n // Number of iterations between pixel and sun\n\n \tfloat iters = dist/fStepSize;\n\n \tvec2 uv = vUv.xy;\n \tfloat col = 0.0;\n\n // This breaks ANGLE in Chrome 22\n //\t- see http://code.google.com/p/chromium/issues/detail?id=153105\n\n /*\n\t\t// Unrolling didnt do much on my hardware (ATI Mobility Radeon 3450),\n\t\t// so ive just left the loop\n\n\t\tfor ( float i = 0.0; i < TAPS_PER_PASS; i += 1.0 ) {\n\n\t\t// Accumulate samples, making sure we dont walk past the light source.\n\n\t\t// The check for uv.y < 1 would not be necessary with \"border\" UV wrap\n\t\t// mode, with a black border color. I dont think this is currently\n\t\t// exposed by three.js. As a result there might be artifacts when the\n\t\t// sun is to the left, right or bottom of screen as these cases are\n\t\t// not specifically handled.\n\n\t\tcol += ( i <= iters && uv.y < 1.0 ? texture2D( tInput, uv ).r : 0.0 );\n\t\tuv += stepv;\n\n\t\t}\n\t\t*/\n\n // Unrolling loop manually makes it work in ANGLE\n\n \tfloat f = min( 1.0, max( vSunPositionScreenSpace.z / 1000.0, 0.0 ) ); // used to fade out godrays\n\n \tif ( 0.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 1.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 2.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 3.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 4.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n \tif ( 5.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;\n \tuv += stepv;\n\n // Should technically be dividing by iters but TAPS_PER_PASS smooths out\n // objectionable artifacts, in particular near the sun position. The side\n // effect is that the result is darker than it should be around the sun, as\n // TAPS_PER_PASS is greater than the number of samples actually accumulated.\n // When the result is inverted (in the shader godrays_combine this produces\n // a slight bright spot at the position of the sun, even when it is occluded.\n\n \tgl_FragColor = vec4( col/TAPS_PER_PASS );\n \tgl_FragColor.a = 1.0;\n\n }\n `,\n}\n\n/**\n * Additively applies god rays from texture tGodRays to a background (tColors).\n * fGodRayIntensity attenuates the god rays.\n */\n\nexport const GodRaysCombineShader = {\n uniforms: {\n tColors: {\n value: null,\n },\n\n tGodRays: {\n value: null,\n },\n\n fGodRayIntensity: {\n value: 0.69,\n },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n varying vec2 vUv;\n\n uniform sampler2D tColors;\n uniform sampler2D tGodRays;\n\n uniform float fGodRayIntensity;\n\n void main() {\n\n // Since THREE.MeshDepthMaterial renders foreground objects white and background\n // objects black, the god-rays will be white streaks. Therefore value is inverted\n // before being combined with tColors\n\n \tgl_FragColor = texture2D( tColors, vUv ) + fGodRayIntensity * vec4( 1.0 - texture2D( tGodRays, vUv ).r );\n \tgl_FragColor.a = 1.0;\n\n }\n `,\n}\n\n/**\n * A dodgy sun/sky shader. Makes a bright spot at the sun location. Would be\n * cheaper/faster/simpler to implement this as a simple sun sprite.\n */\n\nexport const GodRaysFakeSunShader = {\n uniforms: {\n vSunPositionScreenSpace: {\n value: /* @__PURE__ */ new Vector3(),\n },\n\n fAspect: {\n value: 1.0,\n },\n\n sunColor: {\n value: /* @__PURE__ */ new Color(0xffee00),\n },\n\n bgColor: {\n value: /* @__PURE__ */ new Color(0x000000),\n },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n varying vec2 vUv;\n\n uniform vec3 vSunPositionScreenSpace;\n uniform float fAspect;\n\n uniform vec3 sunColor;\n uniform vec3 bgColor;\n\n void main() {\n\n \tvec2 diff = vUv - vSunPositionScreenSpace.xy;\n\n // Correct for aspect ratio\n\n \tdiff.x *= fAspect;\n\n \tfloat prop = clamp( length( diff ) / 0.5, 0.0, 1.0 );\n \tprop = 0.35 * pow( 1.0 - prop, 3.0 );\n\n \tgl_FragColor.xyz = ( vSunPositionScreenSpace.z > 0.0 ) ? mix( sunColor, bgColor, 1.0 - prop ) : bgColor;\n \tgl_FragColor.w = 1.0;\n\n }\n `,\n}\n"],"names":[],"mappings":";AAoBO,MAAM,yBAAyB;AAAA,EACpC,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EAEA;AAAA;AAAA,IAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWzB;AAAA;AAAA,IAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW7B;AAiBO,MAAM,wBAAwB;AAAA,EACnC,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,OAAO;AAAA,IACT;AAAA,IACA,WAAW;AAAA,MACT,OAAO;AAAA,IACT;AAAA,IACA,yBAAyB;AAAA,MACvB,2BAA2B,QAAQ;AAAA,IACrC;AAAA,EACF;AAAA,EAEA;AAAA;AAAA,IAAy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AAA,MAAM,QAAQ;AAAA,IAC3C;AAAA,IAEA,SAAS;AAAA,MACP,OAA2B,oBAAA,MAAM,CAAQ;AAAA,IAC3C;AAAA,EACF;AAAA,EAEA;AAAA;AAAA,IAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWzB;AAAA;AAAA,IAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyB7B;"}
@@ -8,7 +8,7 @@
8
8
  * - "h" and "v" parameters should be set to "1 / width" and "1 / height"
9
9
  */
10
10
  import type { IUniform, Texture } from 'three';
11
- import type { IShader } from './types.d.ts';
11
+ import type { IShader } from './types';
12
12
  export type HorizontalBlurShaderUniforms = {
13
13
  tDiffuse: IUniform<Texture | null>;
14
14
  h: IUniform<number>;
@@ -1,4 +1,4 @@
1
- import type { Color } from 'three';
1
+ import { Color } from 'three';
2
2
  /**
3
3
  * Luminosity
4
4
  * http://en.wikipedia.org/wiki/Luminosity
@@ -1,4 +1,4 @@
1
- import type { Vector2 } from 'three';
1
+ import { Vector2 } from 'three';
2
2
  /**
3
3
  * Normal map shader
4
4
  * - compute normals from heightmap
@@ -56,7 +56,7 @@ const ParallaxShader = {
56
56
  float initialHeight = texture2D( bumpMap, vUv ).r;
57
57
 
58
58
  // No Offset Limitting: messy, floating output at grazing angles.
59
- //"vec2 texCoordOffset = parallaxScale * V.xy / V.z * initialHeight;",
59
+ //vec2 texCoordOffset = parallaxScale * V.xy / V.z * initialHeight;
60
60
 
61
61
  // Offset Limiting
62
62
  vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;
@@ -1 +1 @@
1
- {"version":3,"file":"ParallaxShader.cjs","sources":["../../src/shaders/ParallaxShader.ts"],"sourcesContent":["// Parallax Occlusion shaders from\n// http://sunandblackcat.com/tipFullView.php?topicid=28\n// No tangent-space transforms logic based on\n// http://mmikkelsen3d.blogspot.sk/2012/02/parallaxpoc-mapping-and-no-tangent.html\n\nexport const ParallaxShader = {\n // Ordered from fastest to best quality.\n modes: {\n none: 'NO_PARALLAX',\n basic: 'USE_BASIC_PARALLAX',\n steep: 'USE_STEEP_PARALLAX',\n occlusion: 'USE_OCLUSION_PARALLAX', // a.k.a. POM\n relief: 'USE_RELIEF_PARALLAX',\n },\n\n uniforms: {\n bumpMap: { value: null },\n map: { value: null },\n parallaxScale: { value: null },\n parallaxMinLayers: { value: null },\n parallaxMaxLayers: { value: null },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n varying vec3 vViewPosition;\n varying vec3 vNormal;\n\n void main() {\n\n \tvUv = uv;\n \tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n \tvViewPosition = -mvPosition.xyz;\n \tvNormal = normalize( normalMatrix * normal );\n \tgl_Position = projectionMatrix * mvPosition;\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n uniform sampler2D bumpMap;\n uniform sampler2D map;\n\n uniform float parallaxScale;\n uniform float parallaxMinLayers;\n uniform float parallaxMaxLayers;\n\n varying vec2 vUv;\n varying vec3 vViewPosition;\n varying vec3 vNormal;\n\n #ifdef USE_BASIC_PARALLAX\n\n \tvec2 parallaxMap( in vec3 V ) {\n\n \t\tfloat initialHeight = texture2D( bumpMap, vUv ).r;\n\n // No Offset Limitting: messy, floating output at grazing angles.\n //\"vec2 texCoordOffset = parallaxScale * V.xy / V.z * initialHeight;\",\n\n // Offset Limiting\n \t\tvec2 texCoordOffset = parallaxScale * V.xy * initialHeight;\n \t\treturn vUv - texCoordOffset;\n\n \t}\n\n #else\n\n \tvec2 parallaxMap( in vec3 V ) {\n\n // Determine number of layers from angle between V and N\n \t\tfloat numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );\n\n \t\tfloat layerHeight = 1.0 / numLayers;\n \t\tfloat currentLayerHeight = 0.0;\n // Shift of texture coordinates for each iteration\n \t\tvec2 dtex = parallaxScale * V.xy / V.z / numLayers;\n\n \t\tvec2 currentTextureCoords = vUv;\n\n \t\tfloat heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;\n\n // while ( heightFromTexture > currentLayerHeight )\n // Infinite loops are not well supported. Do a \"large\" finite\n // loop, but not too large, as it slows down some compilers.\n \t\tfor ( int i = 0; i < 30; i += 1 ) {\n \t\t\tif ( heightFromTexture <= currentLayerHeight ) {\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tcurrentLayerHeight += layerHeight;\n // Shift texture coordinates along vector V\n \t\t\tcurrentTextureCoords -= dtex;\n \t\t\theightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;\n \t\t}\n\n \t\t#ifdef USE_STEEP_PARALLAX\n\n \t\t\treturn currentTextureCoords;\n\n \t\t#elif defined( USE_RELIEF_PARALLAX )\n\n \t\t\tvec2 deltaTexCoord = dtex / 2.0;\n \t\t\tfloat deltaHeight = layerHeight / 2.0;\n\n // Return to the mid point of previous layer\n \t\t\tcurrentTextureCoords += deltaTexCoord;\n \t\t\tcurrentLayerHeight -= deltaHeight;\n\n // Binary search to increase precision of Steep Parallax Mapping\n \t\t\tconst int numSearches = 5;\n \t\t\tfor ( int i = 0; i < numSearches; i += 1 ) {\n\n \t\t\t\tdeltaTexCoord /= 2.0;\n \t\t\t\tdeltaHeight /= 2.0;\n \t\t\t\theightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;\n // Shift along or against vector V\n \t\t\t\tif( heightFromTexture > currentLayerHeight ) { // Below the surface\n\n \t\t\t\t\tcurrentTextureCoords -= deltaTexCoord;\n \t\t\t\t\tcurrentLayerHeight += deltaHeight;\n\n \t\t\t\t} else { // above the surface\n\n \t\t\t\t\tcurrentTextureCoords += deltaTexCoord;\n \t\t\t\t\tcurrentLayerHeight -= deltaHeight;\n\n \t\t\t\t}\n\n \t\t\t}\n \t\t\treturn currentTextureCoords;\n\n \t\t#elif defined( USE_OCLUSION_PARALLAX )\n\n \t\t\tvec2 prevTCoords = currentTextureCoords + dtex;\n\n // Heights for linear interpolation\n \t\t\tfloat nextH = heightFromTexture - currentLayerHeight;\n \t\t\tfloat prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;\n\n // Proportions for linear interpolation\n \t\t\tfloat weight = nextH / ( nextH - prevH );\n\n // Interpolation of texture coordinates\n \t\t\treturn prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );\n\n \t\t#else // NO_PARALLAX\n\n \t\t\treturn vUv;\n\n \t\t#endif\n\n \t}\n #endif\n\n vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {\n\n \tvec2 texDx = dFdx( vUv );\n \tvec2 texDy = dFdy( vUv );\n\n \tvec3 vSigmaX = dFdx( surfPosition );\n \tvec3 vSigmaY = dFdy( surfPosition );\n \tvec3 vR1 = cross( vSigmaY, surfNormal );\n \tvec3 vR2 = cross( surfNormal, vSigmaX );\n \tfloat fDet = dot( vSigmaX, vR1 );\n\n \tvec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );\n \tvec3 vProjVtex;\n \tvProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;\n \tvProjVtex.z = dot( surfNormal, viewPosition );\n\n \treturn parallaxMap( vProjVtex );\n }\n\n void main() {\n\n \tvec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );\n \tgl_FragColor = texture2D( map, mapUv );\n\n }\n `,\n}\n"],"names":[],"mappings":";;AAKO,MAAM,iBAAiB;AAAA;AAAA,EAE5B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,IACP,WAAW;AAAA;AAAA,IACX,QAAQ;AAAA,EACV;AAAA,EAEA,UAAU;AAAA,IACR,SAAS,EAAE,OAAO,KAAK;AAAA,IACvB,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esContent":["// Parallax Occlusion shaders from\n// http://sunandblackcat.com/tipFullView.php?topicid=28\n// No tangent-space transforms logic based on\n// http://mmikkelsen3d.blogspot.sk/2012/02/parallaxpoc-mapping-and-no-tangent.html\n\nexport const ParallaxShader = {\n // Ordered from fastest to best quality.\n modes: {\n none: 'NO_PARALLAX',\n basic: 'USE_BASIC_PARALLAX',\n steep: 'USE_STEEP_PARALLAX',\n occlusion: 'USE_OCLUSION_PARALLAX', // a.k.a. POM\n relief: 'USE_RELIEF_PARALLAX',\n },\n\n uniforms: {\n bumpMap: { value: null },\n map: { value: null },\n parallaxScale: { value: null },\n parallaxMinLayers: { value: null },\n parallaxMaxLayers: { value: null },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n varying vec3 vViewPosition;\n varying vec3 vNormal;\n\n void main() {\n\n \tvUv = uv;\n \tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n \tvViewPosition = -mvPosition.xyz;\n \tvNormal = normalize( normalMatrix * normal );\n \tgl_Position = projectionMatrix * mvPosition;\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n uniform sampler2D bumpMap;\n uniform sampler2D map;\n\n uniform float parallaxScale;\n uniform float parallaxMinLayers;\n uniform float parallaxMaxLayers;\n\n varying vec2 vUv;\n varying vec3 vViewPosition;\n varying vec3 vNormal;\n\n #ifdef USE_BASIC_PARALLAX\n\n \tvec2 parallaxMap( in vec3 V ) {\n\n \t\tfloat initialHeight = texture2D( bumpMap, vUv ).r;\n\n // No Offset Limitting: messy, floating output at grazing angles.\n //vec2 texCoordOffset = parallaxScale * V.xy / V.z * initialHeight;\n\n // Offset Limiting\n \t\tvec2 texCoordOffset = parallaxScale * V.xy * initialHeight;\n \t\treturn vUv - texCoordOffset;\n\n \t}\n\n #else\n\n \tvec2 parallaxMap( in vec3 V ) {\n\n // Determine number of layers from angle between V and N\n \t\tfloat numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );\n\n \t\tfloat layerHeight = 1.0 / numLayers;\n \t\tfloat currentLayerHeight = 0.0;\n // Shift of texture coordinates for each iteration\n \t\tvec2 dtex = parallaxScale * V.xy / V.z / numLayers;\n\n \t\tvec2 currentTextureCoords = vUv;\n\n \t\tfloat heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;\n\n // while ( heightFromTexture > currentLayerHeight )\n // Infinite loops are not well supported. Do a \"large\" finite\n // loop, but not too large, as it slows down some compilers.\n \t\tfor ( int i = 0; i < 30; i += 1 ) {\n \t\t\tif ( heightFromTexture <= currentLayerHeight ) {\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tcurrentLayerHeight += layerHeight;\n // Shift texture coordinates along vector V\n \t\t\tcurrentTextureCoords -= dtex;\n \t\t\theightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;\n \t\t}\n\n \t\t#ifdef USE_STEEP_PARALLAX\n\n \t\t\treturn currentTextureCoords;\n\n \t\t#elif defined( USE_RELIEF_PARALLAX )\n\n \t\t\tvec2 deltaTexCoord = dtex / 2.0;\n \t\t\tfloat deltaHeight = layerHeight / 2.0;\n\n // Return to the mid point of previous layer\n \t\t\tcurrentTextureCoords += deltaTexCoord;\n \t\t\tcurrentLayerHeight -= deltaHeight;\n\n // Binary search to increase precision of Steep Parallax Mapping\n \t\t\tconst int numSearches = 5;\n \t\t\tfor ( int i = 0; i < numSearches; i += 1 ) {\n\n \t\t\t\tdeltaTexCoord /= 2.0;\n \t\t\t\tdeltaHeight /= 2.0;\n \t\t\t\theightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;\n // Shift along or against vector V\n \t\t\t\tif( heightFromTexture > currentLayerHeight ) { // Below the surface\n\n \t\t\t\t\tcurrentTextureCoords -= deltaTexCoord;\n \t\t\t\t\tcurrentLayerHeight += deltaHeight;\n\n \t\t\t\t} else { // above the surface\n\n \t\t\t\t\tcurrentTextureCoords += deltaTexCoord;\n \t\t\t\t\tcurrentLayerHeight -= deltaHeight;\n\n \t\t\t\t}\n\n \t\t\t}\n \t\t\treturn currentTextureCoords;\n\n \t\t#elif defined( USE_OCLUSION_PARALLAX )\n\n \t\t\tvec2 prevTCoords = currentTextureCoords + dtex;\n\n // Heights for linear interpolation\n \t\t\tfloat nextH = heightFromTexture - currentLayerHeight;\n \t\t\tfloat prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;\n\n // Proportions for linear interpolation\n \t\t\tfloat weight = nextH / ( nextH - prevH );\n\n // Interpolation of texture coordinates\n \t\t\treturn prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );\n\n \t\t#else // NO_PARALLAX\n\n \t\t\treturn vUv;\n\n \t\t#endif\n\n \t}\n #endif\n\n vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {\n\n \tvec2 texDx = dFdx( vUv );\n \tvec2 texDy = dFdy( vUv );\n\n \tvec3 vSigmaX = dFdx( surfPosition );\n \tvec3 vSigmaY = dFdy( surfPosition );\n \tvec3 vR1 = cross( vSigmaY, surfNormal );\n \tvec3 vR2 = cross( surfNormal, vSigmaX );\n \tfloat fDet = dot( vSigmaX, vR1 );\n\n \tvec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );\n \tvec3 vProjVtex;\n \tvProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;\n \tvProjVtex.z = dot( surfNormal, viewPosition );\n\n \treturn parallaxMap( vProjVtex );\n }\n\n void main() {\n\n \tvec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );\n \tgl_FragColor = texture2D( map, mapUv );\n\n }\n `,\n}\n"],"names":[],"mappings":";;AAKO,MAAM,iBAAiB;AAAA;AAAA,EAE5B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,IACP,WAAW;AAAA;AAAA,IACX,QAAQ;AAAA,EACV;AAAA,EAEA,UAAU;AAAA,IACR,SAA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54
54
  float initialHeight = texture2D( bumpMap, vUv ).r;
55
55
 
56
56
  // No Offset Limitting: messy, floating output at grazing angles.
57
- //"vec2 texCoordOffset = parallaxScale * V.xy / V.z * initialHeight;",
57
+ //vec2 texCoordOffset = parallaxScale * V.xy / V.z * initialHeight;
58
58
 
59
59
  // Offset Limiting
60
60
  vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;
@@ -1 +1 @@
1
- {"version":3,"file":"ParallaxShader.js","sources":["../../src/shaders/ParallaxShader.ts"],"sourcesContent":["// Parallax Occlusion shaders from\n// http://sunandblackcat.com/tipFullView.php?topicid=28\n// No tangent-space transforms logic based on\n// http://mmikkelsen3d.blogspot.sk/2012/02/parallaxpoc-mapping-and-no-tangent.html\n\nexport const ParallaxShader = {\n // Ordered from fastest to best quality.\n modes: {\n none: 'NO_PARALLAX',\n basic: 'USE_BASIC_PARALLAX',\n steep: 'USE_STEEP_PARALLAX',\n occlusion: 'USE_OCLUSION_PARALLAX', // a.k.a. POM\n relief: 'USE_RELIEF_PARALLAX',\n },\n\n uniforms: {\n bumpMap: { value: null },\n map: { value: null },\n parallaxScale: { value: null },\n parallaxMinLayers: { value: null },\n parallaxMaxLayers: { value: null },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n varying vec3 vViewPosition;\n varying vec3 vNormal;\n\n void main() {\n\n \tvUv = uv;\n \tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n \tvViewPosition = -mvPosition.xyz;\n \tvNormal = normalize( normalMatrix * normal );\n \tgl_Position = projectionMatrix * mvPosition;\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n uniform sampler2D bumpMap;\n uniform sampler2D map;\n\n uniform float parallaxScale;\n uniform float parallaxMinLayers;\n uniform float parallaxMaxLayers;\n\n varying vec2 vUv;\n varying vec3 vViewPosition;\n varying vec3 vNormal;\n\n #ifdef USE_BASIC_PARALLAX\n\n \tvec2 parallaxMap( in vec3 V ) {\n\n \t\tfloat initialHeight = texture2D( bumpMap, vUv ).r;\n\n // No Offset Limitting: messy, floating output at grazing angles.\n //\"vec2 texCoordOffset = parallaxScale * V.xy / V.z * initialHeight;\",\n\n // Offset Limiting\n \t\tvec2 texCoordOffset = parallaxScale * V.xy * initialHeight;\n \t\treturn vUv - texCoordOffset;\n\n \t}\n\n #else\n\n \tvec2 parallaxMap( in vec3 V ) {\n\n // Determine number of layers from angle between V and N\n \t\tfloat numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );\n\n \t\tfloat layerHeight = 1.0 / numLayers;\n \t\tfloat currentLayerHeight = 0.0;\n // Shift of texture coordinates for each iteration\n \t\tvec2 dtex = parallaxScale * V.xy / V.z / numLayers;\n\n \t\tvec2 currentTextureCoords = vUv;\n\n \t\tfloat heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;\n\n // while ( heightFromTexture > currentLayerHeight )\n // Infinite loops are not well supported. Do a \"large\" finite\n // loop, but not too large, as it slows down some compilers.\n \t\tfor ( int i = 0; i < 30; i += 1 ) {\n \t\t\tif ( heightFromTexture <= currentLayerHeight ) {\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tcurrentLayerHeight += layerHeight;\n // Shift texture coordinates along vector V\n \t\t\tcurrentTextureCoords -= dtex;\n \t\t\theightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;\n \t\t}\n\n \t\t#ifdef USE_STEEP_PARALLAX\n\n \t\t\treturn currentTextureCoords;\n\n \t\t#elif defined( USE_RELIEF_PARALLAX )\n\n \t\t\tvec2 deltaTexCoord = dtex / 2.0;\n \t\t\tfloat deltaHeight = layerHeight / 2.0;\n\n // Return to the mid point of previous layer\n \t\t\tcurrentTextureCoords += deltaTexCoord;\n \t\t\tcurrentLayerHeight -= deltaHeight;\n\n // Binary search to increase precision of Steep Parallax Mapping\n \t\t\tconst int numSearches = 5;\n \t\t\tfor ( int i = 0; i < numSearches; i += 1 ) {\n\n \t\t\t\tdeltaTexCoord /= 2.0;\n \t\t\t\tdeltaHeight /= 2.0;\n \t\t\t\theightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;\n // Shift along or against vector V\n \t\t\t\tif( heightFromTexture > currentLayerHeight ) { // Below the surface\n\n \t\t\t\t\tcurrentTextureCoords -= deltaTexCoord;\n \t\t\t\t\tcurrentLayerHeight += deltaHeight;\n\n \t\t\t\t} else { // above the surface\n\n \t\t\t\t\tcurrentTextureCoords += deltaTexCoord;\n \t\t\t\t\tcurrentLayerHeight -= deltaHeight;\n\n \t\t\t\t}\n\n \t\t\t}\n \t\t\treturn currentTextureCoords;\n\n \t\t#elif defined( USE_OCLUSION_PARALLAX )\n\n \t\t\tvec2 prevTCoords = currentTextureCoords + dtex;\n\n // Heights for linear interpolation\n \t\t\tfloat nextH = heightFromTexture - currentLayerHeight;\n \t\t\tfloat prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;\n\n // Proportions for linear interpolation\n \t\t\tfloat weight = nextH / ( nextH - prevH );\n\n // Interpolation of texture coordinates\n \t\t\treturn prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );\n\n \t\t#else // NO_PARALLAX\n\n \t\t\treturn vUv;\n\n \t\t#endif\n\n \t}\n #endif\n\n vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {\n\n \tvec2 texDx = dFdx( vUv );\n \tvec2 texDy = dFdy( vUv );\n\n \tvec3 vSigmaX = dFdx( surfPosition );\n \tvec3 vSigmaY = dFdy( surfPosition );\n \tvec3 vR1 = cross( vSigmaY, surfNormal );\n \tvec3 vR2 = cross( surfNormal, vSigmaX );\n \tfloat fDet = dot( vSigmaX, vR1 );\n\n \tvec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );\n \tvec3 vProjVtex;\n \tvProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;\n \tvProjVtex.z = dot( surfNormal, viewPosition );\n\n \treturn parallaxMap( vProjVtex );\n }\n\n void main() {\n\n \tvec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );\n \tgl_FragColor = texture2D( map, mapUv );\n\n }\n `,\n}\n"],"names":[],"mappings":"AAKO,MAAM,iBAAiB;AAAA;AAAA,EAE5B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,IACP,WAAW;AAAA;AAAA,IACX,QAAQ;AAAA,EACV;AAAA,EAEA,UAAU;AAAA,IACR,SAAS,EAAE,OAAO,KAAK;AAAA,IACvB,KAAK,EAAE,OAAO,KAAK;AAAA,IACnB,eAAe,EAAE,OAAO,KAAK;AAAA,IAC7B,mBAAmB,EAAE,OAAO,KAAK;AAAA,IACjC,mBAAmB,EAAE,OAAO,KAAK;AAAA,EACnC;AAAA,EAEA;AAAA;AAAA,IAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBzB;AAAA;AAAA,IAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6I7B;"}
1
+ {"version":3,"file":"ParallaxShader.js","sources":["../../src/shaders/ParallaxShader.ts"],"sourcesContent":["// Parallax Occlusion shaders from\n// http://sunandblackcat.com/tipFullView.php?topicid=28\n// No tangent-space transforms logic based on\n// http://mmikkelsen3d.blogspot.sk/2012/02/parallaxpoc-mapping-and-no-tangent.html\n\nexport const ParallaxShader = {\n // Ordered from fastest to best quality.\n modes: {\n none: 'NO_PARALLAX',\n basic: 'USE_BASIC_PARALLAX',\n steep: 'USE_STEEP_PARALLAX',\n occlusion: 'USE_OCLUSION_PARALLAX', // a.k.a. POM\n relief: 'USE_RELIEF_PARALLAX',\n },\n\n uniforms: {\n bumpMap: { value: null },\n map: { value: null },\n parallaxScale: { value: null },\n parallaxMinLayers: { value: null },\n parallaxMaxLayers: { value: null },\n },\n\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n varying vec3 vViewPosition;\n varying vec3 vNormal;\n\n void main() {\n\n \tvUv = uv;\n \tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n \tvViewPosition = -mvPosition.xyz;\n \tvNormal = normalize( normalMatrix * normal );\n \tgl_Position = projectionMatrix * mvPosition;\n\n }\n `,\n\n fragmentShader: /* glsl */ `\n uniform sampler2D bumpMap;\n uniform sampler2D map;\n\n uniform float parallaxScale;\n uniform float parallaxMinLayers;\n uniform float parallaxMaxLayers;\n\n varying vec2 vUv;\n varying vec3 vViewPosition;\n varying vec3 vNormal;\n\n #ifdef USE_BASIC_PARALLAX\n\n \tvec2 parallaxMap( in vec3 V ) {\n\n \t\tfloat initialHeight = texture2D( bumpMap, vUv ).r;\n\n // No Offset Limitting: messy, floating output at grazing angles.\n //vec2 texCoordOffset = parallaxScale * V.xy / V.z * initialHeight;\n\n // Offset Limiting\n \t\tvec2 texCoordOffset = parallaxScale * V.xy * initialHeight;\n \t\treturn vUv - texCoordOffset;\n\n \t}\n\n #else\n\n \tvec2 parallaxMap( in vec3 V ) {\n\n // Determine number of layers from angle between V and N\n \t\tfloat numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );\n\n \t\tfloat layerHeight = 1.0 / numLayers;\n \t\tfloat currentLayerHeight = 0.0;\n // Shift of texture coordinates for each iteration\n \t\tvec2 dtex = parallaxScale * V.xy / V.z / numLayers;\n\n \t\tvec2 currentTextureCoords = vUv;\n\n \t\tfloat heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;\n\n // while ( heightFromTexture > currentLayerHeight )\n // Infinite loops are not well supported. Do a \"large\" finite\n // loop, but not too large, as it slows down some compilers.\n \t\tfor ( int i = 0; i < 30; i += 1 ) {\n \t\t\tif ( heightFromTexture <= currentLayerHeight ) {\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tcurrentLayerHeight += layerHeight;\n // Shift texture coordinates along vector V\n \t\t\tcurrentTextureCoords -= dtex;\n \t\t\theightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;\n \t\t}\n\n \t\t#ifdef USE_STEEP_PARALLAX\n\n \t\t\treturn currentTextureCoords;\n\n \t\t#elif defined( USE_RELIEF_PARALLAX )\n\n \t\t\tvec2 deltaTexCoord = dtex / 2.0;\n \t\t\tfloat deltaHeight = layerHeight / 2.0;\n\n // Return to the mid point of previous layer\n \t\t\tcurrentTextureCoords += deltaTexCoord;\n \t\t\tcurrentLayerHeight -= deltaHeight;\n\n // Binary search to increase precision of Steep Parallax Mapping\n \t\t\tconst int numSearches = 5;\n \t\t\tfor ( int i = 0; i < numSearches; i += 1 ) {\n\n \t\t\t\tdeltaTexCoord /= 2.0;\n \t\t\t\tdeltaHeight /= 2.0;\n \t\t\t\theightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;\n // Shift along or against vector V\n \t\t\t\tif( heightFromTexture > currentLayerHeight ) { // Below the surface\n\n \t\t\t\t\tcurrentTextureCoords -= deltaTexCoord;\n \t\t\t\t\tcurrentLayerHeight += deltaHeight;\n\n \t\t\t\t} else { // above the surface\n\n \t\t\t\t\tcurrentTextureCoords += deltaTexCoord;\n \t\t\t\t\tcurrentLayerHeight -= deltaHeight;\n\n \t\t\t\t}\n\n \t\t\t}\n \t\t\treturn currentTextureCoords;\n\n \t\t#elif defined( USE_OCLUSION_PARALLAX )\n\n \t\t\tvec2 prevTCoords = currentTextureCoords + dtex;\n\n // Heights for linear interpolation\n \t\t\tfloat nextH = heightFromTexture - currentLayerHeight;\n \t\t\tfloat prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;\n\n // Proportions for linear interpolation\n \t\t\tfloat weight = nextH / ( nextH - prevH );\n\n // Interpolation of texture coordinates\n \t\t\treturn prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );\n\n \t\t#else // NO_PARALLAX\n\n \t\t\treturn vUv;\n\n \t\t#endif\n\n \t}\n #endif\n\n vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {\n\n \tvec2 texDx = dFdx( vUv );\n \tvec2 texDy = dFdy( vUv );\n\n \tvec3 vSigmaX = dFdx( surfPosition );\n \tvec3 vSigmaY = dFdy( surfPosition );\n \tvec3 vR1 = cross( vSigmaY, surfNormal );\n \tvec3 vR2 = cross( surfNormal, vSigmaX );\n \tfloat fDet = dot( vSigmaX, vR1 );\n\n \tvec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );\n \tvec3 vProjVtex;\n \tvProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;\n \tvProjVtex.z = dot( surfNormal, viewPosition );\n\n \treturn parallaxMap( vProjVtex );\n }\n\n void main() {\n\n \tvec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );\n \tgl_FragColor = texture2D( map, mapUv );\n\n }\n `,\n}\n"],"names":[],"mappings":"AAKO,MAAM,iBAAiB;AAAA;AAAA,EAE5B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,IACP,WAAW;AAAA;AAAA,IACX,QAAQ;AAAA,EACV;AAAA,EAEA,UAAU;AAAA,IACR,SAAS,EAAE,OAAO,KAAK;AAAA,IACvB,KAAK,EAAE,OAAO,KAAK;AAAA,IACnB,eAAe,EAAE,OAAO,KAAK;AAAA,IAC7B,mBAAmB,EAAE,OAAO,KAAK;AAAA,IACjC,mBAAmB,EAAE,OAAO,KAAK;AAAA,EACnC;AAAA,EAEA;AAAA;AAAA,IAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBzB;AAAA;AAAA,IAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6I7B;"}
@@ -1,6 +1,6 @@
1
- import type { Matrix4, Vector2 } from 'three';
1
+ import { Matrix4, Vector2 } from 'three';
2
2
  import type { IUniform, Texture } from 'three';
3
- import type { IShader } from './types.d.ts';
3
+ import type { IShader } from './types';
4
4
  export type SAOShaderDefines = Record<'DEPTH_PACKING' | 'DIFFUSE_TEXTURE' | 'NORMAL_TEXTURE' | 'NUM_RINGS' | 'NUM_SAMPLES' | 'PERSPECTIVE_CAMERA', number>;
5
5
  export type SAOShaderUniforms = {
6
6
  bias: IUniform<number>;
@@ -1,4 +1,4 @@
1
- import type { Vector2 } from 'three';
1
+ import { Vector2 } from 'three';
2
2
  /**
3
3
  * WebGL port of Subpixel Morphological Antialiasing (SMAA) v2.8
4
4
  * Preset: SMAA 1x Medium (with color edge detection)