google / google/filament

Spot light shows no shadow on invisible plane.

Open
#6,178 6 comments 1 reaction 1 assignee Claimed by @pixelflinger View on GitHub
good first issue
Dominant language
C++
Stars
20.5k
Forks
2.3k
Avg merge
2d 16h
Merged PRs (30d)
74

Description

I'm trying to use spot light to cast shadow on invisible plane but can't make it work. I found that directional light can cast shadow on both visible and invisible plane while spot light only shows shadow on visible plane.

directional light + lit plane
![Screenshot_20221012_171950_com example filamentcamera](https://user-images.githubusercontent.com/32147896/195324259-a914a561-afe5-4b92-b15e-edead6b79a6a.jpg)

directional light + unlit & shaderMultiplier plane
![Screenshot_20221012_172227_com example filamentcamera](https://user-images.githubusercontent.com/32147896/195324278-7da9a9f4-b002-4357-a388-30d1844f1e4e.jpg)

spot light + lit plane
![Screenshot_20221012_175009_com example filamentcamera](https://user-images.githubusercontent.com/32147896/195324318-787bf6a2-aa4c-42d6-b1d5-c5b9d79abca7.jpg)

spot light + unlit & shaderMultiplier plane
![Screenshot_20221012_174330_com example filamentcamera](https://user-images.githubusercontent.com/32147896/195324338-e5ca0d00-dfb7-4e34-acc7-726ec401bda3.jpg)

material of invisible plane
```
material {
name : shadow,
shadingModel : unlit,
shadowMultiplier : true,
blending : transparent,
transparency : twoPassesOneSide,
}
fragment {
void material(inout MaterialInputs material) {
prepareMaterial(material);
material.baseColor = vec4(0.0, 0.0, 0.0, 0.5);
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.