UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

28 lines (27 loc) 831 B
"use strict"; import { ParamConfig } from "../../engine/nodes/utils/params/ParamsConfig"; import { Color } from "three"; export const DEFAULT_AMBIENT_LIGHT_PARAMS = { color: new Color(1, 1, 1), intensity: 1, name: "ambientLight" }; const DEFAULT = DEFAULT_AMBIENT_LIGHT_PARAMS; export function AmbientLightParamConfig(Base) { return class Mixin extends Base { constructor() { super(...arguments); /** @param sky color */ this.color = ParamConfig.COLOR(DEFAULT.color.toArray(), { // conversion: ColorConversion.SRGB_TO_LINEAR, }); /** @param light intensity */ this.intensity = ParamConfig.FLOAT(DEFAULT.intensity, { range: [0, 2], rangeLocked: [true, false] }); /** @param light name */ this.name = ParamConfig.STRING("`$OS`"); } }; }