google/filament

Spot light shows no shadow on invisible plane.

オープン

#6,178 opened on 2022/10/12

 (6 件のコメント) (1 件のリアクション) (1 人の担当者)C++ (2,178 件のフォーク)batch import
good first issue

Repository metrics

Stars
 (20,060 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

directional light + unlit & shaderMultiplier plane Screenshot_20221012_172227_com example filamentcamera

spot light + lit plane Screenshot_20221012_175009_com example filamentcamera

spot light + unlit & shaderMultiplier plane Screenshot_20221012_174330_com example filamentcamera

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);
    }
}

コントリビューターガイド