Skip to content

Commit

Permalink
WebGLRenderer: Remove RGBEEncoding and RGBEFormat. (mrdoob#23060)
Browse files Browse the repository at this point in the history
* WebGLRenderer: Remove RGBEEncoding and RGBEFormat.

* Shaders: Clean up.
  • Loading branch information
Mugen87 authored Dec 21, 2021
1 parent 1f3c121 commit cee9706
Show file tree
Hide file tree
Showing 24 changed files with 16 additions and 124 deletions.
4 changes: 0 additions & 4 deletions docs/api/en/constants/Textures.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ <h2>Formats</h2>
THREE.RGBAIntegerFormat
THREE.LuminanceFormat
THREE.LuminanceAlphaFormat
THREE.RGBEFormat
THREE.DepthFormat
THREE.DepthStencilFormat
</code>
Expand Down Expand Up @@ -199,8 +198,6 @@ <h2>Formats</h2>
The same process occurs as for the [page:constant LuminanceFormat], except that the
alpha channel may have values other than *1.0*.<br /><br />

[page:constant RGBEFormat] is identical to [page:constant RGBAFormat].<br /><br />

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

Expand Down Expand Up @@ -560,7 +557,6 @@ <h2>Encoding</h2>
THREE.LinearEncoding
THREE.sRGBEncoding
THREE.GammaEncoding
THREE.RGBEEncoding
THREE.BasicDepthPacking
THREE.RGBADepthPacking
</code>
Expand Down
4 changes: 2 additions & 2 deletions docs/api/en/extras/PMREMGenerator.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ <h3>[method:WebGLRenderTarget fromEquirectangular]( [param:Texture equirectangul
<p>
[page:Texture equirectangular] - The equirectangular texture.<br /><br />

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

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

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

Expand Down
4 changes: 0 additions & 4 deletions docs/api/ko/constants/Textures.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ <h2>포맷</h2>
THREE.RGBAIntegerFormat
THREE.LuminanceFormat
THREE.LuminanceAlphaFormat
THREE.RGBEFormat
THREE.DepthFormat
THREE.DepthStencilFormat
</code>
Expand Down Expand Up @@ -195,8 +194,6 @@ <h2>포맷</h2>
The same process occurs as for the [page:constant LuminanceFormat]와 같은 절차가 이루어지며, 알파 채널에 *1.0* 이외의 값이 들어갈 수 있다는 점만 다릅니다.
<br /><br />

[page:constant RGBEFormat]은 [page:constant RGBAFormat]과 동일합니다..<br /><br />

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

Expand Down Expand Up @@ -554,7 +551,6 @@ <h2>인코딩</h2>
THREE.LinearEncoding
THREE.sRGBEncoding
THREE.GammaEncoding
THREE.RGBEEncoding
THREE.BasicDepthPacking
THREE.RGBADepthPacking
</code>
Expand Down
10 changes: 5 additions & 5 deletions docs/api/ko/extras/PMREMGenerator.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h1>[name]</h1>

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

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

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

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

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

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

Expand Down
4 changes: 0 additions & 4 deletions docs/api/zh/constants/Textures.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ <h2>格式</h2>
THREE.RGBAIntegerFormat
THREE.LuminanceFormat
THREE.LuminanceAlphaFormat
THREE.RGBEFormat
THREE.DepthFormat
THREE.DepthStencilFormat
</code>
Expand Down Expand Up @@ -185,8 +184,6 @@ <h2>格式</h2>
[page:constant LuminanceAlphaFormat] 将每个元素同时作为亮度分量和Alpha分量来读取。
和上面[page:constant LuminanceFormat]的处理过程是一致的,除了Alpha分量具有除了*1.0*以外的值。<br /><br />

[page:constant RGBEFormat] 与 [page:constant RGBAFormat] 是相同的。<br /><br />

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

Expand Down Expand Up @@ -549,7 +546,6 @@ <h2>编码</h2>
THREE.LinearEncoding
THREE.sRGBEncoding
THREE.GammaEncoding
THREE.RGBEEncoding
THREE.BasicDepthPacking
THREE.RGBADepthPacking
</code>
Expand Down
4 changes: 2 additions & 2 deletions docs/api/zh/extras/PMREMGenerator.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ <h3>[method:WebGLRenderTarget fromEquirectangular]( [param:Texture equirectangul
<p>
[page:Texture equirectangular] - The equirectangular texture.<br /><br />

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion editor/js/libs/ui.three.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class UITexture extends UISpan {

// assuming RGBE/Radiance HDR iamge format

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

hdrTexture.sourceFile = file.name;
Expand Down
15 changes: 1 addition & 14 deletions examples/jsm/loaders/HDRCubeTextureLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import {
LinearEncoding,
LinearFilter,
Loader,
NearestFilter,
RGBAFormat,
RGBEEncoding,
RGBFormat,
UnsignedByteType
RGBFormat
} from '../../../build/three.module.js';
import { RGBELoader } from '../loaders/RGBELoader.js';

Expand Down Expand Up @@ -47,15 +43,6 @@ class HDRCubeTextureLoader extends Loader {

switch ( texture.type ) {

case UnsignedByteType:

texture.encoding = RGBEEncoding;
texture.format = RGBAFormat;
texture.minFilter = NearestFilter;
texture.magFilter = NearestFilter;
texture.generateMipmaps = false;
break;

case FloatType:

texture.encoding = LinearEncoding;
Expand Down
20 changes: 0 additions & 20 deletions examples/jsm/loaders/RGBELoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import {
HalfFloatType,
LinearEncoding,
LinearFilter,
NearestFilter,
RGBEEncoding,
RGBEFormat,
RGBFormat,
UnsignedByteType
} from '../../../build/three.module.js';

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

switch ( this.type ) {

case UnsignedByteType:

data = image_rgba_data;
format = RGBEFormat; // handled as THREE.RGBAFormat in shaders
type = UnsignedByteType;
break;

case FloatType:

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

switch ( texture.type ) {

case UnsignedByteType:

texture.encoding = RGBEEncoding;
texture.minFilter = NearestFilter;
texture.magFilter = NearestFilter;
texture.generateMipmaps = false;
texture.flipY = true;
break;

case FloatType:

texture.encoding = LinearEncoding;
Expand Down
29 changes: 1 addition & 28 deletions examples/jsm/nodes/utils/ColorSpaceNode.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
GammaEncoding,
LinearEncoding,
RGBEEncoding,
sRGBEncoding
} from '../../../../build/three.module.js';

Expand Down Expand Up @@ -143,33 +142,12 @@ ColorSpaceNode.Nodes = ( function () {
}`
);

const RGBEToLinear = new FunctionNode( /* glsl */`
vec4 RGBEToLinear( in vec4 value ) {
return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );
}`
);

const LinearToRGBE = new FunctionNode( /* glsl */`
vec4 LinearToRGBE( in vec4 value ) {
float maxComponent = max( max( value.r, value.g ), value.b );
float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );
return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );
}`
);


return {
LinearToLinear: LinearToLinear,
GammaToLinear: GammaToLinear,
LinearToGamma: LinearToGamma,
sRGBToLinear: sRGBToLinear,
LinearTosRGB: LinearTosRGB,
RGBEToLinear: RGBEToLinear,
LinearToRGBE: LinearToRGBE
LinearTosRGB: LinearTosRGB
};

} )();
Expand All @@ -182,9 +160,6 @@ ColorSpaceNode.LINEAR_TO_GAMMA = 'LinearToGamma';
ColorSpaceNode.SRGB_TO_LINEAR = 'sRGBToLinear';
ColorSpaceNode.LINEAR_TO_SRGB = 'LinearTosRGB';

ColorSpaceNode.RGBE_TO_LINEAR = 'RGBEToLinear';
ColorSpaceNode.LINEAR_TO_RGBE = 'LinearToRGBE';

ColorSpaceNode.getEncodingComponents = function ( encoding ) {

switch ( encoding ) {
Expand All @@ -193,8 +168,6 @@ ColorSpaceNode.getEncodingComponents = function ( encoding ) {
return [ 'Linear' ];
case sRGBEncoding:
return [ 'sRGB' ];
case RGBEEncoding:
return [ 'RGBE' ];
case GammaEncoding:
return [ 'Gamma', new ExpressionNode( 'float( GAMMA_FACTOR )', 'f' ) ];

Expand Down
7 changes: 1 addition & 6 deletions examples/jsm/renderers/nodes/display/ColorSpaceNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ShaderNode,
lessThanEqual } from '../ShaderNode.js';

import { LinearEncoding,
sRGBEncoding/*, RGBEEncoding, GammaEncoding*/ } from '../../../../../build/three.module.js';
sRGBEncoding/*, GammaEncoding*/ } from '../../../../../build/three.module.js';

export const LinearToLinear = new ShaderNode( ( inputs ) => {

Expand Down Expand Up @@ -60,8 +60,6 @@ function getEncodingComponents( encoding ) {
case sRGBEncoding:
return [ 'sRGB' ];
/*
case RGBEEncoding:
return [ 'RGBE' ];
case GammaEncoding:
return [ 'Gamma', new CodeNode( 'float( GAMMA_FACTOR )' ) ];
*/
Expand All @@ -79,9 +77,6 @@ class ColorSpaceNode extends TempNode {
/*
static GAMMA_TO_LINEAR = 'GammaToLinear';
static LINEAR_TO_GAMMA = 'LinearToGamma';
static RGBE_TO_LINEAR = 'RGBEToLinear';
static LINEAR_TO_RGBE = 'LinearToRGBE';
*/
constructor( method, node ) {

Expand Down
1 change: 0 additions & 1 deletion examples/misc_controls_arcball.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@
render();

new RGBELoader()
.setDataType( THREE.UnsignedByteType )
.setPath( 'textures/equirectangular/' )
.load( 'venice_sunset_1k.hdr', function ( hdrEquirect ) {

Expand Down
1 change: 0 additions & 1 deletion examples/webgl_loader_texture_hdr.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
camera = new THREE.OrthographicCamera( - aspect, aspect, 1, - 1, 0, 1 );

new RGBELoader()
.setDataType( THREE.UnsignedByteType ) // alt: FloatType, HalfFloatType
.load( 'textures/memorial.hdr', function ( texture, textureData ) {

//console.log( textureData );
Expand Down
1 change: 0 additions & 1 deletion examples/webgl_materials_envmaps_hdr.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
const hdrUrls = [ 'px.hdr', 'nx.hdr', 'py.hdr', 'ny.hdr', 'pz.hdr', 'nz.hdr' ];
hdrCubeMap = new HDRCubeTextureLoader()
.setPath( './textures/cube/pisaHDR/' )
.setDataType( THREE.UnsignedByteType )
.load( hdrUrls, function () {

hdrCubeRenderTarget = pmremGenerator.fromCubemap( hdrCubeMap );
Expand Down
1 change: 0 additions & 1 deletion examples/webgl_materials_envmaps_hdr_nodes.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
const hdrUrls = [ 'px.hdr', 'nx.hdr', 'py.hdr', 'ny.hdr', 'pz.hdr', 'nz.hdr' ];
hdrCubeMap = new HDRCubeTextureLoader()
.setPath( './textures/cube/pisaHDR/' )
.setDataType( THREE.UnsignedByteType )
.load( hdrUrls, function () {

hdrCubeRenderTarget = pmremGenerator.fromCubemap( hdrCubeMap );
Expand Down
1 change: 0 additions & 1 deletion examples/webgl_materials_envmaps_pmrem_nodes.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
const hdrUrls = [ 'px.hdr', 'nx.hdr', 'py.hdr', 'ny.hdr', 'pz.hdr', 'nz.hdr' ];
hdrCubeMap = new HDRCubeTextureLoader()
.setPath( './textures/cube/pisaHDR/' )
.setDataType( THREE.UnsignedByteType )
.load( hdrUrls, function () {

hdrCubeRenderTarget = pmremGenerator.fromCubemap( hdrCubeMap );
Expand Down
1 change: 0 additions & 1 deletion examples/webgl_materials_standard_nodes.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@

const filename = environments[ name ].filename;
new RGBELoader()
.setDataType( THREE.UnsignedByteType )
.setPath( 'textures/equirectangular/' )
.load( filename, function ( hdrEquirect ) {

Expand Down
1 change: 0 additions & 1 deletion examples/webgl_pmrem_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@

let radianceMap = null;
new RGBELoader()
.setDataType( THREE.UnsignedByteType )
// .setDataType( THREE.FloatType )
.setPath( 'textures/equirectangular/' )
.load( 'spot1Lux.hdr', function ( texture ) {
Expand Down
1 change: 0 additions & 1 deletion examples/webxr_ar_lighting.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
//

new RGBELoader()
.setDataType( THREE.UnsignedByteType )
.setPath( 'textures/equirectangular/' )
.load( 'royal_esplanade_1k.hdr', function ( texture ) {

Expand Down
2 changes: 0 additions & 2 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export const RGBFormat = 1022;
export const RGBAFormat = 1023;
export const LuminanceFormat = 1024;
export const LuminanceAlphaFormat = 1025;
export const RGBEFormat = RGBAFormat;
export const DepthFormat = 1026;
export const DepthStencilFormat = 1027;
export const RedFormat = 1028;
Expand Down Expand Up @@ -158,7 +157,6 @@ export const TriangleFanDrawMode = 2;
export const LinearEncoding = 3000;
export const sRGBEncoding = 3001;
export const GammaEncoding = 3007;
export const RGBEEncoding = 3002;
export const BasicDepthPacking = 3200;
export const RGBADepthPacking = 3201;
export const TangentSpaceNormalMap = 0;
Expand Down
Loading

0 comments on commit cee9706

Please sign in to comment.