Texture baking question

I thought it would be a good idea to use baked textures for performance sake however I don’t know how to not use lights and still let it be lit so the baked textures work. When using ‘MeshBasicMaterial’ this doesn’t get affected by light so is there a way to achieve this for an imported gltf file?
This is the code of my model loader:

//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';
},

In Blender if you plug in the baked texture image now directly to the shader output, the gltf material will be exported as unlit basic material iirc (cc/ @donmccurdy I think he mentioned that)

1 Like

I’m still kinda new to blender, do you mean like the top example in the image? The bottom one is what it is currently for all objects.

Yup - the top one should export a basic, unlit material.

1 Like

I love when things are this simple, thank you!!

One more question that I didn’t really want to make a new topic for, how does this work when I need to change the alpha value? Before the alpha from the image went into the alpha in the BDSF but now that I don’t have the BDSF I can’t change the alpha value. There doesn’t seem to be a node that just changes alpha.
Before and after: