STATE_light_activate

 

 



#define LIGHT_SET	0
#define LIGHT_ADD	1
#define LIGHT_SUBTRACT 2

   This function is the function that actually creates light !
   You wont see any light till you call this function.
   For dynamic lighting this function should be call over and over
   each time there is some changes (for example the lit object changed position)
   For faster lighting in viewer mode use the function 
   STATE_light_set_entity_to_light(my_light,my_object);
   to light every object in the world separately.

   The light operation could be any one of the following
   LIGHT_SET, LIGHT_ADD, LIGHT_SUBTRACT
   Here is what each one will do:
   LIGHT_ADD:
  		The calculated light will be added to the existing light.
  		Each call will make the illuminated entity brighter
   LIGHT_SUBTRACT:
  		This will cause the light source to create darkness !!!
  		In the real world we dont have an equivalent for that.
  		Subsequent calls will make the illuminated entity becomes darker on each call 
   LIGHT_SET:
  		The entity will be illuminated while ignoring previous illuminations.
  		Normally you will use this option.
  		Subsequent calls wont make any different unless 
  		The location, direction or other properties of the light have changed between calls or
  		that we are illuminating a dynamic objects that has change it position
  		(and thats why we have to recalculate its illumination)
   Example:
  	STATE_light_activate(my_light, LIGHT_SET);
  
   The light is created with the following defaults:
  		* A non-directional light ( use STATE_light_set_type_of_light() to change it and then use STATE_light_set_direction() to set the direction).
  		* Infinite distance. The light could reach an infinite distance without getting less intense . Use STATE_light_set_distance_reach() to change it.
  		* The whole world is illuminated. Use STATE_light_set_entity_to_light() to change it. This will make this function much faster.
  		* White color. The default color is white (255,255,255) Use STATE_light_set_color() to change it.

 

 

Go to page 1      Select API

 

Copyright © 2007 3DSTATE Corporation. www.3dstate.com