Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

436
Visualizações
How can I modify a material of a gltf model in THREE.js

So I have a model I made in Blender, with all the lighting and textures baked, but when I import it into THREE.js (saved in .glb format), it defaults to the standard material. This might be fine in some situations, but, as I said earlier, I have all the lighting and textures baked. How can I change the material from standard to basic without loosing my baking info and textures/having to import them as separate images?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

What you're looking for is called KHR_materials_unlit in glTF, or "Shadeless" in Blender. You can export this from Blender to glTF using the following node graph:

node graph screenshot

With this arrangement, the exported glTF file will have KHR_materials_unlit applied to the material, and the baked lighting in the texture will be preserved in ThreeJS.

about 4 years ago · Juan Pablo Isaza Relatório

0

In this way you can load your model and put a custom material on it.

This also should work for your glb model. But Three js highly recommend to use gltf.

const modelPath = "your model path";
const texturePath = "your texture path"

const loader = new GLTFLoader();
const texture = new TextureLoader().load(texturePath);
loader.load( modelPath, function ( gltf ) {
    const model = gltf.scene;
    model.traverse((obj) => {
        if(obj instanceof Mesh){
            obj.material = new MeshBasicMaterial({map: texture})
            }
        }
    )

}, undefined, function ( error ) {
    console.error( error );
} );
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda