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

250
Visualizações
ThreeJS MeshDepthMaterial Shadows Not Working With Animations

In order to cast shadows through transparent parts of my Mesh I use the MeshDepthMaterial but when I do this, the shadows of the animated parts of my objects stop moving with the animation.

You can take a look at the example here: https://jsfiddle.net/miger/kj8gwue5/

var customDepthMaterial = new THREE.MeshDepthMaterial( {
    depthPacking: THREE.RGBADepthPacking,
    alphaMap: alphaTex,
    alphaTest: 0.5
})
    
child.customDepthMaterial = customDepthMaterial;

If you comment out the customDepthMaterial-input you can see that the shadow would normally go with the animation, as shown in this example here. However as you can see the shadow does not cast through the the transparent part of my mesh anymore, which is not the effect I'd like to have here.

How can I fix this? Updating the depth material with needsUpdate, did not do anything..

Is it even possible to make the shadows work correctly with animations when using the depth material?

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

0

Add skinning: true to your depth material:

var customDepthMaterial = new THREE.MeshDepthMaterial( {
    depthPacking: THREE.RGBADepthPacking,
    alphaMap: alphaTex,
    alphaTest: 0.5,
    skinning: true // add this property
})
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