Help with textures and alpha channel

I’ve been trying to get unlit objects working with Blender, I’ve done most of the objects but there is one that needs alpha masking and I can’t figure out how to make an unlit object that in Blender (see image).
I’ve tried to put the textures on in Threejs and make it unlit with an alpha mask as there are no tutorials on this. This is my code so far, what would I need to add? (Or if you know how to do this in Blender that would be even better, however I am aware that this isn’t the Blender forums lol)

//textures
const textureLoader = new THREE.TextureLoader();
const notepadTexture = textureLoader.load('/textures/Notepad_Shortcut.png');

//Load model
const loader = new GLTFLoader();
loader.load('PortfolioDesk.glb', function(gltf) 
{
  console.log('loading model');
  const object = gltf.scene;
  object.traverse((child) => 
  {
    if (child.isMesh) 
    {
      child.castShadow = true;
      child.receiveShadow = true;
      
    }
  });
  
  object.position.set(0, 0, 0);
  scene.add(object);
  document.getElementById('progress-container').style.display = 'none';
},

Same as the previous unlit case - no need for code in this one as well :man_bowing: Before exporting in Blender, set Blend Mode to Alpha Blend on the material - if the texture has an alpha channel, it’ll then render that specific parts of the texture transparent in Three.

I did that and brought it into Threejs however it’s turned white instead of going transparent, it should have an alpha channel if it’s a png right?
image

Could you share the texture you’re using (in the format you’re using it) ?

Here you go! (it’s mostly invisible apart from the top left corner)
Notepad Shortcut

Yup, seems to be working perfectly on gltf-viewer:

Screenshot 2024-09-04 at 22.18.18

The exported model -
test.glb (2.7 KB; just connected the texture to shader output + blending set to Alpha Blend, didn’t click absolutely anything else.)

Make sure you’re not modifying the material in some funky way in the code.

It’s not being modified in the code (you can see all the code related to the models in the original question) but blender does give me an error when I try to export it so I think it might be going wrong there, I updated blender to version 4.2.1 but now the Alpha Blend option isn’t in the materials panel.

Here’s the error, it’s complete nonsence as far as I can tell and because it’s not the latest version they won’t take a bug report of it.

seems like they’ve gotten rid of blending options in the latest update and the new version of it still doesn’t give me transparency

Ah, until 4.0 it’s still there. And after 4.2.1 LTS it’s now under Settings > Render Method > Blended (tested and working exactly like Blend Mode before) :

2 Likes

yeah still not giving my the result you’re getting :confused:

Try creating a fresh material and resetting Gltf exporter settings - I installed a new Blender to test, so absolutely no settings were changed.

1 Like