You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an issue with some incorrect texture colours when loading a GLTF model via GLTFLoader when WebGLRenderer is instantiated with alpha set to true.
To Reproduce
Steps to reproduce the behavior:
Instantiate WebGLRenderer with alpha set to false.
Code
import*asTHREEfrom"three";import{GLTFLoader}from"three/examples/jsm/loaders/GLTFLoader";constrenderer=newTHREE.WebGLRenderer({// ...antialias: true,alpha: true// this is what causes the texture colour issue});constwidth=1024;constheight=768;constscene=newTHREE.Scene();constcamera=newTHREE.PerspectiveCamera(75,width/height,0.1,1000);constambientLight=newTHREE.AmbientLight();scene.add(ambientLight);// Load model and add to sceneconstloader=newGLTFLoader();loader.load("model.gltf",(gltf)=>{scene.add(gltf.scene);});// Render scene(functionrender(){renderer.render(scene,camera);requestAnimationFrame(animate);})();
Below is the output where WebGLRenderer has been instantiated with alpha set to true and false
alpha: true
alpha: false
Expected behavior
I believe setting the alpha to true or false shouldn't have an effect on how solid textures are rendered. The expected behaviour would be for textures to render consistently regardless of the alpha setting.
The text was updated successfully, but these errors were encountered:
This sounds like #15483. It was fixed at one point in #18631, but we had to revert that fix because it caused additional issues. I'll close this issue as a duplicate of the first, but feel free to comment on either of these.
A workaround is to set material.map.format to RGB, for textures where you're sure the alpha channel is not needed:
Describe the bug
There is an issue with some incorrect texture colours when loading a GLTF model via
GLTFLoader
whenWebGLRenderer
is instantiated withalpha
set totrue
.To Reproduce
Steps to reproduce the behavior:
Instantiate
WebGLRenderer
withalpha
set tofalse
.Code
Live Demos
Below is the output where
WebGLRenderer
has been instantiated withalpha
set totrue
andfalse
Expected behavior
I believe setting the
alpha
totrue
orfalse
shouldn't have an effect on how solid textures are rendered. The expected behaviour would be for textures to render consistently regardless of the alpha setting.The text was updated successfully, but these errors were encountered: