Three Addons
A collection of Three.js addons.
Installation
npm install --save three-addons
or
yarn add three-addons
Usage
;; const scene = ;// ...const loader = ;loader;
Or if your bundler has Tree Shaking, you can just import everything:
;; const scene = ;// ...const loader = ;loader;
If you don't have a module bundler you can just drop it in the HTML after Three.js and you will be able to use it like this:
Instead, if you want to mindlessly paste the examples of Three.js and its addons you find online, you can just do this:
;;const THREE = ...THREEJS ...THREE_ADDONS ; // you can also use Object.assign() or lodash's _.assign() const scene = ;// ...const loader = ;loader;
But this pattern is not recommended, since it doesn't tell you which property belongs to Three.js and which one is an addon.
Addon structure
All the addons are taken from most used examples around the web, and wrapped with those two lines to make it exportable:
; // ...addon code AddonName;
Thanks to npm-three-js for the inspiration of this project and the full list of addons.
Here is the list of the addons present in this package:
AdaptiveToneMappingPass, BasicShader, BleachBypassShader, BlendShader, BloomPass, BokehPass, BokehShader, BokehShader2, BrightnessContrastShader, CanvasRenderer, ColorCorrectionShader, ColorifyShader, ConvolutionShader, CopyShader, DDSLoader, DOFMipMapShader, DigitalGlitch, DotScreenPass, DotScreenShader, EdgeShader, EdgeShader2, EffectComposer, FXAAShader, FilmPass, FilmShader, FocusShader, FresnelShader, GammaCorrectionShader, GlitchPass, HorizontalBlurShader, HorizontalTiltShiftShader, HueSaturationShader, KaleidoShader, LuminosityShader, MTLLoader, MarchingCubes, MaskPass, MirrorShader, NormalMapShader, OBJLoader, OceanShaders, OrbitControls, ParallaxShader, Projector, RGBShiftShader, RenderPass, SSAOShader, SVGLoader, SavePass, SepiaShader, ShaderPass, ShaderToon, TechnicolorShader, TexturePass, ToneMapShader, TriangleBlurShader, UnpackDepthRGBAShader, VerticalBlurShader, VerticalTiltShiftShader, VignetteShader, SobelOperatorShader.
NOTE: both CanvasRenderer and Projector are not available for now because the go in conflict with their respective deprecated warning exported from the main Three.js repo. Here is the source of that code.