-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
Migration Guide
WestLangley edited this page Jul 26, 2024
·
670 revisions
Updating in steps helps manage API changes, as deprecation warnings last for 10 releases
- The TSL function
uniforms()
has been renamed touniformArray()
.
- The imports of
WebGPURenderer
and TSL have changed. Please read https://github.com/mrdoob/three.js/pull/28650 for all details. -
HDRJPGLoader
has been removed. UseUltraHDRLoader
to load Ultra HDR .jpg files. - The script
utils/packLDrawModel.js
has been renamed toutils/packLDrawModel.mjs
.
- When adding a new geometry to
BatchedMesh
you must now calladdInstance
to enable the object to render.
- The signature of
WebGLRenderer.copyTextureToTexture()
andWebGLRenderer.copyTextureToTexture3D()
has changed. It is nowcopyTextureToTexture( srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0 )
. For more information, check out the examples webgl_materials_texture_partialupdate and webgl2_materials_texture3d_partialupdate. - The signature of
WebGLRenderer.copyFramebufferToTexture()
has changed. It is nowcopyFramebufferToTexture( texture, position = null, level = 0 )
. For more information, check out the example webgl_framebuffer_texture.
-
LWOLoader
uses a new conversion from left to right-handed coordinate system now. That means imported LWO assets will be oriented differently than before. Check out #28029 to see how the official example was updated to restore the previous look. - The async parse method of
USDZLoader
has been renamed toparseAsync()
. The newparse()
method can be used with classic callbacks. - The shader chunk
lightmap_fragment
has been removed. If your custom material relies on it, you have to inline the GLSL code into your shader. - The legacy
WebGLNodeBuilder
class has been removed which enabled a limited node material usage withWebGLRenderer
. The node material can only be used withWebGPURenderer
now.
-
WebGLRenderer
no longer supports WebGL 1. - The
stencil
context attribute ofWebGLRenderer
is nowfalse
by default for performance reasons. If you use stencil related logic in your app, you have to enablestencil
explicitly now. The correspondingstencil
property ofWebGPURenderer
is nowfalse
by default as well. - The
height
parameter ofTextGeometry
has been renamed todepth
. - To attenuate
Scene.environment
, use the new propertyScene.environmentIntensity
. TheenvMapIntensity
property ofMeshStandardMaterial
andMeshPhysicalMaterial
now attenuate only the material'senvMap
.
-
WebGLMultipleRenderTargets
has been removed. Use the newcount
property of the render target classes for MRT usage. - Hand-Tracking is not requested as an optional feature by default anymore. You have to do this manually on app level now like demonstrated in the related examples.
- The API of
InteractiveGroup
has been changed. You have to use the new methodslistenToXRControllerEvents()
andlistenToPointerEvents()
to register the internal event listeners. - When using an instance of
HTMLImageElement
for a texture, the renderer uses nownaturalWidth
andnaturalHeight
instead ofwidth
andheight
for computing the image dimensions. This enables simplifications on app level if the images are part of the DOM and resized with CSS.
- The build files
build/three.js
andbuild/three.min.js
have been removed. Please use ES Modules or alternatives: https://threejs.org/docs/index.html#manual/en/introduction/Installation -
WebGLRenderer
now specifies precision qualifiers for all GLSL sampler types. -
GroundProjectedSkybox
has been replaced withGroundedSkybox
. - When using equirectangular environment maps,
WebGLRenderer
automatically converts to the cube map format with a larger texture size now. This avoids undersampling resulting in blurry output but it requires more memory. If you encounter performance issues, decrease the resolution of your equirectangular environment map.
-
HBAOPass
has been replaced withGTAOPass
. -
Triangle.getBarycoord()
andTriangle.getInterpolation()
now returnnull
if the triangle is degenerate. (For degenerate triangles, thetarget
parameter is set to the zero-vector).
-
BatchedMesh.applyGeometry()
has been replaced withaddGeometry()
. -
BufferAttribute.updateRange
andInterleavedBuffer.updateRange
have been replaced withupdateRanges
. You can manage multiple update ranges with the new methodsaddUpdateRange()
andclearUpdateRanges()
. -
SkinnedMesh
is not supported with WebGL 1 anymore.
-
Quaternion
s are now expected to be normalized. - The material property
bumpScale
is now invariant to the scale of texture coordinates. That means bump maps look now the same regardless of the texture UV scale in world space. If you are using bump mapping, you likely have to update thebumpScale
value to achieve a similar look like before. More details in https://github.com/mrdoob/three.js/pull/26899.
-
AmbientLightProbe
andHemisphereLightProbe
have been removed. UseAmbientLight
orHemisphereLight
, instead. - The GLSL struct
GeometricContext
has been removed from the GLSL code base to make materials more compatible with Adreno mobile GPUs. When you patch shaders viaonBeforeCompile()
or reuse shader chunks with custom materials, you potentially have to remove references toGeometricContext
similar to https://github.com/mrdoob/three.js/pull/26805. -
AnimationUtils.arraySlice()
has been removed. Internal code uses the nativeTypedArray.slice()
method instead.
- The constructor of
FilmPass
has been changed. The parametersscanlinesIntensity
andscanlinesCount
have been removed. - The constructor of
SAOPass
has been changed. The parametersuseDepthTexture
anduseNormals
have been removed. -
SSAOPass
requires now the usage of a priorRenderPass
.
-
WebGLRenderer.useLegacyLights
is now set tofalse
by default and deprecated. Please read the following topic at the three.js forum for more information: Updates to lighting in three.js r155 - The inline tone mapping controlled via
WebGLRenderer.toneMapping
only works when rendering to screen now (similar toWebGLRenderer.outputColorSpace
). In context of post processing, useOutputPass
to apply tone mapping and color space conversion. - The constructor of
OutputPass
has no parameters anymore. Color space and tone mapping settings are now extracted from the renderer.
- The shader chunk
encodings_fragment
has been renamed tocolorspace_fragment
. - The shader chunk
output_fragment
has been renamed toopaque_fragment
.
- WebGL 1 support in
WebGLRenderer
is now deprecated and will be removed in r163. - The default render target texture type in context of post-processing (
EffectComposer
) is nowTHREE.HalfFloatType
. -
AdaptiveToneMappingPass
has been removed. Consider to use the newOutputPass
for tone mapping and color space conversion. -
ColladaExporter
has been removed. -
PRWMLoader
has been removed. -
LightningStrike
andLightningStorm
have been removed. -
CubeTextureLoader
loads cube textures in sRGB color space by default now.
- The naming convention of
uv
buffer attributes has been changed.uv
,uv2
,uv3
anduv4
are nowuv
,uv1
,uv2
anduv3
. -
WebGLRenderer.outputEncoding
has been replaced withWebGLRenderer.outputColorSpace
withTHREE.SRGBColorSpace
as the default value. -
Texture.encoding
has been replaced withTexture.colorSpace
withTHREE.NoColorSpace
as the default value. -
THREE.sRGBEncoding
is nowTHREE.SRGBColorSpace
. -
THREE.LinearEncoding
is nowTHREE.LinearSRGBColorSpace
. -
THREE.ColorManagement.enabled
is nowtrue
by default. - It's now necessary to define the
renderOrder
property for loaded shapes viaSVGLoader
.
For more information, please see the Updates to Color Management in three.js r152 guide.
-
Float16BufferAttribute
now automatically converts values to and from half float in its setters/getters. -
SkinnedMesh.boneTransform()
has been renamed toapplyBoneTransform()
. -
InstancedMesh.frustumCulled
is nowtrue
by default sinceInstancedMesh
now supports bounding volume computations. If you update the transformation of your instances, make sure to callcomputeBoundingSphere()
to recompute the bounding sphere which is required for correct view frustum culling and ray casting. -
MapControls
is now located in its own module filethree/addons/controls/MapControls.js
. - Tween.js is now imported via
import TWEEN from 'three/addons/libs/tween.module.js';
. -
Triangle.getUV()
has been renamed toTriangle.getInterpolation()
. -
GroundProjectedEnv
has been renamed toGroundProjectedSkybox
. -
BufferGeometryUtils.mergeBufferAttributes()
has been renamed toBufferGeometryUtils.mergeAttributes()
. -
BufferGeometryUtils.mergeBufferGeometries()
has been renamed toBufferGeometryUtils.mergeGeometries()
. - The editor now uses the physically correct lighting mode (
WebGLRenderer.useLegacyLights = false
). -
Points
now supports texture coordinates. When auv
attribute is present in the geometry, the shader will use it to sample the color or alpha value frommap
oralphaMap
for a single point. Without auv
attribute, point clouds are rendered as before. -
ShaderMaterial.forceSinglePass
is nowtrue
by default. -
aoMap
andlightMap
no longer useuv2
. Setmaterial.lightMap.channel
to0
foruv
and1
foruv2
. Consequently, theuv2_*
shader chunks have been removed.
- The build files
build/three.js
andbuild/three.min.js
are deprecated with r150+, and will be removed with r160. Please use ES Modules or alternatives: https://threejs.org/docs/index.html#manual/en/introduction/Installation -
BasisTextureLoader
has been removed. Use Basis Universal compression in KTX2 (.ktx2) files withKTX2Loader
instead. -
ColorManagement.legacyMode=false
is nowColorManagement.enabled=true
. -
WebGLRenderer.physicallyCorrectLights = true
is nowWebGLRenderer.useLegacyLights = false
.
-
Euler.DefaultOrder
has been renamed toEuler.DEFAULT_ORDER
. -
Euler.RotationOrders
has been removed. -
Object3D.DefaultUp
has been renamed toObject3D.DEFAULT_UP
. -
Object3D.DefaultMatrixAutoUpdate
has been renamed toObject3D.DEFAULT_MATRIX_AUTO_UPDATE
. -
Object3D.DefaultMatrixWorldAutoUpdate
has been renamed toObject3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE
. -
ViewHelper.controls
has been removed. Use the newcenter
property to define the helper's center. -
THREE.TwoPassDoubleSide
has been removed. Double-sided, transparent materials are now rendered with two draw calls by default. This behavior can be disabled by settingMaterial.forceSinglePass
totrue
.
- The
examples/js
directory has been removed. Addons likeGLTFLoader
orOrbitControls
are now only available as ES6 modules in theexamples/jsm
directory. Certain library files fromexamples/js/libs
are moved toexamples/jsm/libs
. Users of ammo.js, Draco and Basis have to update their import paths (e.g. from/examples/js/libs/draco/
to/examples/jsm/libs/draco/
). Also check out the Installation guide in the documentation if you are using ES6 modules for the first time. - The default
radial
values ofCircleGeometry
,RingGeometry
,CylinderGeometry
,ConeGeometry
andTorusGeometry
have been increased. -
GLTFLoader
now ensures the node order in loaded scenes matches the node order in the glTF asset. -
Material.side = DoubleSide
no longer renders a transparent object in separate front and back passes. UseTwoPassDoubleSide
for two-pass transparent rendering.
- The
decay
property ofPointLight
andSpotLight
has now a physically correct default value (2
). This change will affect all scenes using point and spot lights with no defineddecay
. Set the property back to1
if you want to restore the previous behavior. -
BufferAttribute.onUploadCallback()
is now executed every time buffer data are transferred to the GPU. - Support for the
KHR_materials_pbrSpecularGlossiness
extensions has been removed fromGLTFLoader
andGLTFExporter
. Older glTF assets should be losslessly converted from spec/gloss to metal/rough. -
PixelShader
has been removed. Usepostprocessing/RenderPixelatedPass
instead. -
numConstructionSteps
andconstructionStep
ofLDrawLoader
have been renamed tonumBuildingSteps
andbuildingStep
.
- The
resolution
constructor parameter ofBloomPass
has been removed. - The
width
andheight
settings of theparams
constructor parameter ofBokehPass
have been removed. -
BufferGeometryUtils.mergeBufferGeometries()
does not honorBufferGeometry.userData
anymore. - The
cube
shader inShaderLib
has different uniforms now.envMap
is nowtCube
,flipEnvMap
is nowtFlip
and all other uniforms except ofopacity
have been removed.
- The
truncateDrawRange
option has been removed fromGLTFExporter.parse()
. -
FlyControls
andFirstPersonControls
have been moved to Pointer Events API. - The
BufferGeometry
alias for geometry generators has been deprecated. Use e.g.BoxGeometry
instead ofBoxBufferGeometry
.
-
BufferGeometry.merge()
has been removed. UseBufferGeometryUtils.mergeBufferGeometries()
instead. -
copyColorsArray()
,copyVector2sArray()
,copyVector3sArray()
andcopyVector4sArray()
have been removed fromBufferAttribute
. -
MeshLambertMaterial
now uses per-fragment shading. Use the newMeshGouraudMaterial
inexamples/jsm/materials
if you need per-vertex shading. -
BufferAttribute
getters and setters (getX
,setX
, etc) now respect the normalized flag and transform values to and from normalized values when reading and writing to the underlying array. -
Scene.autoUpdate
has been replaced withObject3D.matrixWorldAutoUpdate
. - The
noHoles
parameter ofShapePath.toShapes()
has been removed.
- When importing
AnimationUtils
fromsrc/animation/AnimationUtils.js
(instead ofthree.module.js
), the import is nowimport * as AnimationUtils from '/src/animation/AnimationUtils.js';
. -
PCDLoader
now always uses white as the default material color.
- When importing
DataUtils
fromsrc/extras/DataUtils.js
(instead ofthree.module.js
), the import is nowimport * as DataUtils from '/src/extras/DataUtils.js';
.
- The
embedImages
option ofGLTFExporter.parse()
has been removed. - Legacy code is going to be removed from the core after ten releases now. If you plan to upgrade
three.js
in an existing project, try to avoid too large upgrade steps. For example don't upgrade fromr70
tor140
but do it in a more incremental fashion instead (r70
->r80
->r90
etc.). - The parameter
selectionBox
has been removed fromSelectionHelper
's constructor. - The default
type
ofDepthTexture
is nowUnsignedIntType
. - The
url
parameter ofPCDLoader.parse()
has been removed. The loader does not extract the file name from the URL anymore. - The deprecated
Geometry
class has been removed.
-
SkinnedMesh
requires floating point vertex textures now. - The
fog
property has been moved from the abstractMaterial
class to materials which actually support it.
-
CubeUVRefractionMapping
andMeshStandardMaterial.refractionRatio
have been removed. Use the transmission related properties ofMeshPhysicalMaterial
if you want to model refraction with a PBR material.
-
WebGLMultisampleRenderTarget
has been removed. To use multisampling as before, useWebGLRenderTarget
and set the newsamples
property to a value greater0
. - The node material in
examples/jsm/nodes
has been replaced with a new implementation. -
ColladaLoader
,KMZLoader
andPLYLoader
require a sRGB workflow now. -
OBJExporter
,ColladaExporter
andPLYExporter
produce assets with sRGB encoded colors now. -
VRMLoader
has been removed. Use three-vrm instead. - The second argument of
GLTFLoader
'sparser.loadTextureImage()
has been changed from image source definition to image source index. -
Euler.toVector3()
has been removed. UseVector3.setFromEuler()
instead. -
DataTexture3D
has been renamed toData3DTexture
. -
DataTexture2DArray
has been renamed toDataArrayTexture
. -
WebGLRenderTarget.setTexture()
has been removed. - The import of
CurveExtras
has been changed. It is nowimport * as Curves from ...
instead ofimport { Curves } from ...
.
-
WebGLRenderer
now creates the WebGL context with an alpha channel regardless of the value ofalpha
passed in the constructor. However, the value ofalpha
is still used by the renderer when clearing the context first thing every frame. -
RGBFormat
has been removed. Please useRGBAFormat
instead. -
RGBIntegerFormat
has been removed. Please useRGBAIntegerFormat
instead. -
UnsignedShort565Type
has been removed. Please useUnsignedShort5551Type
instead. -
BasisTextureLoader
has been deprecated. Please useKTX2Loader
instead. - The
SRGB8_ALPHA8_ASTC*
texture formats have been removed. If you want to use sRGB ASTC formats, use the regularRGBA_ASTC_*
formats and set theencoding
texture property tosRGBEncoding
. - With WebGL 2 uncompressed sRGB encoded textures have to use the
RGBAFormat
withUnsignedByteType
now. -
RoughnessMipmapper
has been removed. -
Material.format
has been removed. -
GLTFExporter
does not supportRGBFormat
anymore. Please useRGBAFormat
instead. - The default texture format of
VideoTexture
is nowRGBAFormat
(instead ofRGBFormat
). - sRGB decode in GLSL has been removed. sRGB texture always have to use
RGBAFormat
+UnsignedByteType
format now. - The ES6 import of
three.js
andexamples/jsm
modules in web sites now requires the usage of an import map to resolve thethree
bare import specifier. - The ES6 import of
examples/jsm
andexamples/fonts
in certain bundlers like esbuild now requires an extension on filenames. -
OBJ/MTLLoader
requires a sRGB workflow now. - Changing
Material.transparent
after its initial use requires settingneedsUpdate
totrue
.
- HDR workflows with WebGL 1 now require half float texture extension support (
OES_texture_half_float
/OES_texture_half_float_linear
). - If you create an instance of
DataTexture
,DataTexture2DArray
orDataTexture3D
, you have to setneedsUpdate
totrue
as soon as the texture data are ready. -
WebGLRenderer.copyFramebufferToTexture()
has to be used with the new classFramebufferTexture
now. - ETC1 texture compression can now only be used with a WebGL 1 rendering context.
- The
keydown
event listener ofArcballControls
has been removed. You have to implement it on app level if necessary. -
ArcballControls.setTarget()
has been removed. Update thetarget
property instead. - When changing
WebGLRenderer.toneMapping
, it is no longer necessary to setMaterial.needsUpdate
totrue
. -
EXRLoader
no longer supports the data typeUnsignedByteType
. Use the default data typeHalfFloatType
instead. -
PMREMGenerator
now uses half float render targets internally, and no longer usesRGBEEncoding
. -
RGBM7Encoding
andRGBM16Encoding
have been removed. It is still possible to load RGBM texture as FP16 or FP32 textures. The defaulttype
isHalfFloatType
. -
RGBEEncoding
andRGBEFormat
have been removed.RGBELoader
andHDRCubeTextureLoader
no longer support the data typeUnsignedByteType
. It is still possible to load RGBE texture as FP16 or FP32 textures. The defaulttype
isHalfFloatType
. -
RGBDEncoding
has been removed. -
WebGLRenderer.gammaFactor
andTHREE.GammaEncoding
have been removed. Please use post processing (a gamma correction pass) if you need a special gamma color space.
-
dat.gui
has been replaced withlil-gui
. - The dimensions, format and type of a texture cannot be changed after the initial use now.
-
GLTFExporter.parse()
has a new signature. The third parameter is now an error callback. The exporter options are now passed in as the fourth argument. -
LogLuvEncoding
has been removed. Please use the newLogLuvLoader
for loading Logluv TIFF HDR images as (half precision) floating point textures.
-
DeviceOrientationControls
has been removed. -
ImmediateRenderObject
has been removed. -
OrbitControls
no longer supports zooming (via mouse wheel) while rotating. -
FileLoader
now usesfetch
instead ofXMLHttpRequest
.
- The
recursive
parameter ofRaycaster.intersectObject()
andRaycaster.intersectObjects()
is nowtrue
by default. - Some default values of
ExtrudeGeometry
's parameters have changed.depth
is now1
,bevelThickness
is now0.2
andbevelSize
is nowbevelThickness - 0.1
. -
ParametricGeometry
has been removed from core. It is now located inexamples/jsm/geometries/ParametricGeometry.js
. -
TextGeometry
has been removed from core. It is now located inexamples/jsm/geometries/TextGeometry.js
. -
FontLoader
andFont
have been removed from core. Both classes are now located inexamples/jsm/loaders/FontLoader.js
.
-
BufferGeometryUtils
is now imported using this pattern:import * as BufferGeometryUtils from './jsm/utils/BufferGeometryUtils.js';
-
KTX2Loader
requires an updated version of the Basis Universal transcoder fromexamples/js/libs/basis
-
MeshPhysicalMaterial.sheen
has been renamed tosheenTint
. -
BufferGeometry.computeFaceNormals()
has been removed. The method was not implemented and just a stub. Calling it did not affect the geometry. -
MeshStandardMaterial
andMeshPhysicalMaterial
shaders are now more correct and may result in less shiny renders for models using rough materials.
- The
morphTargets
andmorphNormals
property of materials has been removed. -
MeshStandardMaterial.vertexTangents
has been removed. - The default
widthSegments
andheightSegment
properties ofSphereGeometry
have been increased to32
and16
. - The default type of textures loaded with
RGBELoader
,HDRCubeTextureLoader
andEXRLoader
is nowTHREE.HalfFloatType
. - The
envMap
property ofMeshStandardMaterial
andMeshPhysicalMaterial
is now internally converted to a PMREM. It might be necessary to update the scene's lighting if no PMREM was previously used.
- Controls no longer call
preventDefault()
on pointer and mouse events. -
DragControls
,OrbitControls
andTrackballControls
now use pointer events for touch interaction.
- The backward compatibility for the deprecated third and forth arguments
renderTarget
andforceClear
ofWebGLRenderer.render()
has been removed.- Use
WebGLRenderer.setRenderTarget()
andWebGLRenderer.clear()
instead.
- Use
- The
skinning
property of materials has been removed.- The same material can now be reused between
Mesh
andSkinnedMesh
.
- The same material can now be reused between
-
Matrix4.makeShear()
has a new signature. Please make a note of it.
- All central engine components like
Object3D
,BufferGeometry
orShaderMaterial
are now ES6 classes.- This might impact your application if you derive custom classes from
three.js
classes via ES5 syntax. In this case, you have to upgrade your code to ES6 or transpilethree.js
to ES5.
- This might impact your application if you derive custom classes from
- The JavaScript code in
examples/js
generated from modules inexamples/jsm
is now based on ES6.- If you need ES5 code in your project, update the configuration in .babelrc.json and regenerate
examples/js
by usingnpm run build-examples
. However, the better solution is to upgrade your code to ES6.
- If you need ES5 code in your project, update the configuration in .babelrc.json and regenerate
- NPM: ES6 modules in
examples/jsm
now import using the bare specifierthree
.- This change breaks working with modules in cdns such as https://www.jsdelivr.com/ and https://unpkg.com/. Please use https://www.skypack.dev/ instead.
-
XLoader
has been removed.
- Controls no longer use
stopPropagation()
in their event listeners. In certain use cases event listeners on application level are now able to process events (which was not possible before). -
Scene.background
no longer supports instances ofWebGLCubeRenderTarget
. Please assign thetexture
property of render targets. -
WebGLRenderer.setFramebuffer()
has been removed. -
AssimpLoader
has been removed. -
Plane.intersectLine()
now returnsnull
when no intersection was found. -
WebGLRenderer.maxMorphTargets
andWebGLRenderer.maxMorphNormals
have been removed. - When using
EventDispatcher
,event.target
is only valid for the duration of the listener callback now.
- TypeScript type declaration files have been moved to three-types/three-ts-types.
-
Face3
has been removed from core. It is now located inexamples/jsm/deprecated/Geometry.js
. -
Ocean
andOceanShaders
have been removed. -
polyfills.js
has been removed. The polyfills forArray.from()
,Function.name
,Number.EPSILON
,Number.isInteger
,Math.log2
,Math.sign
andObject.assign()
need to be added at application level for IE11 support: misc_legacy. -
CSS3DRenderer
no longer supports IE11. -
WebGLRenderer
now setsgl.UNPACK_COLORSPACE_CONVERSION_WEBGL
togl.NONE
. Embedded color space data (ICC-profiles) in texture images will now be ignored.
-
Geometry
has been removed from the core. It is now located inexamples/jsm/deprecated/Geometry.js
. - Geometry generators like
BoxGeometry
now produce aBufferGeometry
. -
Mesh
,Line
andPoints
no longer support raycasting withGeometry
. -
Line.computeLineDistances()
no longer supportsGeometry
. - Exporters no longer support
Geometry
. -
DecalGeometry
,EdgesGeometry
,WireframeGeometry
,Projector
,LineGeometry
,LineSegmentsGeometry
,ConvexHull
,EdgeSplitModifier
andTessellateModifier
no longer supportGeometry
. -
ConvexBufferGeometry
has been removed. Similar toDecalGeometry
,ConvexGeometry
is now derived fromBufferGeometry
. -
TeapotBufferGeometry
has been renamed toTeapotGeometry
. -
RoundedBoxBufferGeometry
has been renamed toRoundedBoxGeometry
. -
3MFLoader
,AMFLoader
,EXRLoader
,FBXLoader
,KMZLoader
,NRRDLoader
,TiltLoader
andVTKLoader
now depend onfflate
. Other decompression libs (JSZip
andZLib
) are no longer used. -
SubdivisionModifier
has been removed. -
SimplifyModifier
no longer supportsGeometry
and now relies onBufferGeometryUtils
. -
OBJLoader2
has been removed. If you still need it, use this repository. -
OrbitControls
no longer listens to key events by default. You have to callOrbitControls.listenToKeyEvents()
if your app requires key controls. -
BufferGeometryUtils.computeTangents()
has been moved into the core. You can now useBufferGeometry.computeTangents()
. -
RectAreaLightHelper.update()
has been removed.
-
ColladaLoader
stores animation clips incollada.scene.animations
now. -
WebGLRenderer.getClearColor()
now expects a target argument. -
TypedArrayUtils
andwebgl_nearestneighbour
demo have been removed. - The converter scripts
fbx2three
andobj2three
have been removed.
-
Matrix3/4.getInverse()
has been deprecated. Please use the new method.invert()
with this pattern:matrixInv.copy( matrix ).invert();
. -
Quaternion.inverse()
has been renamed toQuaternion.invert()
. - The option
forcePowerOfTwoTextures
has been removed fromGLTFExporter
. - The first parameter of
DRACOExporter.parse()
is now of typeMesh
orPoints
. -
DragControls
now use Pointer Events. This change might require that you move your custom event listeners to Pointer Events, too.
-
ExplodeModifier
has been removed. -
Fire
and the respectivewebgl_fire
example have been removed.
- The
detail
parameter ofPolyhedronGeometry
is now more fine-grained. Meaning it can produce now more different subdivisions. -
LightShadow
has been removed from the public API. If you need to configure a custom shadow frustum for spot lights, use the newSpotLightShadow.focus
property. - Geometry generator classes are now located in their own files. For example
BoxGeometry
andBoxBufferGeometry
no longer share a single file and are now located insrc/geometries/BoxGeometry.js
andsrc/geometries/BoxBufferGeometry.js
. -
WebGLCubeRenderTarget.texture
is now of typeCubeTexture
. -
TimelinerController
and the respective examplemisc_animation_authoring
have been removed. -
TypedGeometryExporter
has been removed. - A performance improvement for
DRACOLoader
required an update of the DRACO library.
-
Scene.dispose()
has been removed. -
WebGLRenderTarget.stencilBuffer
andWebGLCubeRenderTarget.stencilBuffer
are now false by default. Enable the buffer by settingstencilBuffer: true
in the constructor options. - When using
ShaderMaterial
andRawShaderMaterial
, it's now necessary to set the newglslVersion
property toTHREE.GLSL3
if you want to write GLSL 3.0 shader code. The GLSL version directive is not allowed in custom shader code anymore. It's always added automatically by the engine. -
SpotLightShadow
andDirectionalLightShadow
have been removed from the public API. -
CannonPhysics
has been removed. -
OrbitControls
,TrackballControls
andTransformControls
now use Pointer Events. This change might require that you move your custom event listeners to Pointer Events, too.
-
MeshPhysicalMaterial.transparency
has been renamed toMeshPhysicalMaterial.transmission
.
-
SphericalReflectionMapping
is no longer supported. Consider using a Matcap texture withMeshMatcapMaterial
instead. -
WebGLRenderer.toneMappingWhitePoint
has been removed. -
Uncharted2ToneMapping
has been removed. However, it's now possible to define your own custom tone mapping function by usingCustomToneMapping
. Check out the tone mapping example for more information. -
WebGLRenderer
automatically creates a WebGL 2 rendering context now (and fallbacks to WebGL 1 if necessary). If your project can only use WebGL 1, you can use WebGL1Renderer. - The default value of
OrbitControls.screenSpacePanning
is nowtrue
. -
Water
can only be used when settingWebGLRenderer.outputEncoding
toTHREE.LinearEncoding
. -
shininess
,specular
andspecularMap
have been removed fromMeshToonMaterial
.
- The TypeScript declaration for
Texture.mipmaps
is nowany[]
instead ofImageData[]
. -
InstancedBufferGeometry.maxInstancedCount
has been renamed toInstancedBufferGeometry.instanceCount
. - The constructor of
CubeCamera
has changed. It now expects an instance of WebGLCubeRenderTarget as third parameter. The fourth parameteroptions
has been removed.
- The default value of
WebGLRenderer.toneMapping
is nowNoToneMapping
. -
Sphere.empty()
has been renamed toSphere.isEmpty()
. -
TranslucentShader
has been renamed toSubsurfaceScatteringShader
. -
PDBLoader
no longer returns raw bonds data in the JSON result. - The
options
parameter ofVRButton.createButton()
has been removed. Please set the reference space type viaWebGLRenderer.xr.setReferenceSpaceType()
instead.
- The
throwOnDegenerate
parameter ofMatrix3.getInverse()
andMatrix4.getInverse()
has been removed. In addition, the methods now return the zero matrix if one tries to invert a matrix having a determinant of zero. - The TypeScript declaration for
Geometry.boundingBox
andGeometry.boundingSphere
is now nullable, as it actually be. - The shader syntax
#pragma unroll_loop
is now deprecated. Use#pragma unroll_loop_start
/end
instead.
-
Material.vertexColors
is now a boolean. The default value isfalse
. -
Raycaster
honors now invisible 3D objects in intersection tests. Use the new property Raycaster.layers for selectively ignoring 3D objects during raycasting. -
GLTFLoader
now returns an instance ofGroup
instead ofScene
. -
GLTFLoader
now setsdepthWrite
tofalse
for transparent materials. - The
OBJ
andFBX
converters now require the esm npm package.
-
Math
has been renamed toMathUtils
, and/examples/js/utils/MathUtils.js
has been promoted to the core. -
WebGLRenderTargetCube
has been renamed toWebGLCubeRenderTarget
, and the constructor signature is nowWebGLCubeRenderTarget( size, options )
. -
Geometry.applyMatrix()
has been renamed toGeometry.applyMatrix4()
. -
BufferGeometry.applyMatrix()
has been renamed toBufferGeometry.applyMatrix4()
. -
Object3D.applyMatrix()
has been renamed toObject3D.applyMatrix4()
. -
LineSegmentsGeometry.applyMatrix()
has been renamed toLineSegmentsGeometry.applyMatrix4()
. -
Frustum.setFromMatrix()
has been renamed toFrustum.setFromProjectionMatrix()
. -
RaytracingRenderer
has been removed. -
WebGLDeferredRenderer
has been removed. -
GammaCorrectionShader
converts tosRGB
now. - The color of the default material for
Mesh
,Points
,Line
, and all derived classes, is now white.
-
PMREMGenerator
has a new implementation and is now part of the core library. Check out the webgl_loader_gltf example to understand the new workflow. -
WebGLRenderer.gammaInput
has been removed. Set the encoding for textures viaTexture.encoding
instead. -
WebGLRenderer.gammaOutput
has been removed. Please useWebGLRenderer.outputEncoding
instead. -
MeshToonMaterial
does not support environment maps anymore. -
Mesh.drawMode
andMesh.setDrawMode()
have been removed.WebGLRenderer
does render meshes always withTHREE.TrianglesDrawMode
now. Please useBufferGeometryUtils.toTrianglesDrawMode()
to transformTHREE.TriangleStripDrawMode
andTHREE.TriangleFanDrawMode
of existing geometries toTHREE.TrianglesDrawMode
. -
TerrainShader
,SkinShader
andCarControls
have been removed. -
WebVR
support has been removed. Please useWebXR
instead. - The default value of
MeshStandardMaterial.roughness
has changed from0.5
to1
. - The default value of
MeshStandardMaterial.metalness
has changed from0.5
to0
. -
FaceNormalsHelper
,LightProbeHelper
,PositionalAudioHelper
,RectAreaLightHelper
,VertexNormalsHelper
andVertexTangentsHelper
are now part of the examples. - Instances of
BufferGeometry
require at least a position attribute or index now.
- The semantics of
Material.needsUpdate
has changed. Setting it totrue
now increases the internal version counter (similar toTexture
orBufferAttribute
). It's not possible anymore to useMaterial.needsUpdate
in conditional statements. -
LegacyGLTFLoader
andLegacyJSONLoader
have been removed. -
WebVRManager.setPoseTarget()
has been removed. -
WebVRManager
andWebXRManager
do no longer modify the camera when not presenting. - The default value of
Ray.direction
is now( 0, 0, - 1)
. - Instances of
BufferGeometry
require at least a position attribute now.
-
BufferAttribute.dynamic
andBufferAttribute.setDynamic()
have been deprecated. Please useBufferAttribute.usage
andBufferAttribute.setUsage()
instead. -
BufferGeometry.addAttribute()
has been renamed toBufferGeometry.setAttribute()
. -
BufferGeometry.removeAttribute()
has been renamed toBufferGeometry.deleteAttribute()
. -
CubemapGenerator
has been removed. Please useWebGLRenderTargetCube.fromEquirectangularTexture()
instead. -
EquirectangularToCubeGenerator
has been removed. Please useWebGLRenderTargetCube.fromEquirectangularTexture()
instead. - The second constructor parameter
domElement
ofOrbitControls
,TrackballControls
,TransformControls
,FlyControls
,PointerLockControls
andFirstPersonControls
is now mandatory. -
OrbitControls
andTrackballControls
do not supportdocument
as an argument fordomElement
anymore. Please use the canvas element of the renderer (renderer.domElement
) instead. -
Audio.startTime
has been removed. Please useAudio.play( delay )
instead. - When loading a
DataTexture
viaDataTextureLoader
, it's defaultminFilter
value is nowLinearFilter
. -
AssimpJSONLoader
has been removed. Please useAssimpLoader
instead. -
SoftwareRenderer
has been removed.
-
Loader.Handler
has been removed. UseLoadingManager
's.addHandler()
,.removeHandler()
and.getHandler()
instead. -
BabylonLoader
has been removed. -
PlayCanvasLoader
has been removed. -
AWDLoader
has been removed. -
SEA3DLoader
has been removed. -
EditorControls
is now located ineditor/js
. -
OrthographicTrackballControls
has been removed.TrackballControls
now supports orthographic cameras. -
BufferAttribute.setArray()
has been removed. - Displacement maps do not ignore the transformation of texture coordinates anymore.
- It's not necessary anymore to set
.needsUpdate
totrue
when creating aDataTexture
(assuming the data are provided at construction time as a constructor parameter). -
BoxGeometry
andBoxBufferGeometry
are now ES6 classes (except inthree.js
andthree.min.js
).
-
CTMLoader
has been removed. - In
MeshPhysicalMaterial
, renamed.clearCoat
to.clearcoat
and.clearCoatRoughness
to.clearcoatRoughness
. - Removed
.initMaterials()
and.createMaterial()
fromLoader
. - The obsolete callbacks
onLoadStart()
,onLoadProgress()
andonLoadComplete()
have been removed fromLoader
. -
DRACOLoader.setDecoderPath()
andDRACOLoader.setDecoderConfig()
are now instance methods.
- In the Texture Filter Constants,
MipMap
is nowMipmap
. For example,THREE.LinearMipMapLinearFilter
is nowTHREE.LinearMipmapLinearFilter
. - Renamed
WebGLRenderer.getActiveMipMapLevel()
toWebGLRenderer.getActiveMipmapLevel()
. -
WEBGL
(the namespace fromexamples/js/WebGL.js
) is now in theTHREE
namespace. -
WEBVR
(the namespace fromexamples/js/vr/WebVR.js
) is now in theTHREE
namespace. - The module
MapControls
is now part ofOrbitControls
. Check out the official example for more information. -
OrbitControls
andMapControls
now have a new default value fordampingFactor
. -
WebGLRenderer.context
has been removed. Please useWebGLRenderer.getContext()
instead. -
FBXLoader
now correctly sets the texture encoding. When using FBX assets in your scene, you have to setrenderer.gammaOutput = true;
(unless you need post-processing in linear colorspace). - When loading an FBX asset with TGA textures,
FBXLoader
requires now the following setup:THREE.Loader.Handlers.add( /\.tga$/i, new TGALoader() );
.
- All examples now use ES6 modules.
-
VRMLLoader
has a new implementation. It's necessary now to includechevrotain.min.js
into your code. Check out the official example for more details. - The optional
update
arg has been removed from the public API of the following methods:Euler.setFromRotationMatrix( m, order )
,Euler.setFromQuaternion( q, order )
, andQuaternion.setFromEuler( e )
. -
GPUParticleSystem
has been removed. -
DracoExporter
has been renamed toDRACOExporter
. - Objects of type
LOD
are now updated automatically byWebGLRenderer
. SetLOD.autoUpdate
tofalse
if you want to perform the update by yourself. - MTL related functions like
.loadMtl()
have been removed fromOBJLoader2
. Please useMTLLoader
andMtlObjBridge
as shown in basic obj2 example. -
OBJLoader2
has been removed fromexamples/js/loaders
. Please use the module version inexamples/jsm/loaders
.
-
WebGLRenderer.debug.checkShaderErrors
is nowtrue
by default. -
EffectComposer.setSize()
now respects the pixel ratio. An instance ofEffectComposer
can now be resized with the samewidth
andheight
values likeWebGLRenderer
. - Renamed
QuickHull
toConvexHull
. The file is now located inexamples/js/math
. -
SimplexNoise
andImprovedNoise
are now in theTHREE
namespace and located inexamples/js/math
. -
AnimationClipCreator
andTimelinerController
are now located inexamples/js/animation
. -
ParametricGeometries
is now located inexamples/js/geometries
. -
hilbert2d
andhilbert3D
were removed. Please useGeometryUtils.hilbert2D()
andGeometryUtils.hilbert3D()
instead.
- For performance reasons,
WebGLRenderer
does no longer perform error checking and reporting when shader programs are being compiled. You have to setrenderer.debug.checkShaderErrors
totrue
to restore the previous behavior. -
Object3D.applyMatrix()
now updates the local matrix ifObject3D.matrixAutoUpdate
is set totrue
.
- The
npm
scriptnpm run editor
was removed. The editor is now a Progressive Web App (PWA). - The callback parameter of
SVGLoader.onLoad()
is now an object (data
) containing the root node of the SVG document and an array ofShapePath
objects. Also, all paths are returned now (not only the ones withfill
color) - Removed
.allocTextureUnit()
,.setTexture2D()
,.setTexture()
and.setTextureCube()
fromWebGLRenderer
. These methods were never intended to be part ofWebGLRenderer
's public API and are now private (as a part ofWebGLTexture
).
- Removed
renderTarget
andforceClear
parameters fromWebGLRenderer.render()
. Please use.setRenderTarget()
and.clear()
instead before you perform the rendering. Be aware that it's now necessary to executerenderer.setRenderTarget( null )
in order to unset an active render target. - Removed
.activeCubeFace
and.activeMipMapLevel
fromWebGLRenderTargetCube
. They are now parameters ofWebGLRenderer.setRenderTarget()
. - In
WebGLRenderer.setViewport()
andWebGLRenderer.setScissor()
,(x, y)
is the coordinate of the lower left corner of the rectangular region. -
WebGLRenderer.getSize()
now requires aVector2
argument. -
WebGLRenderer.getCurrentViewport()
now requires aVector4
argument.
- Added
FirstPersonControls.lookAt()
.lat
,lon
,phi
,theta
andtarget
were removed from the public API.FirstPersonControls
also respects the initial camera orientation now. -
MeshStandardMaterial
andMeshPhysicalMaterial
now preserve energy for IBL lighting, resulting in brighter, more accurate colors for metallic materials with high roughness values when lit via a map generated by PMREMGenerator.
-
Octree
has been removed. - Removed
Geometry
support fromMesh.updateMorphTargets()
. UseBufferGeometry
instead. - The default orientation of
RectAreaLight
has changed. It now looks along the negative z-axis.
-
WebGLRenderTarget.texture.generateMipmaps
is now set tofalse
by default. - There is a new (not backwards compatible) implementation for
SSAOShader
andSSAOPass
. -
JSONLoader
has been removed from core. It is now located inexamples/js/loaders/deprecated/LegacyJSONLoader.js
. - Removed
Geometry
support fromObjectLoader
. You have to includeLegacyJSONLoader
if you still want to load geometry data of typeGeometry
. - Removed
Geometry
support fromSkinnedMesh
. UseBufferGeometry
instead. - Removed
SkinnedMesh.initBones()
. TheSkinnedMesh
constructor does not build the bone hierarchy anymore. You have to do this by yourself and then call SkinnedMesh.bind() in order to bind the prepared skeleton.
- Renamed
ObjectLoader.setTexturePath()
toObjectLoader.setResourcePath()
. AddedObjectLoader.setPath()
. -
CanvasRenderer
has been removed. - The order of
LoadingManager
's callbacks has changed.onError()
is now called beforeonLoad()
.
- Removed
BinaryLoader
. -
WebGLRenderer.clearTarget()
is now deprecated. UseWebGLRenderer.setRenderTarget()
in combination withWebGLRenderer.clear()
instead. - Renamed
JSONLoader.setTexturePath()
toJSONLoader.setResourcePath()
. - Renamed
MTLLoader.setTexturePath()
toMTLLoader.setResourcePath()
. -
GLTFLoader.setPath()
is now used for the original glTF file. UseGLTFLoader.setResourcePath()
if you want to change the path for resources like textures. -
TDSLoader.setPath()
is now used for the original 3DS file. UseTDSLoader.setResourcePath()
if you want to change the path for resources like textures. - Refactored
PointerLockControls
. Please have a look at the official example to see the new API. -
Detector.js
was refactored toWebGL.js
.
-
Object3D.lookAt()
now supports rotated parents. -
EquirectangularToCubeGenerator
constructor args have changed.
-
OrbitControls.mouseButtons
key-value pairs have been renamed. Please make a note of it if you wish to change the mouse button bindings. -
BufferSubdivisionModifier
has been removed. UseSubdivisionModifier
instead. - Sprites are now rendered concurrently with opaque and transparent objects.
- Keyframe tracks are no longer automatically validated and optimized. Users need to explicitly call
.validate/optimize()
. - Renamed shader chunk
lights_pars_maps
toenvmap_physical_pars_fragment
.
-
TDSLoader
now producesBufferGeometry
. -
MD2Loader
now producesBufferGeometry
. -
XLoader
now producesBufferGeometry
. - Removed deprecated CTM, FBX, msgpack and UTF8 converters.
- Removed deprecated
UTF8Loader
. - Renamed
EquiangularToCubeGenerator
toEquirectangularToCubeGenerator
. - Removed deprecated
VRControls
andVREffect
. -
DaydreamController
andGearVRController
are now deprecated. The new directory of these file isexamples/js/vr/deprecated/
.
- Renamed option
amount
todepth
inExtrudeBufferGeometry
. - The Blender exporter has been removed. See #12903 and #14117 for more information. Also have a look at the new guide Loading 3D models.
-
STLBinaryExporter
has been removed. It's now part ofSTLExporter
. - Renamed
WebGLRenderer.animate()
toWebGLRenderer.setAnimationLoop()
.
- Removed option
frames
fromExtrudeBufferGeometry
. - Removed
.getArrays()
fromExtrudeBufferGeometry
. - Removed
.addShapeList()
fromExtrudeBufferGeometry
. - Removed
.addShape()
fromExtrudeBufferGeometry
. -
ExtrudeGeometry.WorldUVGenerator
is now private. -
SVGLoader
now parses SVG input and returns an array ofShapePath
objects.
-
Geometry.center()
andBufferGeometry.center()
now returnthis
instead ofoffset
. -
optionalTarget
s are now mandatory method parameters (with exception of curve classes). - Split
ShaderChunk.lights_pars
intoShaderChunks.lights_pars_begin
andShaderChunks.lights_pars_maps
. - Split
ShaderChunk.lights_template
intoShaderChunks.lights_fragment_begin
,ShaderChunnks.lights_fragment_maps
andShaderChunks.lights_fragment_end
. - Split
ShaderChunk.normal_fragment
intoShaderChunks.normal_fragment_begin
andShaderChunks.normal_fragment_maps
. - The semantics of
AnimationAction.repetition
has changed. The first run of the animation is now taken into account. - Removed
copyIndicesArray()
fromBufferAttribute
. - Removed
getWorldRotation()
fromObject3D
. - Renamed
Triangle.area()
toTriangle.getArea()
. - Renamed
Triangle.barycoordFromPoint()
toTriangle.getBarycoord()
. - Renamed
Triangle.midpoint()
toTriangle.getMidpoint()
. - Renamed
Triangle.normal()
toTriangle.getNormal()
. - Renamed
Triangle.plane()
toTriangle.getPlane()
. - Removed options
material
andextrudeMaterial
fromExtrudeGeometry
. - Removed
vertices
fromrenderer.info.render
. - BasicDepthPacking: Depth values at the near plane are now encoded as white. Depth values at the far plane as black.
-
Lensflare
has been moved out of the core. Please use examples/js/objects/Lensflare.js if you need lens flares in your scene. Also have a look at the official example to see the new usage ofLensflare
. -
SceneUtils
has been moved out of the core. It is now located at examples/js/utils/SceneUtils.js. - Removed
.shadowMap.renderReverseSided
fromWebGLRenderer
. SetMaterial.shadowSide
instead. - Removed
.shadowMap.renderSingleSided
fromWebGLRenderer
. SetMaterial.shadowSide
instead. - Removed
.setFaceCulling()
fromWebGLRenderer
. - Removed the JSON exporters for Maya and 3ds Max.
- Removed
.computeLineDistances()
fromGeometry
. UseLine.computeLineDistances()
instead.
-
ImageUtils
has been removed. - Removed
extractUrlBase()
fromLoader
. UseLoaderUtils.extractUrlBase()
instead. -
ShapeUtils.triangulateShape()
uses a new and more robust polygon triangulation algorithm now. -
ShapeUtils.triangulate()
has been removed. -
Reflector
,Refractor
,Water
andWater2
accept now any planar geometry and not only rectangular ones. The respective constructors have a new signature.
-
CombinedCamera
has been removed. -
ColladaLoader2
has replacedColladaLoader
. -
VRMLLoader
now producesBufferGeometry
. -
OBJLoader2
has a new dependencyLoaderSupport
(see example). -
WebVR.js
was rewritten. Check out the corresponding examples to see the new API. - Renamed
CatmullRomCurve3
'stype
tocurveType
. - Removed
createPointsGeometry()
fromCurvePath
. Check out this example to see how to create a geometry from a series of points. - Removed
createSpacedPointsGeometry()
fromCurvePath
. - Removed
createGeometry()
fromCurvePath
. - Renamed
Path
'sfromPoints()
tosetFromPoints()
. - Removed
extractAllPoints()
fromShape
. - Renamed
Mirror
toReflector
. - Renamed
lengthManhattan()
ofVector2
,Vector3
andVector4
tomanhattanLength()
. - Renamed
distanceToManhattan()
ofVector2
andVector3
tomanhattanDistanceTo()
. - Renamed
AxisHelper
toAxesHelper
.
-
GLTF2Loader
has replacedGLTFLoader
. - The result of the
onLoad
callback ofPDBLoader
has changed. Please have a look at the corresponding example. -
AssimpLoader
now usesLoadingManager
. - Removed
setPreferredShading()
fromColladaLoader
.
- Removed deprecated
Animation
,AnimationHandler
andKeyFrameAnimation
- Swapped y in setViewport() and setScissor()
-
MultiMaterial
has been removed. Use an Array instead. - Removed
multiplyToArray()
fromMatrix4
. - Removed deprecated
SceneLoader
. -
BoxHelper update()
no longer has arguments. Use.setFromObject()
to assign a different object to the helper. -
BoxHelper
no longer supports objects of typeBox3
. -
DecalGeometry
now produces aBufferGeometry
.
- Removed
applyToVector3Array()
fromMatrix3
. - Removed
applyToVector3Array()
fromMatrix4
. - Removed
Spline
. UseCatmullRomCurve3
instead. - Removed
SplineCurve3
. UseCatmullRomCurve3
instead. - Removed
applyProjection()
fromVector3
. UseapplyMatrix4()
instead. - Renamed
Vector2
'sfromAttribute()
tofromBufferAttribute()
. - Renamed
Vector3
'sfromAttribute()
tofromBufferAttribute()
. - Renamed
Vector4
'sfromAttribute()
tofromBufferAttribute()
. - Renamed
BinaryTextureLoader
toDataTextureLoader
. - Changed
Matrix4
'smakeFrustum()
tomakePerspective()
.
-
STLLoader
now produces aBufferGeometry
. -
PDBLoader
now produces aBufferGeometry
. -
AssimpJSONLoader
now produces aBufferGeometry
. - Renamed
Matrix3
'sapplyToBuffer()
toapplyToBufferAttribute()
. - Renamed
Matrix4
'sapplyToBuffer()
toapplyToBufferAttribute()
. -
BoundingBoxHelper
has been removed. UseBoxHelper
instead. - Renamed
XHRLoader
toFileLoader
.
-
PLYLoader
now produces aBufferGeometry
. - The
taper
parameter inTubeGeometry
has been removed.
- Renamed
Box2
'scenter()
togetCenter()
. - Renamed
Box2
'ssize()
togetSize()
. - Renamed
Box3
'scenter()
togetCenter()
. - Renamed
Box3
'ssize()
togetSize()
. - Renamed
Line3
'scenter()
togetCenter()
.
-
THREE.GridHelper
:setColors()
removed, pass them in the constructor instead:new THREE.GridHelper( size, step, color1, color2 )
.
-
THREE.Audio
.load
deprecated, use newTHREE.AudioLoader
instead. - Uniforms no longer need a
.type
property. - The uniform
boneGlobalMatrices
has been renamed toboneMatrices
.
- Changed
Vector3
'ssetFromMatrixColumn(index, m)
tosetFromMatrixColumn(m, index)
. - Removed
WebGLRenderTarget
'sshareDepthFrom
.
- Renamed
enableScissorTest
tosetScissorTest
. - Renamed
shadowBias
toshadow.bias
. - Renamed
shadowMapWidth
toshadow.mapSize.width
. - Renamed
shadowMapHeight
toshadow.mapSize.height
. - Renamed
shadowCameraNear
toshadow.camera.near
. - Renamed
shadowCameraFar
toshadow.camera.far
. - Renamed
shadowCameraFov
toshadow.camera.fov
. - Removed
shadowDarkness
. Add aTHREE.AmbientLight
to your scene instead. - Removed
ClosedSplineCurve3
. UseCatmullRomCurve3
withclosed
set totrue
. - Removed
MeshPhongMaterial
'smetal
. - Renamed
Box2
'sempty()
toisEmpty()
. - Renamed
Box3
'sempty()
toisEmpty()
.
- Removed
morphColors
fromGeometry
. - Removed
clampBottom
fromMath
. -
FontUtils
andTextGeometry
moved out of core. -
shadowDarkness
default value is now1
.
- Renamed
PointCloud
toPoints
. - Renamed
PointCloudMaterial
toPointsMaterial
. - Removed
computeTangents()
fromGeometry
andBufferGeometry
. - Moved all
shadowMap*
properties inWebGLRenderer
toshadowMap.*
. - Removed
BufferGeometry
'sdrawcall.index
. -
LineSegments( geometry, material )
should now be used instead ofLine( geometry, material, THREE.LinePieces )
.
- Removed
ambient
fromMaterial
. - Removed
recursive
parameter fromgetObjectBy*()
.
- Removed
sortParticles
fromPointCloud
. - Removed
renderDepth
fromObject3D
. -
UVMapping
,CubeReflectionMapping
,CubeRefractionMapping
,SphericalReflectionMapping
andSphericalRefractionMapping
are no longer functions.
-
WebGLRenderer
'sinitMaterial
was made private. -
ColladaLoader
now returns aScene
instead of anObject3D
.
-
Object3D
'sposition
,rotation
,quaternion
andscale
properties are now immutable. -
BufferGeometry
'saddAttribute
method now takes aBufferAttribute
instead of the various attribute types (e.g.,Int16Attribute
,Float32Attribute
).
- Removed
Face3
'scentroid
. - Removed
Geometry
'scomputeCentroids()
. - Moved
GeometryUtils
'smerge
toGeometry
.
- Renamed
CubeGeometry
toBoxGeometry
. - Removed
dynamic
property fromBufferGeometry
.
- Removed
physicallyBasedShading
property fromWebGLRenderer
.
-
WebGLRenderer
background to opaque (black) by default. Pass{alpha=true}
when creating WebGLRenderer for previous default behaviour.
-
Particle
removed. UseSprite
instead. -
ParticleMaterial
removed. UseParticleSystemMaterial
orSpriteMaterial
.
-
Face4
removed. Use 2Face3
to emulate it. -
OrbitControls
'szoomIn()
andzoomOut()
renamed todollyIn()
anddollyOut()
.
-
Object3D.rotation
is now of typeTHREE.Euler
. - Removed
Object3D.useQuaternion
. The library now uses quaternions by default. However, there is some magic in place to keepObject3D
'srotation
(Euler
) working. - Moved
Object3D.eulerOrder
toObject3D.rotation.order
. - Moved
Object3D.defaultEulerOrder
toEuler.DefaultOrder
. - Removed
setGeometry()
andsetMaterial()
fromMesh
. - Removed
Vector3.setEulerFromRotationMatrix()
, useEuler.setFromRotationMatrix()
instead. - Removed
Vector3.setEulerFromQuaternion()
, useEuler.setFromQuaternion()
instead.
- Removed
Matrix4
'stranslate()
,rotateX()
,rotateY()
,rotateZ()
,rotateByAxis()
andcrossVector()
. - Removed
setClearColorHex()
fromCanvasRenderer
andWebGLRenderer
. UsesetClearColor()
instead. - Renamed
Matrix4
'sextractPosition()
tocopyPosition()
. - Renamed
Matrix4
'ssetRotationFrom*()
tomakeRotationFrom*()
. - Renamed
Matrix4
'scompose()
tomakeFromPositionQuaternionScale()
. - Renamed
Object3D
'sgetChildByName()
togetObjectByName()
. - Removed
Object3D
'smatrixRotationWorld
property.
- For
BufferGeometry
-
geometry.verticesNeedUpdate
togeometry.attributes.position.needsUpdate
-
geometry.elementsNeedUpdate
togeometry.attributes.index.needsUpdate
-
geometry.normalsNeedUpdate
togeometry.attributes.normal.needsUpdate
-
geometry.uvsNeedUpdate
togeometry.attributes.uv.needsUpdate
-
geometry.colorsNeedUpdate
togeometry.attributes.color.needsUpdate
-
geometry.tangentsNeedUpdate
togeometry.attributes.tangent.needsUpdate
-
*
->geometry.attributes.custom.needsUpdate
-
- Removed
Matrix4
'srotateAxis
. UseVector3.transformDirection( matrix )
instead. - Removed
AsteriskGeometry
. - Removed
Color
'ssetHSV
. UseColorConverter.setHSV( color, h, s, v )
instead. - Renamed
JSONLoader
'screateModel()
toparse()
.
- Removed
getPosition()
andgetColumn*()
fromMatrix4
-
Color.setHSV()
andColor.getHSV()
replaced by.setHSL()
and.getHSL()
- Replaced
ColorUtils.adjustHSV()
with Color's.offsetHSL()
- Renamed
Box3/Line3/Plane/Ray/Sphere
's.transform()
toapplyMatrix4()
-
Matrix3.multiplyVector3()
changed toVector3.applyMatrix3()
-
Matrix4.multiplyVector3()
changed toVector3.applyMatrix4()
andVector3.applyProjection()
-
Matrix4.multiplyVector4()
changed toVector4.applyMatrix4()
-
Quaternion.multiplyVector3()
changed toVector3.applyQuaternion()
- Renamed
Color
methods:-
.lerpSelf()
to.lerp()
-
- Renamed
Vector2
,Vector3
andVector4
methods:-
.add()
to.addVectors()
-
.addSelf()
to.add()
-
.sub()
to.subVectors()
-
.subSelf()
to.sub()
-
.cross()
to.crossVectors()
-
.crossSelf()
to.cross()
-
.minSelf()
to.min()
-
.maxSelf()
to.max()
-
.clampSelf()
to.clamp()
-
.lerpSelf()
to.lerp()
-
- Renamed
Matrix4
methods:-
.multiply()
to.multiplyMatrices()
-
.multiplySelf()
to.multiply()
-
- Renamed
Quaternion
methods:-
.multiply()
to.multiplyQuaternions()
-
.multiplySelf()
to.multiply()
-
- Renamed
Frustum
methods:-
.contains()
to.intersectsObject()
-
- Moved
GeometryUtils.explode
toExplodeModifier
- Moved
GeometryUtils.tessellate
toTessellateModifier
- Moved
ShaderUtils.lib
toShaderLib
-
Matrix4.makeTranslation
andMatrix4.makeScale
now take three scalars instead ofVector3
.
-
Sprite
material properties are now inSpriteMaterial
, used like thisnew THREE.Sprite( new THREE.SpriteMaterial( { color: 0xff0000, map: texture, alphaTest: 0.5 } ) )
. - Renamed migrated sprite material properies:
Sprite.affectedByDistance
=>SpriteMaterial.sizeAttenuation
andSprite.mergeWith3D
=>SpriteMaterial.depthTest
- Renamed
renderer.shadowMapCullFrontFaces
=>renderer.shadowMapCullFace
(default valuetrue
=>THREE.CullFaceFront
, other optionfalse
=>THREE.CullFaceBack
). - Renamed
color.getContextStyle
tocolor.getStyle
. - Moved
Ray
casting methods toRaycaster
. -
Rectangle
replaced withBox2
. -
UV
replaced withVector2
. This means.u
and.v
are now.x
and.y
. -
Matrix4.makeTranslation
andMatrix4.makeScale
now takeVector3
instead of three scalars. - Moved
SubdivisionModifier
out of the build toexamples/js/modifiers
. - Renamed and moved
Renderer.deallocateObject()
=>Geometry.dispose()
andBufferGeometry.dispose()
. - Renamed and moved
Renderer.deallocateRenderTarget()
=>WebGLRenderTarget.dispose()
.
-
Sprite
's size is no longer automatically based on the image size, usesprite.scale.set( imageWidth, imageHeight, 1.0 )
to achieve the old behavior -
SceneLoader
and scene format now usewidthSegments
,heightSegments
,depthSegments
instead ofsegmentsWidth
,segmentsHeight
,segmentsDepth
for definitions of plane, cube and sphere geometries -
SceneLoader
and scene format now usematerial
property with single material id string instead ofmaterials
array for meshes -
MeshPhongMaterial
now usesperPixel = true
by default -
WebGLRenderer
constructor doesn't use anymoremaxLights
parameter: shaders will be generated with the exact number of lights in the scene (it's now up to the application layer to make sure shaders compile on a particular system) -
ColorUtils.rgbToHsv()
got moved intoColor.getHSV()
-
Geometry
no longer has amaterials
property.MeshFaceMaterials
usage is now like this:new THREE.Mesh( geometry, new THREE.MeshFaceMaterial( [ material1, material2 ] ) )
. Meaning thatface.materialIndex
will map the array passed toMeshFaceMaterials
. - Loader callbacks which previously only had
geometry
parameter, are now also passed a second one:materials
:loader.load( 'file.js', function ( geometry, materials ) {} )
. -
GeometryUtils.clone()
is now a method inGeometry
.
-
ShaderExtras
have been split in a different files.CopyShader
,FXAAShader
,NormalShader
, etc - Replaced
SceneUtils.traverseHierarchy
withobject.traverse
. - Removed
SceneUtils.showHierarchy
. Useobject.traverse( function ( child ) { child.visible = false } )
instead. - Moved
*Controls
toexamples/js/controls
. - Split
SceneUtils.cloneObject
into*.clone()
-
CameraHelper
API changes: helper is not anymore child of camera, instead it uses reference to camera world matrix - texture uniform changes: texture units are now assigned automatically, texture object goes to
value
property instead oftexture
one{ type: "t", value: 0, texture: map }
=>{ type: "t", value: map }
-
normalScale
uniform in normal map shader is nowVector2
(to be able to invert separatelyx
andy
to deal with different tangent bases) -
CTMLoader.load
andCTMLoader.loadParts
now use single parameter object foruseWorker
anduseBuffers
:loader.load( url, callback, useWorker, useBuffers )
=>loader.load( url, callback, { useWorker: true, useBuffers: true } )
-
CTMLoader
now createsBufferGeometry
by default, setuseBuffers
parameter tofalse
if you needGeometry
- type for non-procedural geometries changed in the scene format:
ascii_mesh
=>ascii
,bin_mesh
=>binary
,embedded_mesh
=>embedded
-
UTF8Loader
(and compressor) were changed to a newer version, supporting more recent version of UTF8 format (r100+
); loader doesn't create anymore geometries but instead it returns hierarchy with potentially multiple meshes created per each material (or by splitting large model)
-
Vector3
's.getRotationFromMatrix( matrix, scale )
toVector3
's.setEulerFromRotationMatrix( matrix, order )
. -
Vector3
's.getEulerXYZFromQuaternion( quaternion )
and.getEulerYZXFromQuaternion( quaternion )
to.setEulerFromQuaternion( quaternion, order )
. -
DOMRenderer
andSVGRenderer
no longer included in common build. - texture coordinates aren't anymore flipped in the geometries, instead textures have
flipY
property (true by default); all models need to be re-exported / reconverted (tools have been updated as well).
workaround:uv.v = 1 - uv.v;
-
PlaneGeometry
changed back to vertical orientation (facing screen instead of laying on the ground).
workaround:mesh.rotation.x = - Math.PI / 2;
orgeometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );
-
doubleSided
/flipSided
properties moved fromObject3D
toMaterial
'sside
property (THREE.FrontSide
,THREE.BackSide
andTHREE.DoubleSide
). -
objectMatrix
in shaders was renamed tomodelMatrix
. - JIT caching removed from
Animation
. -
geometry.dynamic
is nowtrue
by default. -
Three.js
build renamed tothree.min.js
.
- changed
PlaneGeometry
from vertical to horizontal orientation. - renamed
__dirtyXXX
attribute properties toxxxNeedUpdate
. - removed
Vertex
class, useVector3
instead.
- Removed
intersectScene
fromRay
. UseintersectObjects( array )
instead.
-
loader.load( { model: url, callback: callback } )
toloader.load( url, callback )
.