njSetLightRange | Japanese
    <-|INDEX|->
Sets the limit distance of a light created with njCreateLight.

### FORMAT

      #include <NINJA.H>
      void njSetLightRange( *ptr, nrang, frang )
      NJS_LIGHT *ptr
      Float nrang
      Float frang

### PARAMETERS

*ptr
  light pointer
nrang
  forward limit distance
frang
  backward limit distance

### RETURN VALUE

  None

### ERROR VALUE

  None

### FUNCTION

- Sets the limiting distance of spotlighting or other lighting created by njCreateLight that requires distance calculation. Brightness increases as the light source approaches a point, but there is a limit to how far this can be expressed on the monitor screen. Accordingly, the Ninja light model continually calculates the maximum intensity of a light source when the distance to that source is reduced below a certain amount. This limit is set as the forward limit distance.
- Further, light is attenuated as distance from the light source increases, but it is not essential that calculations be performed for all distances. The point at which calculation of attenuation starts being abandoned (cut off; i.e, the distance at which light disappears) is set as the backward limit distance.

| Although nrang is set to 1.f by default, this setting should take into account the size of the model itself, as well as the distance between models.

### EXAMPLE

      #include <NINJA.H>
      ...........

      NJS_LIGHT light;

      njInitSystem();
      njCreateLight(&light, NJD_SPEC_POINT);
      ...........
      /*
       *  Set the forward limit distance of a specular point light source to 20.f
       *  and the backward limit distance to 80.f.
       */
      njSetLightRange(&light, 20.f, 80.f);

### NOTES

- Before using this function, the light source must first be defined using njCreateLight.

### RELATED TOPICS

  njCreateLight()
  njSetLightAngle()

njSetLightRange |
    <-|INDEX|->