Skip to content

Function: configToLibParams()

ts
function configToLibParams(config, variation?): ParamMap;

Derives lib shader params from a BodyConfig + optional visual variation. When variation is provided, all shader parameters are covered. When omitted, physics alone drives all params.

Rocky bodies read their palette anchors from config.terrainColorLow / config.terrainColorHigh. Callers compute the anchors themselves and write them back onto the config before calling this function (see the playground's deriveTemperatureAnchors for a temperature-driven default reference implementation).

Per-type assembly (defaults, special fields like temperature for stars) lives in strategyFor — this function is now a thin wrapper that resolves the seed and forwards to the strategy's buildShaderParams.

Parameters

ParameterTypeDescription
configBodyConfigBody configuration.
variation?BodyVariationOptional deterministic visual variation.

Returns

ParamMap

Distribué sous la licence indiquée dans le dépôt.