Background: I’ve been looking into upgrading from r111 and I’ve figured out how to get around a lot of concerns (will look a little different but seems ok). However, something that has been a showstopper is the removal of RGBFormat. I’m using sRGBEncoding.
Issue: It seems that some jpeg’s aren’t happy using RGBAFormat. I can see some obj’s load with white meshes instead of colored meshes. I also see that looking through a transparent window that some meshes become invisible, which happened once the jpg code was updated. This is what I had in texture loading:
// JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB.
var isJPEG = url.search( /\.(jpg|jpeg)$/ ) > 0 || url.search( /^data\:image\/jpeg/ ) === 0;
texture.format = isJPEG ? RGBFormat : RGBAFormat;
texture.needsUpdate = true;
I had to update the texture.format so that it only assigned RGBAFormat (although I noticed the same effect without assigning it). This is when the textures started acted up. I can go to older versions where RGBFormat is supported and it acts the same. I’m thinking this is because transparency data isn’t being handled correctly. How should we load jpeg’s in these cases, now that RGBFormat is not a thing?
Edit: I found out that while this broke in r137, it appears to have been reintroduced in r139, with a boatload of warnings to not use it in the console. So while I’m not stopped, the warnings are annoying so what’s the right way to handle this case?