Spotlight map issue projecting artefacts

Hey guys,

I’m running into an issue for a current project of mine where I’m basically trying to project a texture onto a model and a plane (both using StandardMaterial lighting model). I’m wondering whether or not it’s possible to project alpha textures

The issue:

The map I’m passing to the spotlight (full #000 black pixels):

The configuration:

  light.position.set(...props.position)
  light.castShadow = props.castShadow
  light.shadow.mapSize.setScalar(props.shadowMapSize)
  light.shadow.camera.near = 0.5
  light.shadow.camera.far = props.distance || 50
  light.shadow.camera.fov = MathUtils.radToDeg(props.angle) * 2
  light.shadow.camera.aspect = 1
  light.shadow.camera.updateProjectionMatrix()
  light.shadow.bias = -0.001
  light.shadow.radius = 8
  light.map = texture

I’ve also been trying to achieve it with the ProjectorLight as well without success.This technique does not work with Standard/Physical materials and after many attempts to work around it I haven’t been able to deal with this transparency issue. Am I missing something ? Is it simply not possible using PBR / Standard materials ?

Thanks a lot :slight_smile:

What happens if you pass a fully dark image to the spotlight?

If you get the same artefacts at the edge, then it’s an issue with THREE.

If it you don’t, then you should double check the map you are working with - maybe it’s not actually fully black at the edges, maybe due to compression settings.
If it looks like the issue is with your map, i would try a non compressed version of it (eg a PNG if you were using a JPEG).

1 Like

I just updated this example to 183 to check if the problem can be reproduced, there’s no noticeable seam at the edge of the spot light, have you tried with transparency in the image rather than black?