ianmackenzie / elm-3d-scene

A high-level 3D rendering engine for Elm, with support for lighting, shadows, and realistic materials.
https://package.elm-lang.org/packages/ianmackenzie/elm-3d-scene/latest/
Mozilla Public License 2.0
205 stars 27 forks source link

Add Scene3d.shadowIf #78

Open ianmackenzie opened 4 years ago

ianmackenzie commented 4 years ago

Useful optimization, allows objects to cast shadows only from a subset of lights:

Scene3d.shadowIf : 
    (Light coordinates Bool -> Bool) 
    -> Shadow coordinates 
    -> Entity coordinates

The callback will be called with every shadow-casting light to check if a shadow should actually be cast for the given object.