Skip to content

Commit

Permalink
Core: Remove deprecated code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Jan 31, 2024
1 parent 841d2e7 commit 9a74f14
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 84 deletions.
10 changes: 1 addition & 9 deletions examples/jsm/nodes/core/NodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
ColorNodeUniform, Matrix3NodeUniform, Matrix4NodeUniform
} from '../../renderers/common/nodes/NodeUniform.js';

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

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

}

/** @deprecated, r152 */
getTextureEncodingFromMap( map ) {

console.warn( 'THREE.NodeBuilder: Method .getTextureEncodingFromMap replaced by .getTextureColorSpaceFromMap in r152+.' );
return this.getTextureColorSpaceFromMap( map ) === SRGBColorSpace ? sRGBEncoding : LinearEncoding;

}

getTextureColorSpaceFromMap( map ) {

let colorSpace;
Expand Down
4 changes: 0 additions & 4 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ export const AdditiveAnimationBlendMode = 2501;
export const TrianglesDrawMode = 0;
export const TriangleStripDrawMode = 1;
export const TriangleFanDrawMode = 2;
/** @deprecated Use LinearSRGBColorSpace or NoColorSpace in three.js r152+. */
export const LinearEncoding = 3000;
/** @deprecated Use SRGBColorSpace in three.js r152+. */
export const sRGBEncoding = 3001;
export const BasicDepthPacking = 3200;
export const RGBADepthPacking = 3201;
export const TangentSpaceNormalMap = 0;
Expand Down
11 changes: 1 addition & 10 deletions src/core/RenderTarget.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { EventDispatcher } from './EventDispatcher.js';
import { Texture } from '../textures/Texture.js';
import { LinearFilter, NoColorSpace, SRGBColorSpace, sRGBEncoding } from '../constants.js';
import { LinearFilter } from '../constants.js';
import { Vector4 } from '../math/Vector4.js';
import { Source } from '../textures/Source.js';
import { warnOnce } from '../utils.js';

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

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

if ( options.encoding !== undefined ) {

// @deprecated, r152
warnOnce( 'THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace.' );
options.colorSpace = options.encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace;

}

options = Object.assign( {
generateMipmaps: false,
internalFormat: null,
Expand Down
4 changes: 0 additions & 4 deletions src/loaders/DataTextureLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ class DataTextureLoader extends Loader {

texture.colorSpace = texData.colorSpace;

} else if ( texData.encoding !== undefined ) { // @deprecated, r152

texture.encoding = texData.encoding;

}

if ( texData.flipY !== undefined ) {
Expand Down
1 change: 0 additions & 1 deletion src/loaders/ObjectLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,6 @@ class ObjectLoader extends Loader {
if ( data.internalFormat !== undefined ) texture.internalFormat = data.internalFormat;
if ( data.type !== undefined ) texture.type = data.type;
if ( data.colorSpace !== undefined ) texture.colorSpace = data.colorSpace;
if ( data.encoding !== undefined ) texture.encoding = data.encoding; // @deprecated, r152

if ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TEXTURE_FILTER );
if ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TEXTURE_FILTER );
Expand Down
1 change: 0 additions & 1 deletion src/objects/Mesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ function checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, n
_uvC.fromBufferAttribute( uv1, c );

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

}

Expand Down
11 changes: 1 addition & 10 deletions src/renderers/WebGLCubeRenderTarget.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { BackSide, LinearFilter, LinearMipmapLinearFilter, NoBlending, NoColorSpace, SRGBColorSpace, sRGBEncoding } from '../constants.js';
import { BackSide, LinearFilter, LinearMipmapLinearFilter, NoBlending } from '../constants.js';
import { Mesh } from '../objects/Mesh.js';
import { BoxGeometry } from '../geometries/BoxGeometry.js';
import { ShaderMaterial } from '../materials/ShaderMaterial.js';
import { cloneUniforms } from './shaders/UniformsUtils.js';
import { WebGLRenderTarget } from './WebGLRenderTarget.js';
import { CubeCamera } from '../cameras/CubeCamera.js';
import { CubeTexture } from '../textures/CubeTexture.js';
import { warnOnce } from '../utils.js';

class WebGLCubeRenderTarget extends WebGLRenderTarget {

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

if ( options.encoding !== undefined ) {

// @deprecated, r152
warnOnce( 'THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace.' );
options.colorSpace = options.encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace;

}

this.texture = new CubeTexture( images, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );

// By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)
Expand Down
16 changes: 0 additions & 16 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import {
LinearMipmapLinearFilter,
SRGBColorSpace,
LinearSRGBColorSpace,
sRGBEncoding,
LinearEncoding,
RGBAIntegerFormat,
RGIntegerFormat,
RedIntegerFormat,
Expand Down Expand Up @@ -2576,20 +2574,6 @@ class WebGLRenderer {

}

get outputEncoding() { // @deprecated, r152

console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
return this.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding;

}

set outputEncoding( encoding ) { // @deprecated, r152

console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
this.outputColorSpace = encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace;

}

get useLegacyLights() { // @deprecated, r155

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.' );
Expand Down
30 changes: 1 addition & 29 deletions src/textures/Texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@ import {
LinearMipmapLinearFilter,
LinearFilter,
UVMapping,
sRGBEncoding,
SRGBColorSpace,
NoColorSpace,
LinearEncoding
} from '../constants.js';
import * as MathUtils from '../math/MathUtils.js';
import { Vector2 } from '../math/Vector2.js';
import { Matrix3 } from '../math/Matrix3.js';
import { Source } from './Source.js';
import { warnOnce } from '../utils.js';

let _textureId = 0;

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

if ( typeof colorSpace === 'string' ) {

this.colorSpace = colorSpace;

} else { // @deprecated, r152

warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' );
this.colorSpace = colorSpace === sRGBEncoding ? SRGBColorSpace : NoColorSpace;

}

this.colorSpace = colorSpace;

this.userData = {};

Expand Down Expand Up @@ -315,20 +301,6 @@ class Texture extends EventDispatcher {

}

get encoding() { // @deprecated, r152

warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' );
return this.colorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding;

}

set encoding( encoding ) { // @deprecated, r152

warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' );
this.colorSpace = encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace;

}

}

Texture.DEFAULT_IMAGE = null;
Expand Down

0 comments on commit 9a74f14

Please sign in to comment.