aframevr / aframevr/aframe

Shadow doesn't cast onto objects that don't have a material defined.

Open
#4,302 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
17.6k
Forks
4.4k
PR merge metrics
No merged PRs in 30d

Description

Description:
Shadows don't cast onto a-entity's that don't have a material defined. When an a-entity with no material defined is displayed it must get a material automatically because it has a random color. I hope I've gotten the message across because I can't think how to write this differently.

It's not a huge issue but may be a mild frustration encountered by people learning aframe wondering why a shadow doesn't display.

  • A-Frame Version: 9.2
  • Platform / Device: Firefox 70,0
  • Reproducible Code Snippet or URL:
<!-- In this example a shadow will be cast by the cube on the platform-->
<a-box id="cube_with_shadow" position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9" shadow></a-box>
<a-entity id="platform" geometry="primitive:box; width:2; height:0.2; depth:2" position="-1 -0.2 -3" material="color:white" rotation="0 0 0" color="grey" shadow></a-entity>

<!-- In this example a a material will be generated with a random color for platform 2 but the cube won't cast a shadow on it -->
<a-box id="cube2_with_shadow" position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9" shadow></a-box>
<a-entity id="platform2" geometry="primitive:box; width:2; height:0.2; depth:2" position="-1 -0.2 -3"  rotation="0 0 0" color="grey" shadow></a-entity>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided HTML reproduction and trace how an a-entity with geometry but no material is handled when shadow is enabled. Compare the two platform examples, then verify that the cube's shadow appears on the material-less platform without breaking the explicitly materialized case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, three.js
Domain
computer-graphics, frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.