Improve light support in theatre/r3f (#316)
Add color to all light types and add ambient and hemisphere lights
This commit is contained in:
parent
6497bf2097
commit
54ed4c3c41
1 changed files with 20 additions and 0 deletions
|
@ -17,6 +17,7 @@ import type {
|
|||
import {
|
||||
BoxHelper,
|
||||
CameraHelper,
|
||||
Color,
|
||||
DirectionalLightHelper,
|
||||
PointLightHelper,
|
||||
SpotLightHelper,
|
||||
|
@ -38,6 +39,7 @@ const baseLightConfig = {
|
|||
intensity: createNumberPropConfig('intensity', 1),
|
||||
distance: createNumberPropConfig('distance'),
|
||||
decay: createNumberPropConfig('decay'),
|
||||
color: createColorPropConfig('color', new Color('white')),
|
||||
}),
|
||||
dimensionless: true,
|
||||
}
|
||||
|
@ -80,6 +82,7 @@ const defaultEditableFactoryConfig = {
|
|||
directionalLight: {
|
||||
...extendObjectProps(baseObjectConfig, {
|
||||
intensity: createNumberPropConfig('intensity', 1),
|
||||
color: createColorPropConfig('color', new Color('white')),
|
||||
}),
|
||||
icon: 'sun' as const,
|
||||
dimensionless: true,
|
||||
|
@ -92,6 +95,23 @@ const defaultEditableFactoryConfig = {
|
|||
createHelper: (light: PointLight) =>
|
||||
new PointLightHelper(light, 1, selectionColor),
|
||||
},
|
||||
ambientLight: {
|
||||
props: {
|
||||
intensity: createNumberPropConfig('intensity', 1),
|
||||
color: createColorPropConfig('color', new Color('white')),
|
||||
},
|
||||
useTransformControls: false,
|
||||
icon: 'lightBulb' as const,
|
||||
},
|
||||
hemisphereLight: {
|
||||
props: {
|
||||
intensity: createNumberPropConfig('intensity', 1),
|
||||
color: createColorPropConfig('color', new Color('white')),
|
||||
groundColor: createColorPropConfig('groundColor', new Color('white')),
|
||||
},
|
||||
useTransformControls: false,
|
||||
icon: 'lightBulb' as const,
|
||||
},
|
||||
perspectiveCamera: extendObjectProps(baseCameraConfig, {
|
||||
fov: createNumberPropConfig('fov', 50, {nudgeMultiplier: 0.1}),
|
||||
zoom: createNumberPropConfig('zoom', 1),
|
||||
|
|
Loading…
Reference in a new issue