@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
36 lines (35 loc) • 1.21 kB
JavaScript
;
import { ParamConfig } from "../../engine/nodes/utils/params/ParamsConfig";
import { Vector3, Color } from "three";
export const DEFAULT_HEMISPHERE_LIGHT_PARAMS = {
skyColor: new Color(1, 1, 1),
groundColor: new Color(0, 0, 0),
intensity: 1,
position: new Vector3(0, 1, 0),
name: "hemisphereLight"
};
const DEFAULT = DEFAULT_HEMISPHERE_LIGHT_PARAMS;
export function HemisphereLightParamConfig(Base) {
return class Mixin extends Base {
constructor() {
super(...arguments);
/** @param sky color */
this.skyColor = ParamConfig.COLOR(DEFAULT.skyColor.toArray(), {
// conversion: ColorConversion.SRGB_TO_LINEAR,
});
/** @param ground color */
this.groundColor = ParamConfig.COLOR(DEFAULT.groundColor.toArray(), {
// conversion: ColorConversion.SRGB_TO_LINEAR,
});
/** @param light intensity */
this.intensity = ParamConfig.FLOAT(DEFAULT.intensity, {
range: [0, 2],
rangeLocked: [true, false]
});
/** @param light position */
this.position = ParamConfig.VECTOR3(DEFAULT.position.toArray());
/** @param light name */
this.name = ParamConfig.STRING("`$OS`");
}
};
}