Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Objects with alphaClip render opaque shadows when map is used instead of alphaMap #24995

Closed
hybridherbst opened this issue Nov 21, 2022 · 1 comment · Fixed by #25000
Closed

Comments

@hybridherbst
Copy link
Contributor

hybridherbst commented Nov 21, 2022

Describe the bug

Seems that while #22410 added support for alpha clipping in shadow maps, it did so only when alphaMap is used, not then the alpha channel of map is used for transparency.
This results in, for example, all glTF files loaded at runtime (e.g. with GLTFLoader) not supporting alpha clipping in shadows.

I've seen a few mentions of using customDepthMaterial to work around this issue, but in fact this part of the docs was removed when #22410 was merged. Thus I think the missing case for map + clipping may be an oversight / bug here.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://threejs.org/editor
  2. Add a cube using "map" with alpha channel and a cube with "alphaMap"
  3. Add a Directional Light
  4. Add a floor plane
  5. Enable Cast shadows on the light
  6. Enable Cast+Receive Shadows on the cubes and the plane
  7. Note that alpha clipping happens on the object but not on the shadows

Expected behavior

Alpha clipping in the shadows.

Screenshots

image

@WestLangley
Copy link
Collaborator

Confirmed. A custom depth material is still required if a map with alpha channel is used instead of alphaMap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants