Isto irá apagar a página "Migration-Guide"
. Por favor, certifique-se.
⚠️ When updating old projects, it's recommended to update the library in increments of 10 ⚠️
Updating in steps helps manage API changes, as deprecation warnings last for 10 releases
TransformControls
is now derived from Controls
. Instead of scene.add( controls )
, the visual representation of the controls have to be added to the scene via scene.add( controls.getGizmo() )
now.EXRExporter.parse()
is now async.KTX2Exporter.parse()
is now async.LightProbeGenerator.fromCubeRenderTarget()
is now async.PackedPhongMaterial
has been removed.SDFGeometryGenerator
has been removed.GPUStatsPanel
has been removed. Please use the package stats-gl
if you need more detailed performance monitoring.GeometryCompressionUtils
accept geometries instead of meshes now.WebGPURenderer
and TSL, certain chaining features of TSL have been removed. For example instead of doing outputPass.fxaa()
it is now fxaa( outputPass )
. Please have a look at #29187 for more information.viewportTopLeft
has been renamed to viewportUV
.viewportBottomLeft
has been removed. Use viewportUV.flipY()
instead.uniforms()
has been renamed to uniformArray()
.DragControls.activate()
and DragControls.deactivate()
have been renamed to connect()
and disconnect()
.DragControls.getObjects()
and DragControls.setObjects()
have been removed. Use controls.objects
instead.DragControls.getRaycaster()
has been removed. Use controls.raycaster
instead.PointerLockControls.getObject()
has been removed. Use controls.object
instead.LogLuvLoader
has been removed. Consider to switch to UltraHDRLoader
.WebGPURenderer
and TSL have changed. Please read https://github.com/mrdoob/three.js/pull/28650 for all details.HDRJPGLoader
has been removed. Use UltraHDRLoader
to load Ultra HDR .jpg files.utils/packLDrawModel.js
has been renamed to utils/packLDrawModel.mjs
.BatchedMesh
you must now call addInstance
to enable the object to render.WebGLRenderer.copyTextureToTexture()
and WebGLRenderer.copyTextureToTexture3D()
has changed. It is now copyTextureToTexture( srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0 )
. For more information, check out the examples webgl_materials_texture_partialupdate and webgl2_materials_texture3d_partialupdate.WebGLRenderer.copyFramebufferToTexture()
has changed. It is now copyFramebufferToTexture( 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.USDZLoader
has been renamed to parseAsync()
. The new parse()
method can be used with classic callbacks.lightmap_fragment
has been removed. If your custom material relies on it, you have to inline the GLSL code into your shader.WebGLNodeBuilder
class has been removed which enabled a limited node material usage with WebGLRenderer
. The node material can only be used with WebGPURenderer
now.WebGLRenderer
no longer supports WebGL 1.stencil
context attribute of WebGLRenderer
is now false
by default for performance reasons. If you use stencil related logic in your app, you have to enable stencil
explicitly now. The corresponding stencil
property of WebGPURenderer
is now false
by default as well.height
parameter of TextGeometry
has been renamed to depth
.Scene.environment
, use the new property Scene.environmentIntensity
. The envMapIntensity
property of MeshStandardMaterial
and MeshPhysicalMaterial
now attenuate only the material's envMap
.WebGLMultipleRenderTargets
has been removed. Use the new count
property of the render target classes for MRT usage.InteractiveGroup
has been changed. You have to use the new methods listenToXRControllerEvents()
and listenToPointerEvents()
to register the internal event listeners.HTMLImageElement
for a texture, the renderer uses now naturalWidth
and naturalHeight
instead of width
and height
for computing the image dimensions. This enables simplifications on app level if the images are part of the DOM and resized with CSS.build/three.js
and build/three.min.js
have been removed. Please use ES Modules or alternatives: https://threejs.org/docs/index.html#manual/en/introduction/InstallationWebGLRenderer
now specifies precision qualifiers for all GLSL sampler types.GroundProjectedSkybox
has been replaced with GroundedSkybox
.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 with GTAOPass
.Triangle.getBarycoord()
and Triangle.getInterpolation()
now return null
if the triangle is degenerate. (For degenerate triangles, the target
parameter is set to the zero-vector).BatchedMesh.applyGeometry()
has been replaced with addGeometry()
.BufferAttribute.updateRange
and InterleavedBuffer.updateRange
have been replaced with updateRanges
. You can manage multiple update ranges with the new methods addUpdateRange()
and clearUpdateRanges()
.SkinnedMesh
is not supported with WebGL 1 anymore.Quaternion
s are now expected to be normalized.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 the bumpScale
value to achieve a similar look like before. More details in https://github.com/mrdoob/three.js/pull/26899.AmbientLightProbe
and HemisphereLightProbe
have been removed. Use AmbientLight
or HemisphereLight
, instead.GeometricContext
has been removed from the GLSL code base to make materials more compatible with Adreno mobile GPUs. When you patch shaders via onBeforeCompile()
or reuse shader chunks with custom materials, you potentially have to remove references to GeometricContext
similar to https://github.com/mrdoob/three.js/pull/26805.AnimationUtils.arraySlice()
has been removed. Internal code uses the native TypedArray.slice()
method instead.FilmPass
has been changed. The parameters scanlinesIntensity
and scanlinesCount
have been removed.SAOPass
has been changed. The parameters useDepthTexture
and useNormals
have been removed.SSAOPass
requires now the usage of a prior RenderPass
.WebGLRenderer.useLegacyLights
is now set to false
by default and deprecated. Please read the following topic at the three.js forum for more information: Updates to lighting in three.js r155WebGLRenderer.toneMapping
only works when rendering to screen now (similar to WebGLRenderer.outputColorSpace
). In context of post processing, use OutputPass
to apply tone mapping and color space conversion.OutputPass
has no parameters anymore. Color space and tone mapping settings are now extracted from the renderer.encodings_fragment
has been renamed to colorspace_fragment
.output_fragment
has been renamed to opaque_fragment
.WebGLRenderer
is now deprecated and will be removed in r163.EffectComposer
) is now THREE.HalfFloatType
.AdaptiveToneMappingPass
has been removed. Consider to use the new OutputPass
for tone mapping and color space conversion.ColladaExporter
has been removed.PRWMLoader
has been removed.LightningStrike
and LightningStorm
have been removed.CubeTextureLoader
loads cube textures in sRGB color space by default now.uv
buffer attributes has been changed. uv
, uv2
, uv3
and uv4
are now uv
, uv1
, uv2
and uv3
.WebGLRenderer.outputEncoding
has been replaced with WebGLRenderer.outputColorSpace
with THREE.SRGBColorSpace
as the default value.Texture.encoding
has been replaced with Texture.colorSpace
with THREE.NoColorSpace
as the default value.THREE.sRGBEncoding
is now THREE.SRGBColorSpace
.THREE.LinearEncoding
is now THREE.LinearSRGBColorSpace
.THREE.ColorManagement.enabled
is now true
by default.renderOrder
property for loaded shapes via SVGLoader
.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 to applyBoneTransform()
.InstancedMesh.frustumCulled
is now true
by default since InstancedMesh
now supports bounding volume computations. If you update the transformation of your instances, make sure to call computeBoundingSphere()
to recompute the bounding sphere which is required for correct view frustum culling and ray casting.MapControls
is now located in its own module file three/addons/controls/MapControls.js
.import TWEEN from 'three/addons/libs/tween.module.js';
.Triangle.getUV()
has been renamed to Triangle.getInterpolation()
.GroundProjectedEnv
has been renamed to GroundProjectedSkybox
.BufferGeometryUtils.mergeBufferAttributes()
has been renamed to BufferGeometryUtils.mergeAttributes()
.BufferGeometryUtils.mergeBufferGeometries()
has been renamed to BufferGeometryUtils.mergeGeometries()
.WebGLRenderer.useLegacyLights = false
).Points
now supports texture coordinates. When a uv
attribute is present in the geometry, the shader will use it to sample the color or alpha value from map
or alphaMap
for a single point. Without a uv
attribute, point clouds are rendered as before.ShaderMaterial.forceSinglePass
is now true
by default.aoMap
and lightMap
no longer use uv2
. Set material.lightMap.channel
to 0
for uv
and 1
for uv2
. Consequently, the uv2_*
shader chunks have been removed.build/three.js
and build/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/InstallationBasisTextureLoader
has been removed. Use Basis Universal compression in KTX2 (.ktx2) files with KTX2Loader
instead.ColorManagement.legacyMode=false
is now ColorManagement.enabled=true
.WebGLRenderer.physicallyCorrectLights = true
is now WebGLRenderer.useLegacyLights = false
.Euler.DefaultOrder
has been renamed to Euler.DEFAULT_ORDER
.Euler.RotationOrders
has been removed.Object3D.DefaultUp
has been renamed to Object3D.DEFAULT_UP
.Object3D.DefaultMatrixAutoUpdate
has been renamed to Object3D.DEFAULT_MATRIX_AUTO_UPDATE
.Object3D.DefaultMatrixWorldAutoUpdate
has been renamed to Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE
.ViewHelper.controls
has been removed. Use the new center
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 setting Material.forceSinglePass
to true
.examples/js
directory has been removed. Addons like GLTFLoader
or OrbitControls
are now only available as ES6 modules in the examples/jsm
directory. Certain library files from examples/js/libs
are moved to examples/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.radial
values of CircleGeometry
, RingGeometry
, CylinderGeometry
, ConeGeometry
and TorusGeometry
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. Use TwoPassDoubleSide
for two-pass transparent rendering.decay
property of PointLight
and SpotLight
has now a physically correct default value (2
). This change will affect all scenes using point and spot lights with no defined decay
. Set the property back to 1
if you want to restore the previous behavior.BufferAttribute.onUploadCallback()
is now executed every time buffer data are transferred to the GPU.KHR_materials_pbrSpecularGlossiness
extensions has been removed from GLTFLoader
and GLTFExporter
. Older glTF assets should be losslessly converted from spec/gloss to metal/rough.PixelShader
has been removed. Use postprocessing/RenderPixelatedPass
instead.numConstructionSteps
and constructionStep
of LDrawLoader
have been renamed to numBuildingSteps
and buildingStep
.resolution
constructor parameter of BloomPass
has been removed.width
and height
settings of the params
constructor parameter of BokehPass
have been removed.BufferGeometryUtils.mergeBufferGeometries()
does not honor BufferGeometry.userData
anymore.cube
shader in ShaderLib
has different uniforms now. envMap
is now tCube
, flipEnvMap
is now tFlip
and all other uniforms except of opacity
have been removed.truncateDrawRange
option has been removed from GLTFExporter.parse()
.FlyControls
and FirstPersonControls
have been moved to Pointer Events API.BufferGeometry
alias for geometry generators has been deprecated. Use e.g. BoxGeometry
instead of BoxBufferGeometry
.BufferGeometry.merge()
has been removed. Use BufferGeometryUtils.mergeBufferGeometries()
instead.copyColorsArray()
, copyVector2sArray()
, copyVector3sArray()
and copyVector4sArray()
have been removed from BufferAttribute
.MeshLambertMaterial
now uses per-fragment shading. Use the new MeshGouraudMaterial
in examples/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 with Object3D.matrixWorldAutoUpdate
.noHoles
parameter of ShapePath.toShapes()
has been removed.AnimationUtils
from src/animation/AnimationUtils.js
(instead of three.module.js
), the import is now import * as AnimationUtils from '/src/animation/AnimationUtils.js';
.PCDLoader
now always uses white as the default material color.DataUtils
from src/extras/DataUtils.js
(instead of three.module.js
), the import is now import * as DataUtils from '/src/extras/DataUtils.js';
.embedImages
option of GLTFExporter.parse()
has been removed.three.js
in an existing project, try to avoid too large upgrade steps. For example don't upgrade from r70
to r140
but do it in a more incremental fashion instead (r70
-> r80
-> r90
etc.).selectionBox
has been removed from SelectionHelper
's constructor.type
of DepthTexture
is now UnsignedIntType
.url
parameter of PCDLoader.parse()
has been removed. The loader does not extract the file name from the URL anymore.Geometry
class has been removed.SkinnedMesh
requires floating point vertex textures now.fog
property has been moved from the abstract Material
class to materials which actually support it.CubeUVRefractionMapping
and MeshStandardMaterial.refractionRatio
have been removed. Use the transmission related properties of MeshPhysicalMaterial
if you want to model refraction with a PBR material.WebGLMultisampleRenderTarget
has been removed. To use multisampling as before, use WebGLRenderTarget
and set the new samples
property to a value greater 0
.examples/jsm/nodes
has been replaced with a new implementation.ColladaLoader
, KMZLoader
and PLYLoader
require a sRGB workflow now.OBJExporter
, ColladaExporter
and PLYExporter
produce assets with sRGB encoded colors now.VRMLoader
has been removed. Use three-vrm instead.GLTFLoader
's parser.loadTextureImage()
has been changed from image source definition to image source index.Euler.toVector3()
has been removed. Use Vector3.setFromEuler()
instead.DataTexture3D
has been renamed to Data3DTexture
.DataTexture2DArray
has been renamed to DataArrayTexture
.WebGLRenderTarget.setTexture()
has been removed.CurveExtras
has been changed. It is now import * as Curves from ...
instead of import { Curves } from ...
.WebGLRenderer
now creates the WebGL context with an alpha channel regardless of the value of alpha
passed in the constructor. However, the value of alpha
is still used by the renderer when clearing the context first thing every frame.RGBFormat
has been removed. Please use RGBAFormat
instead.RGBIntegerFormat
has been removed. Please use RGBAIntegerFormat
instead.UnsignedShort565Type
has been removed. Please use UnsignedShort5551Type
instead.BasisTextureLoader
has been deprecated. Please use KTX2Loader
instead.SRGB8_ALPHA8_ASTC*
texture formats have been removed. If you want to use sRGB ASTC formats, use the regular RGBA_ASTC_*
formats and set the encoding
texture property to sRGBEncoding
.RGBAFormat
with UnsignedByteType
now.RoughnessMipmapper
has been removed.Material.format
has been removed.GLTFExporter
does not support RGBFormat
anymore. Please use RGBAFormat
instead.VideoTexture
is now RGBAFormat
(instead of RGBFormat
).RGBAFormat
+ UnsignedByteType
format now.three.js
and examples/jsm
modules in web sites now requires the usage of an import map to resolve the three
bare import specifier.examples/jsm
and examples/fonts
in certain bundlers like esbuild now requires an extension on filenames.OBJ/MTLLoader
requires a sRGB workflow now.Material.transparent
after its initial use requires setting needsUpdate
to true
.OES_texture_half_float
/OES_texture_half_float_linear
).DataTexture
, DataTexture2DArray
or DataTexture3D
, you have to set needsUpdate
to true
as soon as the texture data are ready.WebGLRenderer.copyFramebufferToTexture()
has to be used with the new class FramebufferTexture
now.keydown
event listener of ArcballControls
has been removed. You have to implement it on app level if necessary.ArcballControls.setTarget()
has been removed. Update the target
property instead.WebGLRenderer.toneMapping
, it is no longer necessary to set Material.needsUpdate
to true
.EXRLoader
no longer supports the data type UnsignedByteType
. Use the default data type HalfFloatType
instead.PMREMGenerator
now uses half float render targets internally, and no longer uses RGBEEncoding
.RGBM7Encoding
and RGBM16Encoding
have been removed. It is still possible to load RGBM texture as FP16 or FP32 textures. The default type
is HalfFloatType
.RGBEEncoding
and RGBEFormat
have been removed. RGBELoader
and HDRCubeTextureLoader
no longer support the data type UnsignedByteType
. It is still possible to load RGBE texture as FP16 or FP32 textures. The default type
is HalfFloatType
.RGBDEncoding
has been removed.WebGLRenderer.gammaFactor
and THREE.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 with lil-gui
.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 new LogLuvLoader
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 uses fetch
instead of XMLHttpRequest
.recursive
parameter of Raycaster.intersectObject()
and Raycaster.intersectObjects()
is now true
by default.ExtrudeGeometry
's parameters have changed. depth
is now 1
, bevelThickness
is now 0.2
and bevelSize
is now bevelThickness - 0.1
.ParametricGeometry
has been removed from core. It is now located in examples/jsm/geometries/ParametricGeometry.js
.TextGeometry
has been removed from core. It is now located in examples/jsm/geometries/TextGeometry.js
.FontLoader
and Font
have been removed from core. Both classes are now located in examples/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 from examples/js/libs/basis
MeshPhysicalMaterial.sheen
has been renamed to sheenTint
.BufferGeometry.computeFaceNormals()
has been removed. The method was not implemented and just a stub. Calling it did not affect the geometry.MeshStandardMaterial
and MeshPhysicalMaterial
shaders are now more correct and may result in less shiny renders for models using rough materials.morphTargets
and morphNormals
property of materials has been removed.MeshStandardMaterial.vertexTangents
has been removed.widthSegments
and heightSegment
properties of SphereGeometry
have been increased to 32
and 16
.RGBELoader
, HDRCubeTextureLoader
and EXRLoader
is now THREE.HalfFloatType
.envMap
property of MeshStandardMaterial
and MeshPhysicalMaterial
is now internally converted to a PMREM. It might be necessary to update the scene's lighting if no PMREM was previously used.preventDefault()
on pointer and mouse events.DragControls
, OrbitControls
and TrackballControls
now use pointer events for touch interaction.renderTarget
and forceClear
of WebGLRenderer.render()
has been removed.
WebGLRenderer.setRenderTarget()
and WebGLRenderer.clear()
instead.skinning
property of materials has been removed.
Mesh
and SkinnedMesh
.Matrix4.makeShear()
has a new signature. Please make a note of it.Object3D
, BufferGeometry
or ShaderMaterial
are now ES6 classes.
three.js
classes via ES5 syntax. In this case, you have to upgrade your code to ES6 or transpile three.js
to ES5.examples/js
generated from modules in examples/jsm
is now based on ES6.
examples/js
by using npm run build-examples
. However, the better solution is to upgrade your code to ES6.examples/jsm
now import using the bare specifier three
.
XLoader
has been removed.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 of WebGLCubeRenderTarget
. Please assign the texture
property of render targets.WebGLRenderer.setFramebuffer()
has been removed.AssimpLoader
has been removed.Plane.intersectLine()
now returns null
when no intersection was found.WebGLRenderer.maxMorphTargets
and WebGLRenderer.maxMorphNormals
have been removed.EventDispatcher
,
event.target
is only valid for the duration of the listener callback now.Face3
has been removed from core. It is now located in examples/jsm/deprecated/Geometry.js
.Ocean
and OceanShaders
have been removed.polyfills.js
has been removed. The polyfills for Array.from()
, Function.name
, Number.EPSILON
, Number.isInteger
, Math.log2
, Math.sign
and Object.assign()
need to be added at application level for IE11 support: misc_legacy.CSS3DRenderer
no longer supports IE11.WebGLRenderer
now sets gl.UNPACK_COLORSPACE_CONVERSION_WEBGL
to gl.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 in examples/jsm/deprecated/Geometry.js
.BoxGeometry
now produce a BufferGeometry
.Mesh
, Line
and Points
no longer support raycasting with Geometry
.Line.computeLineDistances()
no longer supports Geometry
.Geometry
.DecalGeometry
, EdgesGeometry
, WireframeGeometry
, Projector
, LineGeometry
, LineSegmentsGeometry
, ConvexHull
, EdgeSplitModifier
and TessellateModifier
no longer support Geometry
.ConvexBufferGeometry
has been removed. Similar to DecalGeometry
, ConvexGeometry
is now derived from BufferGeometry
.TeapotBufferGeometry
has been renamed to TeapotGeometry
.RoundedBoxBufferGeometry
has been renamed to RoundedBoxGeometry
.3MFLoader
, AMFLoader
, EXRLoader
, FBXLoader
, KMZLoader
, NRRDLoader
, TiltLoader
and VTKLoader
now depend on fflate
. Other decompression libs (JSZip
and ZLib
) are no longer used.SubdivisionModifier
has been removed.SimplifyModifier
no longer supports Geometry
and now relies on BufferGeometryUtils
.OBJLoader2
has been removed. If you still need it, use this repository.OrbitControls
no longer listens to key events by default. You have to call OrbitControls.listenToKeyEvents()
if your app requires key controls.BufferGeometryUtils.computeTangents()
has been moved into the core. You can now use BufferGeometry.computeTangents()
.RectAreaLightHelper.update()
has been removed.ColladaLoader
stores animation clips in collada.scene.animations
now.WebGLRenderer.getClearColor()
now expects a target argument.TypedArrayUtils
and webgl_nearestneighbour
demo have been removed.fbx2three
and obj2three
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 to Quaternion.invert()
.forcePowerOfTwoTextures
has been removed from GLTFExporter
.DRACOExporter.parse()
is now of type Mesh
or Points
.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 respective webgl_fire
example have been removed.detail
parameter of PolyhedronGeometry
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 new SpotLightShadow.focus
property.BoxGeometry
and BoxBufferGeometry
no longer share a single file and are now located in src/geometries/BoxGeometry.js
and src/geometries/BoxBufferGeometry.js
.WebGLCubeRenderTarget.texture
is now of type CubeTexture
.TimelinerController
and the respective example misc_animation_authoring
have been removed.TypedGeometryExporter
has been removed.DRACOLoader
required an update of the DRACO library.Scene.dispose()
has been removed.WebGLRenderTarget.stencilBuffer
and WebGLCubeRenderTarget.stencilBuffer
are now false by default. Enable the buffer by setting stencilBuffer: true
in the constructor options.ShaderMaterial
and RawShaderMaterial
, it's now necessary to set the new glslVersion
property to THREE.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
and DirectionalLightShadow
have been removed from the public API.CannonPhysics
has been removed.OrbitControls
, TrackballControls
and TransformControls
now use Pointer Events. This change might require that you move your custom event listeners to Pointer Events, too.MeshPhysicalMaterial.transparency
has been renamed to MeshPhysicalMaterial.transmission
.SphericalReflectionMapping
is no longer supported. Consider using a Matcap texture with MeshMatcapMaterial
instead.WebGLRenderer.toneMappingWhitePoint
has been removed.Uncharted2ToneMapping
has been removed. However, it's now possible to define your own custom tone mapping function by using CustomToneMapping
. 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.OrbitControls.screenSpacePanning
is now true
.Water
can only be used when setting WebGLRenderer.outputEncoding
to THREE.LinearEncoding
.shininess
, specular
and specularMap
have been removed from MeshToonMaterial
.Texture.mipmaps
is now any[]
instead of ImageData[]
.InstancedBufferGeometry.maxInstancedCount
has been renamed to InstancedBufferGeometry.instanceCount
.CubeCamera
has changed. It now expects an instance of WebGLCubeRenderTarget as third parameter. The fourth parameter options
has been removed.WebGLRenderer.toneMapping
is now NoToneMapping
.Sphere.empty()
has been renamed to Sphere.isEmpty()
.TranslucentShader
has been renamed to SubsurfaceScatteringShader
.PDBLoader
no longer returns raw bonds data in the JSON result.options
parameter of VRButton.createButton()
has been removed. Please set the reference space type via WebGLRenderer.xr.setReferenceSpaceType()
instead.throwOnDegenerate
parameter of Matrix3.getInverse()
and Matrix4.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.Geometry.boundingBox
and Geometry.boundingSphere
is now nullable, as it actually be.#pragma unroll_loop
is now deprecated. Use #pragma unroll_loop_start
/ end
instead.Material.vertexColors
is now a boolean. The default value is false
.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 of Group
instead of Scene
.GLTFLoader
now sets depthWrite
to false
for transparent materials.OBJ
and FBX
converters now require the esm npm package.Math
has been renamed to MathUtils
, and /examples/js/utils/MathUtils.js
has been promoted to the core.WebGLRenderTargetCube
has been renamed to WebGLCubeRenderTarget
, and the constructor signature is now WebGLCubeRenderTarget( size, options )
.Geometry.applyMatrix()
has been renamed to Geometry.applyMatrix4()
.BufferGeometry.applyMatrix()
has been renamed to BufferGeometry.applyMatrix4()
.Object3D.applyMatrix()
has been renamed to Object3D.applyMatrix4()
.LineSegmentsGeometry.applyMatrix()
has been renamed to LineSegmentsGeometry.applyMatrix4()
.Frustum.setFromMatrix()
has been renamed to Frustum.setFromProjectionMatrix()
.RaytracingRenderer
has been removed.WebGLDeferredRenderer
has been removed.GammaCorrectionShader
converts to sRGB
now.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 via Texture.encoding
instead.WebGLRenderer.gammaOutput
has been removed. Please use WebGLRenderer.outputEncoding
instead.MeshToonMaterial
does not support environment maps anymore.Mesh.drawMode
and Mesh.setDrawMode()
have been removed. WebGLRenderer
does render meshes always with THREE.TrianglesDrawMode
now. Please use BufferGeometryUtils.toTrianglesDrawMode()
to transform THREE.TriangleStripDrawMode
and THREE.TriangleFanDrawMode
of existing geometries to THREE.TrianglesDrawMode
.TerrainShader
, SkinShader
and CarControls
have been removed.WebVR
support has been removed. Please use WebXR
instead.MeshStandardMaterial.roughness
has changed from 0.5
to 1
.MeshStandardMaterial.metalness
has changed from 0.5
to 0
.FaceNormalsHelper
, LightProbeHelper
, PositionalAudioHelper
, RectAreaLightHelper
, VertexNormalsHelper
and VertexTangentsHelper
are now part of the examples.BufferGeometry
require at least a position attribute or index now.Material.needsUpdate
has changed. Setting it to true
now increases the internal version counter (similar to Texture
or BufferAttribute
). It's not possible anymore to use Material.needsUpdate
in conditional statements.LegacyGLTFLoader
and LegacyJSONLoader
have been removed.WebVRManager.setPoseTarget()
has been removed.WebVRManager
and WebXRManager
do no longer modify the camera when not presenting.Ray.direction
is now ( 0, 0, - 1)
.BufferGeometry
require at least a position attribute now.BufferAttribute.dynamic
and BufferAttribute.setDynamic()
have been deprecated. Please use BufferAttribute.usage
and BufferAttribute.setUsage()
instead.BufferGeometry.addAttribute()
has been renamed to BufferGeometry.setAttribute()
.BufferGeometry.removeAttribute()
has been renamed to BufferGeometry.deleteAttribute()
.CubemapGenerator
has been removed. Please use WebGLRenderTargetCube.fromEquirectangularTexture()
instead.EquirectangularToCubeGenerator
has been removed. Please use WebGLRenderTargetCube.fromEquirectangularTexture()
instead.domElement
of OrbitControls
, TrackballControls
, TransformControls
, FlyControls
, PointerLockControls
and FirstPersonControls
is now mandatory.OrbitControls
and TrackballControls
do not support document
as an argument for domElement
anymore. Please use the canvas element of the renderer (renderer.domElement
) instead.Audio.startTime
has been removed. Please use Audio.play( delay )
instead.DataTexture
via DataTextureLoader
, it's default minFilter
value is now LinearFilter
.AssimpJSONLoader
has been removed. Please use AssimpLoader
instead.SoftwareRenderer
has been removed.Loader.Handler
has been removed. Use LoadingManager
'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 in editor/js
.OrthographicTrackballControls
has been removed. TrackballControls
now supports orthographic cameras.BufferAttribute.setArray()
has been removed..needsUpdate
to true
when creating a DataTexture
(assuming the data are provided at construction time as a constructor parameter).BoxGeometry
and BoxBufferGeometry
are now ES6 classes (except in three.js
and three.min.js
).CTMLoader
has been removed.MeshPhysicalMaterial
, renamed .clearCoat
to .clearcoat
and .clearCoatRoughness
to .clearcoatRoughness
..initMaterials()
and .createMaterial()
from Loader
.onLoadStart()
, onLoadProgress()
and onLoadComplete()
have been removed from Loader
.DRACOLoader.setDecoderPath()
and DRACOLoader.setDecoderConfig()
are now instance methods.MipMap
is now Mipmap
. For example, THREE.LinearMipMapLinearFilter
is now THREE.LinearMipmapLinearFilter
.WebGLRenderer.getActiveMipMapLevel()
to WebGLRenderer.getActiveMipmapLevel()
.WEBGL
(the namespace from examples/js/WebGL.js
) is now in the THREE
namespace.WEBVR
(the namespace from examples/js/vr/WebVR.js
) is now in the THREE
namespace.MapControls
is now part of OrbitControls
. Check out the official example for more information.OrbitControls
and MapControls
now have a new default value for dampingFactor
.WebGLRenderer.context
has been removed. Please use WebGLRenderer.getContext()
instead.FBXLoader
now correctly sets the texture encoding. When using FBX assets in your scene, you have to set renderer.gammaOutput = true;
(unless you need post-processing in linear colorspace).FBXLoader
requires now the following setup: THREE.Loader.Handlers.add( /\.tga$/i, new TGALoader() );
.VRMLLoader
has a new implementation. It's necessary now to include chevrotain.min.js
into your code. Check out the official example for more details.update
arg has been removed from the public API of the following methods: Euler.setFromRotationMatrix( m, order )
, Euler.setFromQuaternion( q, order )
, and Quaternion.setFromEuler( e )
.GPUParticleSystem
has been removed.DracoExporter
has been renamed to DRACOExporter
.LOD
are now updated automatically by WebGLRenderer
. Set LOD.autoUpdate
to false
if you want to perform the update by yourself..loadMtl()
have been removed from OBJLoader2
. Please use MTLLoader
and MtlObjBridge
as shown in basic obj2 example.OBJLoader2
has been removed from examples/js/loaders
. Please use the module version in examples/jsm/loaders
.WebGLRenderer.debug.checkShaderErrors
is now true
by default.EffectComposer.setSize()
now respects the pixel ratio. An instance of EffectComposer
can now be resized with the same width
and height
values like WebGLRenderer
.QuickHull
to ConvexHull
. The file is now located in examples/js/math
.SimplexNoise
and ImprovedNoise
are now in the THREE
namespace and located in examples/js/math
.AnimationClipCreator
and TimelinerController
are now located in examples/js/animation
.ParametricGeometries
is now located in examples/js/geometries
.hilbert2d
and hilbert3D
were removed. Please use GeometryUtils.hilbert2D()
and GeometryUtils.hilbert3D()
instead.WebGLRenderer
does no longer perform error checking and reporting when shader programs are being compiled. You have to set renderer.debug.checkShaderErrors
to true
to restore the previous behavior.Object3D.applyMatrix()
now updates the local matrix if Object3D.matrixAutoUpdate
is set to true
.npm
script npm run editor
was removed. The editor is now a Progressive Web App (PWA).SVGLoader.onLoad()
is now an object (data
) containing the root node of the SVG document and an array of ShapePath
objects. Also, all paths are returned now (not only the ones with fill
color).allocTextureUnit()
, .setTexture2D()
, .setTexture()
and .setTextureCube()
from WebGLRenderer
. These methods were never intended to be part of WebGLRenderer
's public API and are now private (as a part of WebGLTexture
).renderTarget
and forceClear
parameters from WebGLRenderer.render()
. Please use .setRenderTarget()
and .clear()
instead before you perform the rendering. Be aware that it's now necessary to execute renderer.setRenderTarget( null )
in order to unset an active render target..activeCubeFace
and .activeMipMapLevel
from WebGLRenderTargetCube
. They are now parameters of WebGLRenderer.setRenderTarget()
.WebGLRenderer.setViewport()
and WebGLRenderer.setScissor()
, (x, y)
is the coordinate of the lower left corner of the rectangular region.WebGLRenderer.getSize()
now requires a Vector2
argument.WebGLRenderer.getCurrentViewport()
now requires a Vector4
argument.FirstPersonControls.lookAt()
. lat
, lon
, phi
, theta
and target
were removed from the public API. FirstPersonControls
also respects the initial camera orientation now.MeshStandardMaterial
and MeshPhysicalMaterial
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.Geometry
support from Mesh.updateMorphTargets()
. Use BufferGeometry
instead.RectAreaLight
has changed. It now looks along the negative z-axis.WebGLRenderTarget.texture.generateMipmaps
is now set to false
by default.SSAOShader
and SSAOPass
.JSONLoader
has been removed from core. It is now located in examples/js/loaders/deprecated/LegacyJSONLoader.js
.Geometry
support from ObjectLoader
. You have to include LegacyJSONLoader
if you still want to load geometry data of type Geometry
.Geometry
support from SkinnedMesh
. Use BufferGeometry
instead.SkinnedMesh.initBones()
. The SkinnedMesh
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.ObjectLoader.setTexturePath()
to ObjectLoader.setResourcePath()
. Added ObjectLoader.setPath()
.CanvasRenderer
has been removed.LoadingManager
's callbacks has changed. onError()
is now called before onLoad()
.BinaryLoader
.WebGLRenderer.clearTarget()
is now deprecated. Use WebGLRenderer.setRenderTarget()
in combination with WebGLRenderer.clear()
instead.JSONLoader.setTexturePath()
to JSONLoader.setResourcePath()
.MTLLoader.setTexturePath()
to MTLLoader.setResourcePath()
.GLTFLoader.setPath()
is now used for the original glTF file. Use GLTFLoader.setResourcePath()
if you want to change the path for resources like textures.TDSLoader.setPath()
is now used for the original 3DS file. Use TDSLoader.setResourcePath()
if you want to change the path for resources like textures.PointerLockControls
. Please have a look at the official example to see the new API.Detector.js
was refactored to WebGL.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. Use SubdivisionModifier
instead..validate/optimize()
.lights_pars_maps
to envmap_physical_pars_fragment
.TDSLoader
now produces BufferGeometry
.MD2Loader
now produces BufferGeometry
.XLoader
now produces BufferGeometry
.UTF8Loader
.EquiangularToCubeGenerator
to EquirectangularToCubeGenerator
.VRControls
and VREffect
.DaydreamController
and GearVRController
are now deprecated. The new directory of these file is examples/js/vr/deprecated/
.amount
to depth
in ExtrudeBufferGeometry
.STLBinaryExporter
has been removed. It's now part of STLExporter
.WebGLRenderer.animate()
to WebGLRenderer.setAnimationLoop()
.frames
from ExtrudeBufferGeometry
..getArrays()
from ExtrudeBufferGeometry
..addShapeList()
from ExtrudeBufferGeometry
..addShape()
from ExtrudeBufferGeometry
.ExtrudeGeometry.WorldUVGenerator
is now private.SVGLoader
now parses SVG input and returns an array of ShapePath
objects.Geometry.center()
and BufferGeometry.center()
now return this
instead of offset
.optionalTarget
s are now mandatory method parameters (with exception of curve classes).ShaderChunk.lights_pars
into ShaderChunks.lights_pars_begin
and ShaderChunks.lights_pars_maps
.ShaderChunk.lights_template
into ShaderChunks.lights_fragment_begin
, ShaderChunnks.lights_fragment_maps
and ShaderChunks.lights_fragment_end
.ShaderChunk.normal_fragment
into ShaderChunks.normal_fragment_begin
and ShaderChunks.normal_fragment_maps
.AnimationAction.repetition
has changed. The first run of the animation is now taken into account.copyIndicesArray()
from BufferAttribute
.getWorldRotation()
from Object3D
.Triangle.area()
to Triangle.getArea()
.Triangle.barycoordFromPoint()
to Triangle.getBarycoord()
.Triangle.midpoint()
to Triangle.getMidpoint()
.Triangle.normal()
to Triangle.getNormal()
.Triangle.plane()
to Triangle.getPlane()
.material
and extrudeMaterial
from ExtrudeGeometry
.vertices
from renderer.info.render
.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 of Lensflare
.SceneUtils
has been moved out of the core. It is now located at examples/js/utils/SceneUtils.js..shadowMap.renderReverseSided
from WebGLRenderer
. Set Material.shadowSide
instead..shadowMap.renderSingleSided
from WebGLRenderer
. Set Material.shadowSide
instead..setFaceCulling()
from WebGLRenderer
..computeLineDistances()
from Geometry
. Use Line.computeLineDistances()
instead.ImageUtils
has been removed.extractUrlBase()
from Loader
. Use LoaderUtils.extractUrlBase()
instead.ShapeUtils.triangulateShape()
uses a new and more robust polygon triangulation algorithm now.ShapeUtils.triangulate()
has been removed.Reflector
, Refractor
, Water
and Water2
accept now any planar geometry and not only rectangular ones. The respective constructors have a new signature.CombinedCamera
has been removed.ColladaLoader2
has replaced ColladaLoader
.VRMLLoader
now produces BufferGeometry
.OBJLoader2
has a new dependency LoaderSupport
(see example).WebVR.js
was rewritten. Check out the corresponding examples to see the new API.CatmullRomCurve3
's type
to curveType
.createPointsGeometry()
from CurvePath
. Check out this example to see how to create a geometry from a series of points.createSpacedPointsGeometry()
from CurvePath
.createGeometry()
from CurvePath
.Path
's fromPoints()
to setFromPoints()
.extractAllPoints()
from Shape
.Mirror
to Reflector
.lengthManhattan()
of Vector2
, Vector3
and Vector4
to manhattanLength()
.distanceToManhattan()
of Vector2
and Vector3
to manhattanDistanceTo()
.AxisHelper
to AxesHelper
.GLTF2Loader
has replaced GLTFLoader
.onLoad
callback of PDBLoader
has changed. Please have a look at the corresponding example.AssimpLoader
now uses LoadingManager
.setPreferredShading()
from ColladaLoader
.Animation
, AnimationHandler
and KeyFrameAnimation
MultiMaterial
has been removed. Use an Array instead.multiplyToArray()
from Matrix4
.SceneLoader
.BoxHelper update()
no longer has arguments. Use .setFromObject()
to assign a different object to the helper.BoxHelper
no longer supports objects of type Box3
.DecalGeometry
now produces a BufferGeometry
.applyToVector3Array()
from Matrix3
.applyToVector3Array()
from Matrix4
.Spline
. Use CatmullRomCurve3
instead.SplineCurve3
. Use CatmullRomCurve3
instead.applyProjection()
from Vector3
. Use applyMatrix4()
instead.Vector2
's fromAttribute()
to fromBufferAttribute()
.Vector3
's fromAttribute()
to fromBufferAttribute()
.Vector4
's fromAttribute()
to fromBufferAttribute()
.BinaryTextureLoader
to DataTextureLoader
.Matrix4
's makeFrustum()
to makePerspective()
.STLLoader
now produces a BufferGeometry
.PDBLoader
now produces a BufferGeometry
.AssimpJSONLoader
now produces a BufferGeometry
.Matrix3
's applyToBuffer()
to applyToBufferAttribute()
.Matrix4
's applyToBuffer()
to applyToBufferAttribute()
.BoundingBoxHelper
has been removed. Use BoxHelper
instead.XHRLoader
to FileLoader
.PLYLoader
now produces a BufferGeometry
.taper
parameter in TubeGeometry
has been removed.Box2
's center()
to getCenter()
.Box2
's size()
to getSize()
.Box3
's center()
to getCenter()
.Box3
's size()
to getSize()
.Line3
's center()
to getCenter()
.THREE.GridHelper
: setColors()
removed, pass them in the constructor instead: new THREE.GridHelper( size, step, color1, color2 )
.THREE.Audio
.load
deprecated, use new THREE.AudioLoader
instead..type
property.boneGlobalMatrices
has been renamed to boneMatrices
.Vector3
's setFromMatrixColumn(index, m)
to setFromMatrixColumn(m, index)
.WebGLRenderTarget
's shareDepthFrom
.enableScissorTest
to setScissorTest
.shadowBias
to shadow.bias
.shadowMapWidth
to shadow.mapSize.width
.shadowMapHeight
to shadow.mapSize.height
.shadowCameraNear
to shadow.camera.near
.shadowCameraFar
to shadow.camera.far
.shadowCameraFov
to shadow.camera.fov
.shadowDarkness
. Add a THREE.AmbientLight
to your scene instead.ClosedSplineCurve3
. Use CatmullRomCurve3
with closed
set to true
.MeshPhongMaterial
's metal
.Box2
's empty()
to isEmpty()
.Box3
's empty()
to isEmpty()
.morphColors
from Geometry
.clampBottom
from Math
.FontUtils
and TextGeometry
moved out of core.shadowDarkness
default value is now 1
.PointCloud
to Points
.PointCloudMaterial
to PointsMaterial
.computeTangents()
from Geometry
and BufferGeometry
.shadowMap*
properties in WebGLRenderer
to shadowMap.*
.BufferGeometry
's drawcall.index
.LineSegments( geometry, material )
should now be used instead of Line( geometry, material, THREE.LinePieces )
.ambient
from Material
.recursive
parameter from getObjectBy*()
.sortParticles
from PointCloud
.renderDepth
from Object3D
.UVMapping
, CubeReflectionMapping
, CubeRefractionMapping
, SphericalReflectionMapping
and SphericalRefractionMapping
are no longer functions.WebGLRenderer
's initMaterial
was made private.ColladaLoader
now returns a Scene
instead of an Object3D
.Object3D
's position
, rotation
, quaternion
and scale
properties are now immutable.BufferGeometry
's addAttribute
method now takes a BufferAttribute
instead of the various attribute types (e.g., Int16Attribute
, Float32Attribute
).Face3
's centroid
.Geometry
's computeCentroids()
.GeometryUtils
's merge
to Geometry
.CubeGeometry
to BoxGeometry
.dynamic
property from BufferGeometry
.physicallyBasedShading
property from WebGLRenderer
.WebGLRenderer
background to opaque (black) by default. Pass {alpha=true}
when creating WebGLRenderer for previous default behaviour.Particle
removed. Use Sprite
instead.ParticleMaterial
removed. Use ParticleSystemMaterial
or SpriteMaterial
.Face4
removed. Use 2 Face3
to emulate it.OrbitControls
's zoomIn()
and zoomOut()
renamed to dollyIn()
and dollyOut()
.Object3D.rotation
is now of type THREE.Euler
.Object3D.useQuaternion
. The library now uses quaternions by default. However, there is some magic in place to keep Object3D
's rotation
(Euler
) working.Object3D.eulerOrder
to Object3D.rotation.order
.Object3D.defaultEulerOrder
to Euler.DefaultOrder
.setGeometry()
and setMaterial()
from Mesh
.Vector3.setEulerFromRotationMatrix()
, use Euler.setFromRotationMatrix()
instead.Vector3.setEulerFromQuaternion()
, use Euler.setFromQuaternion()
instead.Matrix4
's translate()
, rotateX()
, rotateY()
, rotateZ()
, rotateByAxis()
and crossVector()
.setClearColorHex()
from CanvasRenderer
and WebGLRenderer
. Use setClearColor()
instead.Matrix4
's extractPosition()
to copyPosition()
.Matrix4
's setRotationFrom*()
to makeRotationFrom*()
.Matrix4
's compose()
to makeFromPositionQuaternionScale()
.Object3D
's getChildByName()
to getObjectByName()
.Object3D
's matrixRotationWorld
property.BufferGeometry
geometry.verticesNeedUpdate
to geometry.attributes.position.needsUpdate
geometry.elementsNeedUpdate
to geometry.attributes.index.needsUpdate
geometry.normalsNeedUpdate
to geometry.attributes.normal.needsUpdate
geometry.uvsNeedUpdate
to geometry.attributes.uv.needsUpdate
geometry.colorsNeedUpdate
to geometry.attributes.color.needsUpdate
geometry.tangentsNeedUpdate
to geometry.attributes.tangent.needsUpdate
*
-> geometry.attributes.custom.needsUpdate
Matrix4
's rotateAxis
. Use Vector3.transformDirection( matrix )
instead.AsteriskGeometry
.Color
's setHSV
. Use ColorConverter.setHSV( color, h, s, v )
instead.JSONLoader
's createModel()
to parse()
.getPosition()
and getColumn*()
from Matrix4
Color.setHSV()
and Color.getHSV()
replaced by .setHSL()
and .getHSL()
ColorUtils.adjustHSV()
with Color's .offsetHSL()
Box3/Line3/Plane/Ray/Sphere
's .transform()
to applyMatrix4()
Matrix3.multiplyVector3()
changed to Vector3.applyMatrix3()
Matrix4.multiplyVector3()
changed to Vector3.applyMatrix4()
and Vector3.applyProjection()
Matrix4.multiplyVector4()
changed to Vector4.applyMatrix4()
Quaternion.multiplyVector3()
changed to Vector3.applyQuaternion()
Color
methods:
.lerpSelf()
to .lerp()
Vector2
, Vector3
and Vector4
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()
Matrix4
methods:
.multiply()
to .multiplyMatrices()
.multiplySelf()
to .multiply()
Quaternion
methods:
.multiply()
to .multiplyQuaternions()
.multiplySelf()
to .multiply()
Frustum
methods:
.contains()
to .intersectsObject()
GeometryUtils.explode
to ExplodeModifier
GeometryUtils.tessellate
to TessellateModifier
ShaderUtils.lib
to ShaderLib
Matrix4.makeTranslation
and Matrix4.makeScale
now take three scalars instead of Vector3
.Sprite
material properties are now in SpriteMaterial
, used like this new THREE.Sprite( new THREE.SpriteMaterial( { color: 0xff0000, map: texture, alphaTest: 0.5 } ) )
.Sprite.affectedByDistance
=> SpriteMaterial.sizeAttenuation
and Sprite.mergeWith3D
=> SpriteMaterial.depthTest
renderer.shadowMapCullFrontFaces
=> renderer.shadowMapCullFace
(default value true
=> THREE.CullFaceFront
, other option false
=> THREE.CullFaceBack
).color.getContextStyle
to color.getStyle
.Ray
casting methods to Raycaster
.Rectangle
replaced with Box2
.UV
replaced with Vector2
. This means .u
and .v
are now .x
and .y
.Matrix4.makeTranslation
and Matrix4.makeScale
now take Vector3
instead of three scalars.SubdivisionModifier
out of the build to examples/js/modifiers
.Renderer.deallocateObject()
=> Geometry.dispose()
and BufferGeometry.dispose()
.Renderer.deallocateRenderTarget()
=> WebGLRenderTarget.dispose()
.Sprite
's size is no longer automatically based on the image size, use sprite.scale.set( imageWidth, imageHeight, 1.0 )
to achieve the old behaviorSceneLoader
and scene format now use widthSegments
, heightSegments
, depthSegments
instead of segmentsWidth
, segmentsHeight
, segmentsDepth
for definitions of plane, cube and sphere geometriesSceneLoader
and scene format now use material
property with single material id string instead of materials
array for meshesMeshPhongMaterial
now uses perPixel = true
by defaultWebGLRenderer
constructor doesn't use anymore maxLights
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 into Color.getHSV()
Geometry
no longer has a materials
property. MeshFaceMaterials
usage is now like this: new THREE.Mesh( geometry, new THREE.MeshFaceMaterial( [ material1, material2 ] ) )
. Meaning that face.materialIndex
will map the array passed to MeshFaceMaterials
.geometry
parameter, are now also passed a second one: materials
: loader.load( 'file.js', function ( geometry, materials ) {} )
.GeometryUtils.clone()
is now a method in Geometry
.ShaderExtras
have been split in a different files. CopyShader
, FXAAShader
, NormalShader
, etcSceneUtils.traverseHierarchy
with object.traverse
.SceneUtils.showHierarchy
. Use object.traverse( function ( child ) { child.visible = false } )
instead.*Controls
to examples/js/controls
.SceneUtils.cloneObject
into *.clone()
CameraHelper
API changes: helper is not anymore child of camera, instead it uses reference to camera world matrixvalue
property instead of texture
one { type: "t", value: 0, texture: map }
=> { type: "t", value: map }
normalScale
uniform in normal map shader is now Vector2
(to be able to invert separately x
and y
to deal with different tangent bases)CTMLoader.load
and CTMLoader.loadParts
now use single parameter object for useWorker
and useBuffers
: loader.load( url, callback, useWorker, useBuffers )
=> loader.load( url, callback, { useWorker: true, useBuffers: true } )
CTMLoader
now creates BufferGeometry
by default, set useBuffers
parameter to false
if you need Geometry
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 )
to Vector3
's .setEulerFromRotationMatrix( matrix, order )
.Vector3
's .getEulerXYZFromQuaternion( quaternion )
and .getEulerYZXFromQuaternion( quaternion )
to .setEulerFromQuaternion( quaternion, order )
.DOMRenderer
and SVGRenderer
no longer included in common build.flipY
property (true by default); all models need to be re-exported / reconverted (tools have been updated as well).uv.v = 1 - uv.v;
PlaneGeometry
changed back to vertical orientation (facing screen instead of laying on the ground).mesh.rotation.x = - Math.PI / 2;
or geometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );
doubleSided
/ flipSided
properties moved from Object3D
to Material
's side
property (THREE.FrontSide
, THREE.BackSide
and THREE.DoubleSide
).objectMatrix
in shaders was renamed to modelMatrix
.Animation
.geometry.dynamic
is now true
by default.Three.js
build renamed to three.min.js
.PlaneGeometry
from vertical to horizontal orientation.__dirtyXXX
attribute properties to xxxNeedUpdate
.Vertex
class, use Vector3
instead.intersectScene
from Ray
. Use intersectObjects( array )
instead.loader.load( { model: url, callback: callback } )
to loader.load( url, callback )
.Isto irá apagar a página "Migration-Guide"
. Por favor, certifique-se.