Skip to content

Commit

Permalink
add space after !
Browse files Browse the repository at this point in the history
  • Loading branch information
nianxy committed Nov 24, 2023
1 parent 26680da commit e342da5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ function WebGLRenderer( parameters = {} ) {

}

if ( capabilities.isWebGL2 && map && map.isTexture && map.format === RGBAFormat && map.type === UnsignedByteType && map.encoding === sRGBEncoding && !map.sRGBToLinearWithShader ) {
if ( capabilities.isWebGL2 && map && map.isTexture && map.format === RGBAFormat && map.type === UnsignedByteType && map.encoding === sRGBEncoding && ! map.sRGBToLinearWithShader ) {

encoding = LinearEncoding; // disable inline decode for sRGB textures in WebGL 2

Expand Down
4 changes: 2 additions & 2 deletions src/renderers/webgl/WebGLTextures.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,

}

function getInternalFormat( internalFormatName, glFormat, glType, encoding, sRGBToLinearWithShader = !Texture.useSrgbTextures ) {
function getInternalFormat( internalFormatName, glFormat, glType, encoding, sRGBToLinearWithShader = ! Texture.useSrgbTextures ) {

if ( isWebGL2 === false ) return glFormat;

Expand Down Expand Up @@ -165,7 +165,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,

if ( glType === _gl.FLOAT ) internalFormat = _gl.RGBA32F;
if ( glType === _gl.HALF_FLOAT ) internalFormat = _gl.RGBA16F;
if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = ( isWebGL2 && encoding === sRGBEncoding && !sRGBToLinearWithShader ) ? _gl.SRGB8_ALPHA8 : _gl.RGBA8;
if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = ( isWebGL2 && encoding === sRGBEncoding && ! sRGBToLinearWithShader ) ? _gl.SRGB8_ALPHA8 : _gl.RGBA8;
if ( glType === _gl.UNSIGNED_SHORT_4_4_4_4 ) internalFormat = _gl.RGBA4;
if ( glType === _gl.UNSIGNED_SHORT_5_5_5_1 ) internalFormat = _gl.RGB5_A1;

Expand Down
2 changes: 1 addition & 1 deletion src/textures/Texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Texture extends EventDispatcher {
// In WebGL2, sRGB textures can be trancoded to Linear automatically, but reference to this issue: https://github.com/mrdoob/three.js/issues/26183
// there're performance issues when doing this, so you can set the sRGBToLinearWithShader to false to transcode the sRGB texture to Linear with
// shader, especially to those textures that are updated in each frame
this.sRGBToLinearWithShader = !Texture.useSrgbTextures;
this.sRGBToLinearWithShader = ! Texture.useSrgbTextures;

}

Expand Down

0 comments on commit e342da5

Please sign in to comment.