Skip to content

Commit 2dece70

Browse files
committed
Core: Remove deprecated code.
1 parent 841d2e7 commit 2dece70

File tree

9 files changed

+4
-84
lines changed

9 files changed

+4
-84
lines changed

examples/jsm/nodes/core/NodeBuilder.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
ColorNodeUniform, Matrix3NodeUniform, Matrix4NodeUniform
1616
} from '../../renderers/common/nodes/NodeUniform.js';
1717

18-
import { REVISION, RenderTarget, NoColorSpace, LinearEncoding, sRGBEncoding, SRGBColorSpace, Color, Vector2, Vector3, Vector4, Float16BufferAttribute } from 'three';
18+
import { REVISION, RenderTarget, NoColorSpace, SRGBColorSpace, Color, Vector2, Vector3, Vector4, Float16BufferAttribute } from 'three';
1919

2020
import { stack } from './StackNode.js';
2121
import { getCurrentStack, setCurrentStack } from '../shadernode/ShaderNode.js';
@@ -472,14 +472,6 @@ class NodeBuilder {
472472

473473
}
474474

475-
/** @deprecated, r152 */
476-
getTextureEncodingFromMap( map ) {
477-
478-
console.warn( 'THREE.NodeBuilder: Method .getTextureEncodingFromMap replaced by .getTextureColorSpaceFromMap in r152+.' );
479-
return this.getTextureColorSpaceFromMap( map ) === SRGBColorSpace ? sRGBEncoding : LinearEncoding;
480-
481-
}
482-
483475
getTextureColorSpaceFromMap( map ) {
484476

485477
let colorSpace;

src/constants.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,6 @@ export const AdditiveAnimationBlendMode = 2501;
148148
export const TrianglesDrawMode = 0;
149149
export const TriangleStripDrawMode = 1;
150150
export const TriangleFanDrawMode = 2;
151-
/** @deprecated Use LinearSRGBColorSpace or NoColorSpace in three.js r152+. */
152-
export const LinearEncoding = 3000;
153-
/** @deprecated Use SRGBColorSpace in three.js r152+. */
154-
export const sRGBEncoding = 3001;
155151
export const BasicDepthPacking = 3200;
156152
export const RGBADepthPacking = 3201;
157153
export const TangentSpaceNormalMap = 0;

src/core/RenderTarget.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { EventDispatcher } from './EventDispatcher.js';
22
import { Texture } from '../textures/Texture.js';
3-
import { LinearFilter, NoColorSpace, SRGBColorSpace, sRGBEncoding } from '../constants.js';
3+
import { LinearFilter } from '../constants.js';
44
import { Vector4 } from '../math/Vector4.js';
55
import { Source } from '../textures/Source.js';
6-
import { warnOnce } from '../utils.js';
76

87
/*
98
In options, we can specify:
@@ -29,14 +28,6 @@ class RenderTarget extends EventDispatcher {
2928

3029
const image = { width: width, height: height, depth: 1 };
3130

32-
if ( options.encoding !== undefined ) {
33-
34-
// @deprecated, r152
35-
warnOnce( 'THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace.' );
36-
options.colorSpace = options.encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
37-
38-
}
39-
4031
options = Object.assign( {
4132
generateMipmaps: false,
4233
internalFormat: null,

src/loaders/DataTextureLoader.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ class DataTextureLoader extends Loader {
7575

7676
texture.colorSpace = texData.colorSpace;
7777

78-
} else if ( texData.encoding !== undefined ) { // @deprecated, r152
79-
80-
texture.encoding = texData.encoding;
81-
8278
}
8379

8480
if ( texData.flipY !== undefined ) {

src/loaders/ObjectLoader.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,6 @@ class ObjectLoader extends Loader {
659659
if ( data.internalFormat !== undefined ) texture.internalFormat = data.internalFormat;
660660
if ( data.type !== undefined ) texture.type = data.type;
661661
if ( data.colorSpace !== undefined ) texture.colorSpace = data.colorSpace;
662-
if ( data.encoding !== undefined ) texture.encoding = data.encoding; // @deprecated, r152
663662

664663
if ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TEXTURE_FILTER );
665664
if ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TEXTURE_FILTER );

src/objects/Mesh.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,6 @@ function checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, n
388388
_uvC.fromBufferAttribute( uv1, c );
389389

390390
intersection.uv1 = Triangle.getInterpolation( _intersectionPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2() );
391-
intersection.uv2 = intersection.uv1; // @deprecated, r152
392391

393392
}
394393

src/renderers/WebGLCubeRenderTarget.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import { BackSide, LinearFilter, LinearMipmapLinearFilter, NoBlending, NoColorSpace, SRGBColorSpace, sRGBEncoding } from '../constants.js';
1+
import { BackSide, LinearFilter, LinearMipmapLinearFilter, NoBlending } from '../constants.js';
22
import { Mesh } from '../objects/Mesh.js';
33
import { BoxGeometry } from '../geometries/BoxGeometry.js';
44
import { ShaderMaterial } from '../materials/ShaderMaterial.js';
55
import { cloneUniforms } from './shaders/UniformsUtils.js';
66
import { WebGLRenderTarget } from './WebGLRenderTarget.js';
77
import { CubeCamera } from '../cameras/CubeCamera.js';
88
import { CubeTexture } from '../textures/CubeTexture.js';
9-
import { warnOnce } from '../utils.js';
109

1110
class WebGLCubeRenderTarget extends WebGLRenderTarget {
1211

@@ -19,14 +18,6 @@ class WebGLCubeRenderTarget extends WebGLRenderTarget {
1918
const image = { width: size, height: size, depth: 1 };
2019
const images = [ image, image, image, image, image, image ];
2120

22-
if ( options.encoding !== undefined ) {
23-
24-
// @deprecated, r152
25-
warnOnce( 'THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace.' );
26-
options.colorSpace = options.encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
27-
28-
}
29-
3021
this.texture = new CubeTexture( images, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );
3122

3223
// By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)

src/renderers/WebGLRenderer.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import {
1111
LinearMipmapLinearFilter,
1212
SRGBColorSpace,
1313
LinearSRGBColorSpace,
14-
sRGBEncoding,
15-
LinearEncoding,
1614
RGBAIntegerFormat,
1715
RGIntegerFormat,
1816
RedIntegerFormat,
@@ -2576,20 +2574,6 @@ class WebGLRenderer {
25762574

25772575
}
25782576

2579-
get outputEncoding() { // @deprecated, r152
2580-
2581-
console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
2582-
return this.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding;
2583-
2584-
}
2585-
2586-
set outputEncoding( encoding ) { // @deprecated, r152
2587-
2588-
console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
2589-
this.outputColorSpace = encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace;
2590-
2591-
}
2592-
25932577
get useLegacyLights() { // @deprecated, r155
25942578

25952579
console.warn( 'THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.' );

src/textures/Texture.js

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,12 @@ import {
88
LinearMipmapLinearFilter,
99
LinearFilter,
1010
UVMapping,
11-
sRGBEncoding,
12-
SRGBColorSpace,
1311
NoColorSpace,
14-
LinearEncoding
1512
} from '../constants.js';
1613
import * as MathUtils from '../math/MathUtils.js';
1714
import { Vector2 } from '../math/Vector2.js';
1815
import { Matrix3 } from '../math/Matrix3.js';
1916
import { Source } from './Source.js';
20-
import { warnOnce } from '../utils.js';
2117

2218
let _textureId = 0;
2319

@@ -66,17 +62,7 @@ class Texture extends EventDispatcher {
6662
this.flipY = true;
6763
this.unpackAlignment = 4; // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)
6864

69-
if ( typeof colorSpace === 'string' ) {
70-
71-
this.colorSpace = colorSpace;
72-
73-
} else { // @deprecated, r152
74-
75-
warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' );
76-
this.colorSpace = colorSpace === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
77-
78-
}
79-
65+
this.colorSpace = colorSpace;
8066

8167
this.userData = {};
8268

@@ -315,20 +301,6 @@ class Texture extends EventDispatcher {
315301

316302
}
317303

318-
get encoding() { // @deprecated, r152
319-
320-
warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' );
321-
return this.colorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding;
322-
323-
}
324-
325-
set encoding( encoding ) { // @deprecated, r152
326-
327-
warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' );
328-
this.colorSpace = encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
329-
330-
}
331-
332304
}
333305

334306
Texture.DEFAULT_IMAGE = null;

0 commit comments

Comments
 (0)