lights#

The lights object defines the location, orientation, and behavior of unique lighting objects that you want to add to your scene.

Tip

In most circumstances you do not need to add lighting to your scene. Your scene is usually lit by the ambient lighting that makes up part of your selected background.

You should add unique lighting objects only if you really need unique lighting. Currently the only type of unique lighting that is available is a near-infrared spotlight. New types of lighting will be added in the future.

The lights object takes the form of a standard list, as follows:

"lights": [

  ]

If you do not want to add any unique lighting objects, simply leave the lights object out or leave it blank as above. To add unique lights to your scene, add one object to the list for each light.

The following lighting objects are available:

Near-infrared spotlight#

object

A near-infrared spotlight is a spotlight that you can freely place in your scene to cast near-infrared light on your actor.

Important

If you want your datapoint to be a near-infrared image, you must also make the following changes to your request:

  • Set your camera’s wavelength field to nir, to make sure your camera is capable of capturing near-infrared light.

  • Remove the background object, since the background and scene lighting no longer have any effect on the rendering of the scene.

You can place any number of near-infrared spotlights in your scene, by adding them one by one to the lights list as follows:

"lights": [
  {
    "light_type": "nir", //Identifies this as a near-infrared spotlight object
    "beam_angle": //Defines the angle of the spotlight - how much space it covers
    "falloff": //Defines how quickly the light tapers off as it approaches the edges of the beam
    "brightness": //Defines the strength of the spotlight
    "location": {
      //Sets the location of the spotlight in x, y, and z coordinates
    },
    "rotation": {
      //Sets the orientation of the spotlight using yaw, pitch, and roll controls
    }
  },
  {
       //An additional complete near-infrared spotlight object
  },
]

Sample usage

A sample complete near-infrared spotlight object

"lights": [
  {
    "light_type": "nir",
    "beam_angle": 3,
    "falloff": 0.5,
    "brightness": 50,
    "location": {
      "x": 0.20,
      "y": -2,
      "z": 0.1
    },
    "rotation": {
      "yaw": 0.0,
      "pitch": 0.0,
      "roll": 0.0
    }
  }
]

These values will generate a near-infrared spotlight that covers 3 degrees of arc, of strength 50 watts, of which 50% of the beam is at full strength. The spotlight will be located 20 centimeters to the left of the origin, 2 meters ahead of it, and 10 centimeters above it; and will be pointing in the +y direction.


light_type#

string

When the light_type field is set to nir, it identifies this object as a near-infrared spotlight.

Sample usage

A sample "light_type"="nir" field and its location in the data request

In the JSON hierarchy of the data request, the light_type field is found here:

{
   "datapoints": [
      {
       "lights": [
         {
           "light_type": "nir",
         }
       ]
      }
   ]
}


beam_angle#

int

The beam_angle field defines how many degrees of arc are covered by the near-infrared spotlight. No matter what your other settings, the spotlight does not shed any light outside of this arc.

This field accepts integer values from 3 to 90.

Here are some sample images that show how beam angle affects the spotlight at a distance of 1.6 meters from the actor’s face:

../../_images/NIR_Beam_Angle_3_.png

"beam_angle"=3#

../../_images/NIR_Beam_Angle_5_.png

"beam_angle"=5#

../../_images/NIR_Beam_Angle_6.5_.png

"beam_angle"=6.5#

../../_images/NIR_Beam_Angle_7_.png

"beam_angle"=7#

../../_images/NIR_Beam_Angle_9_.png

"beam_angle"=9#

../../_images/NIR_Beam_Angle_11_.png

"beam_angle"=11#

Sample usage

A sample beam_angle field and its location in the data request

In the JSON hierarchy of the data request, the beam_angle field is found here:

{
   "datapoints": [
      {
       "lights": [
         {
           "beam_angle": 17
         }
       ]
      }
   ]
}

This value will generate an infrared spotlight that covers 17 degrees of arc.


falloff#

64-bit float

The falloff field defines how far into the spotlight you have to go, starting from the edge and moving towards the center, before you reach the point where the beam is at full strength. This field accepts floating-point values from 0 to 1.

At falloff level 1, only the very center of the spotlight is at full strength, and the intensity tapers off very very gradually as you approach the edge of the beam.

At falloff level 0, the entire spotlight is at full strength, with a sharp cutoff between light and dark at the edge of the beam.

Some examples:

../../_images/NIR_Falloff_0_.png

"falloff"=0#

../../_images/NIR_Falloff_0.25_.png

"falloff"=0.25#

../../_images/NIR_Falloff_0.5_.png

"falloff"=0.5#

../../_images/NIR_Falloff_0.75_.png

"falloff"=0.75#

../../_images/NIR_Falloff_1_.png

"falloff"=1#

Sample usage

A sample falloff field and its location in the data request

In the JSON hierarchy of the data request, the falloff field is found here:

{
   "datapoints": [
      {
       "lights": [
         {
           "falloff": .235
         }
       ]
      }
   ]
}

This value will generate a near-infrared spotlight that reaches full strength when it is approximately 23.5% of the way from the spotlight’s edge towards its center.


brightness#

64-bit float

The brightness field defines how much energy the near-infrared spotlight outputs in the form of light. This field accepts floating-point values from 0.0 to 1000.0 and is measured in watts.

Note

The wattage of this spotlight is not the same as the wattage listed on commercial lightbulbs. On a commercial lightbulb, the wattage value measures energy usage; here the wattage measures energy output.

Here are some examples of the brightness of the spotlight at a distance of 1.6 meters from the actor’s face:

../../_images/NIR_Brightness_1_.png

"brightness"=1#

../../_images/NIR_Brightness_250_.png

"brightness"=250#

../../_images/NIR_Brightness_300_.png

"brightness"=300#

../../_images/NIR_Brightness_500_.png

"brightness"=500#

../../_images/NIR_Brightness_750_.png

"brightness"=750#

../../_images/NIR_Brightness_1000_.png

"brightness"=1000#

Note

The brightness setting takes the current beam angle into account. You do not need to increase the brightness when you have a wider beam, or decrease it when you have a narrower one; the lit-up portion of the image will be of the same brightness no matter what the beam angle is.

Sample usage

A sample brightness field and its location in the data request

In the JSON hierarchy of the data request, the brightness field is found here:

{
   "datapoints": [
      {
       "lights": [
         {
           "brightness": 1500
         }
       ]
      }
   ]
}

This value will generate a spotlight that is almost blindingly bright.


location#

object

The location object defines the position of the spotlight using global coordinates measured in meters. Each value is a floating-point variable that can range from -5 to 5 meters.

The location object contains the following fields:

"location": {
        "x": //The x coordinate, which moves the spotlight from side to side
        "y": //The y coordinate, which moves the spotlight from back to front
        "z": //The z coordinate, which moves the spotlight down and up
},

Movement on the x axis

This table displays the effects of moving the spotlight on the X axis, without moving the camera or actor#
../../_images/NIR_beam_location_X_Minimum.png

"x"=-0.11936#

../../_images/NIR_beam_location_X_Half-Minimum.png

"x"=-0.05968#

../../_images/NIR_beam_location_X_Default.png

"x"=0#

../../_images/NIR_beam_location_X_Half-Maximum.png

"x"=0.05968#

../../_images/NIR_beam_location_X_Maximum.png

"x"=0.11936#

Movement on the y axis

This table displays the effects of moving the spotlight on the Y axis, without moving the camera or actor#
../../_images/NIR_beam_location_Y_Minimum.png

"y"=-22.43131#

../../_images/NIR_beam_location_Y_Half-Minimum.png

"y"=-12.0157#

../../_images/NIR_beam_location_Y_Default.png

"y"=-1.6#

../../_images/NIR_beam_location_Y_Half-Maximum.png

"y"=-1.2824#

../../_images/NIR_beam_location_Y_Maximum.png

"y"=-0.9648#

Movement on the z axis

This table displays the effects of moving the spotlight on the Z axis, without moving the camera or actor#
../../_images/NIR_beam_location_Z_Minimum.png

"z"=0.00534#

../../_images/NIR_beam_location_Z_Half-Minimum.png

"z"=0.06267#

../../_images/NIR_beam_location_Z_Default.png

"z"=0.12#

../../_images/NIR_beam_location_Z_Half-Maximum.png

"z"=0.18954#

../../_images/NIR_beam_location_Z_Maximum.png

"z"=0.25908#

Sample usage

Location in the data request

In the JSON hierarchy of the data request, the location field is found here:

{
  "datapoints": [
    {
      "lights": [
        {
          "location": {

          },
        }
      ]
    }
  ]
}

A sample complete location object

"location": {
  "x": 0.0,
  "y": 2.8,
  "z": 0.12
},

These values create a spotlight located 2.8 meters behind the head. At that position, it will need to be rotated using the rotation controls so that it can illuminate the back of the head.


rotation#

object

The rotation object defines how the spotlight is oriented in the scene, using yaw, pitch, and roll controls.

The yaw, pitch, and roll fields are floating-point values measured in degrees, all of which can range from -180 to 180.

The rotation object contains the following fields:

"rotation": {
  "yaw": //Turns the spotlight from side to side. Positive values turn the spotlight to its left; negative values turn the spotlight to its right.
  "pitch": //Tilts the spotlight up and down. Positive values tilt the spotlight up; negative values tilt the spotlight down.
  "roll": //Tilts the spotlight from side to side. Positive values tilt the spotlight counterclockwise while negative values tilt the spotlight clockwise.
},

Because the spotlight is rotationally symmetric and roll is applied last, the value you place in the “roll” field has no practical effect.

The effects of pitch and roll on the direction of the spotlight#
../../_images/pitch3yaw3.png

"pitch"=3 "yaw"=3#

../../_images/pitch3yaw15.png

"pitch"=3 "yaw"=1.5#

../../_images/pitch3yaw0.png

"pitch"=3 "yaw"=0#

../../_images/pitch3yaw-15.png

"pitch"=3 "yaw"=-1.5#

../../_images/pitch3yaw-3.png

"pitch"=3 "yaw"=-3#

../../_images/pitch15yaw3.png

"pitch"=1.5 "yaw"=3#

../../_images/pitch15yaw15.png

"pitch"=1.5 "yaw"=1.5#

../../_images/pitch15yaw0.png

"pitch"=1.5 "yaw"=0#

../../_images/pitch15yaw-15.png

"pitch"=1.5 "yaw"=-1.5#

../../_images/pitch15yaw-3.png

"pitch"=1.5 "yaw"=-3#

../../_images/pitch0yaw3.png

"pitch"=0 "yaw"=3#

../../_images/pitch0yaw15.png

"pitch"=0 "yaw"=1.5#

../../_images/pitch0yaw0.png

"pitch"=0 "yaw"=0#

../../_images/pitch0yaw-15.png

"pitch"=0 "yaw"=-1.5#

../../_images/pitch0yaw-3.png

"pitch"=0 "yaw"=-3#

../../_images/pitch-15yaw3.png

"pitch"=-1.5 "yaw"=3#

../../_images/pitch-15yaw15.png

"pitch"=-1.5 "yaw"=1.5#

../../_images/pitch-15yaw0.png

"pitch"=-1.5 "yaw"=0#

../../_images/pitch-15yaw-15.png

"pitch"=-1.5 "yaw"=-1.5#

../../_images/pitch-15yaw-3.png

"pitch"=-1.5 "yaw"=-3#

../../_images/pitch-3yaw3.png

"pitch"=-3 "yaw"=3#

../../_images/pitch-3yaw15.png

"pitch"=-3 "yaw"=1.5#

../../_images/pitch-3yaw0.png

"pitch"=-3 "yaw"=0#

../../_images/pitch-3yaw-15.png

"pitch"=-3 "yaw"=-1.5#

../../_images/pitch-3yaw-3.png

"pitch"=-3 "yaw"=-3#

Important

Rotations of the spotlight are applied in a specific order: first yaw, then pitch, then roll. The spotlight is initially pointed in the +y direction before the rotations are applied.

Sample usage

Location in the data request

In the JSON hierarchy of the data request, the rotation object is found here:

{
  "datapoints": [
    {
      "lights": [
        {
          "rotation": {

          }
        }
      ]
    }
  ]
}

A sample complete rotation object

"rotation": {
  "yaw": 180,
  "pitch": 0,
  "roll": 0,
},

If the spotlight is located behind the head (see the sample values presented for the location field above), these values will rotate the spotlight 180 degrees so that it is pointed towards the head again.