Description of the problem
Non POT ImageBitmap texture can be upside down.
Demo: https://jsfiddle.net/7do6um2f/ (Use Chrome)
Non POT image can be resized to POT canvas in WebGLRenderer(WebGLTexture). If original image is ImageBitmap and texture.flipY is true, texture will be upside down.
This is from the difference of ImageBitmap API from others. ImageBitmap requires flipY on bitmap creation while others requires on uploading data to GPU (= texture.flipY).
texture.flipY used on uploading data to GPU is ignored for ImageBItmap. But if non POT ImageBitmap is converted to canvas, texture.flipY will have an effect. So texture will be upside down.
texture.flipY has no effect for ImageBitmap so we should force it to false if texture's image is ImageBitmap?
API difference has another issue. (May be it isn't so serious tho.) FlipY and premultiplyAlpha is required on bitmap creation. texture.flipY/premultiplyAlpha used on uploading data to GPU are ignored for ImageBitmap.
So the following code has no effect for ImageBitmap, but the code has effect if ImageBitmap is resized and converted to canvas.
texture.premultiplyAlpha = ! texture.premultiplyAlpha;
texture.flipY = ! texture.flipY;
texture.needsUpdate = true;
Three.js version
Browser
OS
Hardware Requirements (graphics card, VR Device, ...)
Description of the problem
Non POT
ImageBitmaptexture can be upside down.Demo: https://jsfiddle.net/7do6um2f/ (Use Chrome)
Non POT image can be resized to POT
canvasinWebGLRenderer(WebGLTexture). If original image isImageBitmapandtexture.flipYistrue,texturewill be upside down.This is from the difference of
ImageBitmapAPI from others.ImageBitmaprequiresflipYon bitmap creation while others requires on uploading data to GPU (=texture.flipY).texture.flipYused on uploading data to GPU is ignored forImageBItmap. But if non POTImageBitmapis converted tocanvas,texture.flipYwill have an effect. So texture will be upside down.texture.flipYhas no effect forImageBitmapso we should force it tofalseif texture's image isImageBitmap?API difference has another issue. (May be it isn't so serious tho.)
FlipYandpremultiplyAlphais required on bitmap creation.texture.flipY/premultiplyAlphaused on uploading data to GPU are ignored forImageBitmap.So the following code has no effect for
ImageBitmap, but the code has effect ifImageBitmapis resized and converted tocanvas.Three.js version
Browser
OS
Hardware Requirements (graphics card, VR Device, ...)