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 units type parameter to LinearRgb? #70

Closed ianmackenzie closed 4 years ago

ianmackenzie commented 4 years ago

Material color would be LinearRgb Unitless, would also have LinearRgb LuminousFlux for point lights and LinearRgb Illuminance for directional lights. chromaticityToLinearRgb would then take an additional Quantity Float units scale parameter.

ianmackenzie commented 4 years ago

Could make sense to have an internal LinearRgb module with functions like toLux, toLumens, toUnitless etc. for extracting an internal Vec3 in a type-safe way