Closed winthos closed 2 months ago
@mattdeitke I believe with the new syntax for light object naming, and the expanded LightParameters
class, we may need to do something to update the ProcTHOR scenes right?
Closing this for now, may come back to it in the future.
Adds the
GetLights
action that serializes out all light game objects in a scene as a json of the classLightParameters
Adds the
SetLights
action that takes serialized light object json and modifies a scene, allowing reconfiguration of lights by editing the json returned byGetLights
. The flow of actions should always beGetLights
first to serialize out what lights are in the scene and what can be changed.Adds the
LightParameters
serializable class. This is returned fromactionReturn
after callingGetLights
in a scene.Adds
LightParameter
compatibility with ProcTHOR house jsons. All ProcTHOR houses can now generate lights given the new properties exposed by theLightParameter
class.Here is an example of a scene's light parameters returned via the
GetLights
action:Details of each LightParameter member
FloorLamp
type object) or if the light simply exists on its own in the scene. Note that the instance of the light is part of the name, thus allowing you to determine if some sim object has multiple light sources associated with it, or if the scene itself has multiple instances of that type of light.type: The type of light as defined by Unity's light types . Valid types are
Spot
,Point
, andDirectional
position: global (x, y, z) position of this light
rotation: angle of this light in global space in angle-axis notation.
enabled: boolean that determines if the light is enabled and emitting light or disabled
controllerSimObjIds: a dict of sim object ids that control can control the enabled state of this light. These controller objects must be compatible with the
ToggleOnOff
action otherwise it cannot be used to control the active state of a light. Multiple controller objects can be assigned to a given light. This allows scene states where a single light can be turned on or off by multiple light switch objects, for exxample.parentSimObjObjectId: The object Id of the sim object this light is parented to. This allows the light to be positioned and linked with a sim object, and if that sim object is moved the light will move relative to its parent object. Only one parent object can be assigned at a time.
spotAngle: The opening angle of a light that is of type
Spot
. Note that this does nothing if the light is not a spotlight. Valid range is [0-179]intensity: the light color is multiplied by this intensity value. The higher the brighter the light will be.
range: The range in meters of the area the light can affect. This must be non-negative
rgb: the color of the light in Red, Green, and Blue values. Each value must be in range [0, 1]. RGB values of [0, 255] should be converted to be compatible by dividing by 255 first.
indirectMultiplier: the value of how much the light is multiplied when it bounces on a surface. This must be a non-negative value. 0 is no bounce, 1 is "normal" bounce, and anything greater than 1 is abnormally emissive.
cullingMaskOff: An object will only be illuminated by a light if that light's cullingMask/ includes the layer chosen for the GameObject. Objects in Layers specified by
cullingMaskOff
will not be lit by this light.shadow: Includes various shadow properties for this light.
shadow["type"]: valid shadow types are
None
,Hard
, andSoft
which determine the types of edges created by shadows.shadow["strength"]: the intensity (how solid) of the shadow
shadow["normalBias"]: allows offsetting the shadow's position relative to the normals of a surface
shadow["bias"]: allows offsetting the shadow's position by manipulating the distance of the shadow map relative to what is casting the shadow.
shadow["nearPlane]: defines the plane in which game objects do not cast shadows if close enough to the light
shadow["resolution"] : selects the shadow resolution based on the available quality settings of the Unity instance