Skip to content

Commit cee9706

Browse files
authored
WebGLRenderer: Remove RGBEEncoding and RGBEFormat. (mrdoob#23060)
* WebGLRenderer: Remove RGBEEncoding and RGBEFormat. * Shaders: Clean up.
1 parent 1f3c121 commit cee9706

24 files changed

+16
-124
lines changed

docs/api/en/constants/Textures.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ <h2>Formats</h2>
151151
THREE.RGBAIntegerFormat
152152
THREE.LuminanceFormat
153153
THREE.LuminanceAlphaFormat
154-
THREE.RGBEFormat
155154
THREE.DepthFormat
156155
THREE.DepthStencilFormat
157156
</code>
@@ -199,8 +198,6 @@ <h2>Formats</h2>
199198
The same process occurs as for the [page:constant LuminanceFormat], except that the
200199
alpha channel may have values other than *1.0*.<br /><br />
201200

202-
[page:constant RGBEFormat] is identical to [page:constant RGBAFormat].<br /><br />
203-
204201
[page:constant DepthFormat] reads each element as a single depth value, converts it to floating point, and clamps to the range [0,1].
205202
This is the default for [page:DepthTexture DepthTexture].<br /><br />
206203

@@ -560,7 +557,6 @@ <h2>Encoding</h2>
560557
THREE.LinearEncoding
561558
THREE.sRGBEncoding
562559
THREE.GammaEncoding
563-
THREE.RGBEEncoding
564560
THREE.BasicDepthPacking
565561
THREE.RGBADepthPacking
566562
</code>

docs/api/en/extras/PMREMGenerator.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ <h3>[method:WebGLRenderTarget fromEquirectangular]( [param:Texture equirectangul
4242
<p>
4343
[page:Texture equirectangular] - The equirectangular texture.<br /><br />
4444

45-
Generates a PMREM from an equirectangular texture, which can be either LDR (RGBFormat) or HDR (RGBEFormat).
45+
Generates a PMREM from an equirectangular texture, which can be either LDR or HDR.
4646
The ideal input image size is 1k (1024 x 512), as this matches best with the 256 x 256 cubemap output.
4747
</p>
4848

4949
<h3>[method:WebGLRenderTarget fromCubemap]( [param:CubeTexture cubemap] )</h3>
5050
<p>
5151
[page:CubeTexture cubemap] - The cubemap texture.<br /><br />
5252

53-
Generates a PMREM from an cubemap texture, which can be either LDR (RGBFormat) or HDR (RGBEFormat).
53+
Generates a PMREM from an cubemap texture, which can be either LDR or HDR.
5454
The ideal input cube size is 256 x 256, as this matches best with the 256 x 256 cubemap output.
5555
</p>
5656

docs/api/ko/constants/Textures.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ <h2>포맷</h2>
148148
THREE.RGBAIntegerFormat
149149
THREE.LuminanceFormat
150150
THREE.LuminanceAlphaFormat
151-
THREE.RGBEFormat
152151
THREE.DepthFormat
153152
THREE.DepthStencilFormat
154153
</code>
@@ -195,8 +194,6 @@ <h2>포맷</h2>
195194
The same process occurs as for the [page:constant LuminanceFormat]와 같은 절차가 이루어지며, 알파 채널에 *1.0* 이외의 값이 들어갈 수 있다는 점만 다릅니다.
196195
<br /><br />
197196

198-
[page:constant RGBEFormat]은 [page:constant RGBAFormat]과 동일합니다..<br /><br />
199-
200197
[page:constant DepthFormat]은 각 요소를 단일 깊이 값으로 일거들이며 부동 소수점으로 변환하고, [0,1]범위에 고정합니다.
201198
[page:DepthTexture DepthTexture]의 기본값이기도 합니다.<br /><br />
202199

@@ -554,7 +551,6 @@ <h2>인코딩</h2>
554551
THREE.LinearEncoding
555552
THREE.sRGBEncoding
556553
THREE.GammaEncoding
557-
THREE.RGBEEncoding
558554
THREE.BasicDepthPacking
559555
THREE.RGBADepthPacking
560556
</code>

docs/api/ko/extras/PMREMGenerator.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ <h1>[name]</h1>
1111

1212
<p class="desc">
1313
이 클래스는 큐브맵 환경 텍스처로부터 사전 필터링된 Mipmap Radiance Environment Map(PMREM)을 생성합니다.
14-
이를 통해 재질의 거칠기에 따라 다양한 수준의 블러를 빠르게 적용할 수 있습니다. RGBE와 같은 비선형 형식을 지원할 수 있도록 사용자 지정 보간을 수행할 수 있는 특수 CubeUV 형식으로 포장되어 있습니다.
14+
이를 통해 재질의 거칠기에 따라 다양한 수준의 블러를 빠르게 적용할 수 있습니다. RGBE와 같은 비선형 형식을 지원할 수 있도록 사용자 지정 보간을 수행할 수 있는 특수 CubeUV 형식으로 포장되어 있습니다.
1515
기존의 mipmap 체인과는 달리, LOD_MIN 수준까지만 내려가며(위), 더 높은 거칠기 수준과 연관된 동일한 LOD_MIN 해상도에서 훨씬 더 많은 필터링된 'mips'를 생성합니다.
1616
이러한 방법으로 샘플링 계산을 제한하면서 확산 조명을 부드럽게 보간하기 위한 해상도를 유지합니다.
1717
</p>
@@ -40,15 +40,15 @@ <h3>[method:WebGLRenderTarget fromEquirectangular]( [param:Texture equirectangul
4040
<p>
4141
[page:Texture equirectangular] - 등장방형 텍스쳐입니다.<br /><br />
4242

43-
LDR(RGBFormat) 또는 HDR(RGBEFormat)일 수 있는 등장방형 텍스처로부터 PMREM을 생성합니다.
43+
LDR 또는 HDR일 수 있는 등장방형 텍스처로부터 PMREM을 생성합니다.
4444
이상적인 입력 이미지 크기는 1k(1024 x 512)로, 256 x 256 큐브 맵 출력과 가장 잘 일치합니다.
4545
</p>
4646

4747
<h3>[method:WebGLRenderTarget fromCubemap]( [param:CubeTexture cubemap] )</h3>
4848
<p>
4949
[page:CubeTexture cubemap] - 큐브맵 텍스쳐입니다.<br /><br />
5050

51-
LDR(RGBFormat) 또는 HDR(RGBEFormat)일 수 있는 큐브맵 텍스처로부터 PMREM을 생성합니다.
51+
LDR 또는 HDR일 수 있는 큐브맵 텍스처로부터 PMREM을 생성합니다.
5252
이상적인 입력 이미지 크기는 1k(1024 x 512)로, 256 x 256 큐브 맵 출력과 가장 잘 일치합니다.
5353
</p>
5454

@@ -64,8 +64,8 @@ <h3>[method:undefined compileEquirectangularShader]()</h3>
6464

6565
<h3>[method:undefined dispose]()</h3>
6666
<p>
67-
PMREM 제너레이터의 내장 메모리를 폐기합니다.
68-
PMREMGenerator는 정적 클래스이므로 두 개 이상의 PMREMGenerator 개체가 필요하지 않습니다.
67+
PMREM 제너레이터의 내장 메모리를 폐기합니다.
68+
PMREMGenerator는 정적 클래스이므로 두 개 이상의 PMREMGenerator 개체가 필요하지 않습니다.
6969
이 경우 둘 중 하나에 대해 dispose()를 호출하면 다른 항목도 사용할 수 없게 됩니다.
7070
</p>
7171

docs/api/zh/constants/Textures.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ <h2>格式</h2>
141141
THREE.RGBAIntegerFormat
142142
THREE.LuminanceFormat
143143
THREE.LuminanceAlphaFormat
144-
THREE.RGBEFormat
145144
THREE.DepthFormat
146145
THREE.DepthStencilFormat
147146
</code>
@@ -185,8 +184,6 @@ <h2>格式</h2>
185184
[page:constant LuminanceAlphaFormat] 将每个元素同时作为亮度分量和Alpha分量来读取。
186185
和上面[page:constant LuminanceFormat]的处理过程是一致的,除了Alpha分量具有除了*1.0*以外的值。<br /><br />
187186

188-
[page:constant RGBEFormat] 与 [page:constant RGBAFormat] 是相同的。<br /><br />
189-
190187
[page:constant DepthFormat]将每个元素作为单独的深度值来读取,将其转换为范围限制在[0,1]区间的浮点数。
191188
它是[page:DepthTexture DepthTexture]的默认值。<br /><br />
192189

@@ -549,7 +546,6 @@ <h2>编码</h2>
549546
THREE.LinearEncoding
550547
THREE.sRGBEncoding
551548
THREE.GammaEncoding
552-
THREE.RGBEEncoding
553549
THREE.BasicDepthPacking
554550
THREE.RGBADepthPacking
555551
</code>

docs/api/zh/extras/PMREMGenerator.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ <h3>[method:WebGLRenderTarget fromEquirectangular]( [param:Texture equirectangul
4242
<p>
4343
[page:Texture equirectangular] - The equirectangular texture.<br /><br />
4444

45-
Generates a PMREM from an equirectangular texture, which can be either LDR (RGBFormat) or HDR (RGBEFormat).
45+
Generates a PMREM from an equirectangular texture, which can be either LDR or HDR.
4646
The ideal input image size is 1k (1024 x 512), as this matches best with the 256 x 256 cubemap output.
4747
</p>
4848

4949
<h3>[method:WebGLRenderTarget fromCubemap]( [param:CubeTexture cubemap] )</h3>
5050
<p>
5151
[page:CubeTexture cubemap] - The cubemap texture.<br /><br />
5252

53-
Generates a PMREM from an cubemap texture, which can be either LDR (RGBFormat) or HDR (RGBEFormat).
53+
Generates a PMREM from an cubemap texture, which can be either LDR or HDR.
5454
The ideal input cube size is 256 x 256, as this matches best with the 256 x 256 cubemap output.
5555
</p>
5656

editor/js/libs/ui.three.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class UITexture extends UISpan {
5656

5757
// assuming RGBE/Radiance HDR iamge format
5858

59-
const loader = new RGBELoader().setDataType( THREE.FloatType );
59+
const loader = new RGBELoader();
6060
loader.load( event.target.result, function ( hdrTexture ) {
6161

6262
hdrTexture.sourceFile = file.name;

examples/jsm/loaders/HDRCubeTextureLoader.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ import {
77
LinearEncoding,
88
LinearFilter,
99
Loader,
10-
NearestFilter,
11-
RGBAFormat,
12-
RGBEEncoding,
13-
RGBFormat,
14-
UnsignedByteType
10+
RGBFormat
1511
} from '../../../build/three.module.js';
1612
import { RGBELoader } from '../loaders/RGBELoader.js';
1713

@@ -47,15 +43,6 @@ class HDRCubeTextureLoader extends Loader {
4743

4844
switch ( texture.type ) {
4945

50-
case UnsignedByteType:
51-
52-
texture.encoding = RGBEEncoding;
53-
texture.format = RGBAFormat;
54-
texture.minFilter = NearestFilter;
55-
texture.magFilter = NearestFilter;
56-
texture.generateMipmaps = false;
57-
break;
58-
5946
case FloatType:
6047

6148
texture.encoding = LinearEncoding;

examples/jsm/loaders/RGBELoader.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ import {
55
HalfFloatType,
66
LinearEncoding,
77
LinearFilter,
8-
NearestFilter,
9-
RGBEEncoding,
10-
RGBEFormat,
118
RGBFormat,
12-
UnsignedByteType
139
} from '../../../build/three.module.js';
1410

1511
// https://github.com/mrdoob/three.js/issues/5552
@@ -378,13 +374,6 @@ class RGBELoader extends DataTextureLoader {
378374

379375
switch ( this.type ) {
380376

381-
case UnsignedByteType:
382-
383-
data = image_rgba_data;
384-
format = RGBEFormat; // handled as THREE.RGBAFormat in shaders
385-
type = UnsignedByteType;
386-
break;
387-
388377
case FloatType:
389378

390379
numElements = image_rgba_data.length / 4;
@@ -455,15 +444,6 @@ class RGBELoader extends DataTextureLoader {
455444

456445
switch ( texture.type ) {
457446

458-
case UnsignedByteType:
459-
460-
texture.encoding = RGBEEncoding;
461-
texture.minFilter = NearestFilter;
462-
texture.magFilter = NearestFilter;
463-
texture.generateMipmaps = false;
464-
texture.flipY = true;
465-
break;
466-
467447
case FloatType:
468448

469449
texture.encoding = LinearEncoding;

examples/jsm/nodes/utils/ColorSpaceNode.js

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
GammaEncoding,
33
LinearEncoding,
4-
RGBEEncoding,
54
sRGBEncoding
65
} from '../../../../build/three.module.js';
76

@@ -143,33 +142,12 @@ ColorSpaceNode.Nodes = ( function () {
143142
}`
144143
);
145144

146-
const RGBEToLinear = new FunctionNode( /* glsl */`
147-
vec4 RGBEToLinear( in vec4 value ) {
148-
149-
return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );
150-
151-
}`
152-
);
153-
154-
const LinearToRGBE = new FunctionNode( /* glsl */`
155-
vec4 LinearToRGBE( in vec4 value ) {
156-
157-
float maxComponent = max( max( value.r, value.g ), value.b );
158-
float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );
159-
return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );
160-
161-
}`
162-
);
163-
164-
165145
return {
166146
LinearToLinear: LinearToLinear,
167147
GammaToLinear: GammaToLinear,
168148
LinearToGamma: LinearToGamma,
169149
sRGBToLinear: sRGBToLinear,
170-
LinearTosRGB: LinearTosRGB,
171-
RGBEToLinear: RGBEToLinear,
172-
LinearToRGBE: LinearToRGBE
150+
LinearTosRGB: LinearTosRGB
173151
};
174152

175153
} )();
@@ -182,9 +160,6 @@ ColorSpaceNode.LINEAR_TO_GAMMA = 'LinearToGamma';
182160
ColorSpaceNode.SRGB_TO_LINEAR = 'sRGBToLinear';
183161
ColorSpaceNode.LINEAR_TO_SRGB = 'LinearTosRGB';
184162

185-
ColorSpaceNode.RGBE_TO_LINEAR = 'RGBEToLinear';
186-
ColorSpaceNode.LINEAR_TO_RGBE = 'LinearToRGBE';
187-
188163
ColorSpaceNode.getEncodingComponents = function ( encoding ) {
189164

190165
switch ( encoding ) {
@@ -193,8 +168,6 @@ ColorSpaceNode.getEncodingComponents = function ( encoding ) {
193168
return [ 'Linear' ];
194169
case sRGBEncoding:
195170
return [ 'sRGB' ];
196-
case RGBEEncoding:
197-
return [ 'RGBE' ];
198171
case GammaEncoding:
199172
return [ 'Gamma', new ExpressionNode( 'float( GAMMA_FACTOR )', 'f' ) ];
200173

0 commit comments

Comments
 (0)