Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGLRenderer: Avoid default color space conversion. #21336

Merged
merged 2 commits into from
Feb 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/loaders/ImageBitmapLoader.js
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ ImageBitmapLoader.prototype = Object.assign( Object.create( Loader.prototype ),

} ).then( function ( blob ) {

return createImageBitmap( blob, scope.options );
return createImageBitmap( blob, Object.assign( scope.options, { colorSpaceConversion: 'none' } ) );

} ).then( function ( imageBitmap ) {

2 changes: 2 additions & 0 deletions src/renderers/webgl/WebGLTextures.js
Original file line number Diff line number Diff line change
@@ -504,6 +504,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );
_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha );
_gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment );
_gl.pixelStorei( _gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, _gl.NONE );

const needsPowerOfTwo = textureNeedsPowerOfTwo( texture ) && isPowerOfTwo( texture.image ) === false;
const image = resizeImage( texture.image, needsPowerOfTwo, false, maxTextureSize );
@@ -713,6 +714,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );
_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha );
_gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment );
_gl.pixelStorei( _gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, _gl.NONE );

const isCompressed = ( texture && ( texture.isCompressedTexture || texture.image[ 0 ].isCompressedTexture ) );
const isDataTexture = ( texture.image[ 0 ] && texture.image[ 0 ].isDataTexture );
3 changes: 2 additions & 1 deletion utils/build/rollup.config.js
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import babelrc from '../../.babelrc.json';
function glconstants() {

var constants = {
POINTS: 0, ZERO: 0,
POINTS: 0, ZERO: 0, NONE: 0,
LINES: 1, ONE: 1,
LINE_LOOP: 2,
LINE_STRIP: 3,
@@ -145,6 +145,7 @@ function glconstants() {
MAX_FRAGMENT_UNIFORM_VECTORS: 36349,
UNPACK_FLIP_Y_WEBGL: 37440,
UNPACK_PREMULTIPLY_ALPHA_WEBGL: 37441,
UNPACK_COLORSPACE_CONVERSION_WEBGL: 37443,
UNPACK_ROW_LENGTH: 3314,
UNPACK_IMAGE_HEIGHT: 32878,
UNPACK_SKIP_PIXELS: 3316,