##### Ninja Library - Light Function

# njSetLightIntensity

Sets the intensity of light that was set by the njCreateLight() function

### FORMAT

`

  void njSetLightIntensity( *ptr, spc, dif, amb )
  NJS_LIGHT *ptr
  Float spc
  Float dif
  Float amb

`

### PARAMETER

  `*ptr` | Pointer to light source
  `spc` | Specula light illuminance
  `dif` | Diffuse light illuminance
  `amb` | Ambient light illuminance

### RETURN

  None

### DESCRIPTION

  The NINJA light source model is comprised of 3 elements: specula light (highlights), diffuse light (normal light) and ambient light (environment light). This function sets each luminance (intensity), and luminance is given a value of 0-1.f. However, depending on the condition, sometimes a value of more than 1.f may be applied.

### EXAMPLE

      #include <Shinobi.h>
      	:
      NJS_LIGHT light;
      sbInitSystem( NJD_RESOLUTION_VGA, NJD_FRAMEBUFFER_MODE_RGB565, 1);
      njCreateLight(&light, NJD_SPEC_DIR);
      	:
      /* Set the specula diffuse light of the parallel light source with specula to 0.5f */
      njSetLightIntensity(&light, 0.5f, 0.5f, 0.f);

### NOTE

  Light source needs to be specified in `njCreateLight()` function. Specified light does not always require illumination of all elements; at this time, the luminance calculation is ignored. For example, in the example mentioned above, light is not influenced by the substiution of 0.5f rather than 0.f, which is the 4th parameter (environment light) of `njSetLightIntensity()` function.

### REFERENCE

  `njCreateLight()
  `

njSetLightIntensity

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999