Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

249
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda