API Functions

 

 


  This API replaces the STATE_light_ API.
  The older API (STATE_light_) could still be used (for lightmap generation and others) and we continue its support.

   Light effects are usually better the more polygons we have. This is because the lighting is based on the vetex color and normal
   Note that in order to improve the graphic quality dramatically one need to create lightmaps
   (after defining the light sources) for more details please see STATE_polygon_create_lightmap()
   see also STATE_engine_create_shadow() which uses projection method techniques for creating light

   some common background about lighting
   ------------------------------------
   Each source of light is combined of three different channels, they are
   called Ambient, Diffuse and specular. 
   Ambient light:
  		Ambient light is light that doesn't come from any particular direction
  		Objects illuminated by ambient light are evenly lit on all surfaces.
  		For example if we create a room with a few light sources then even
  		if all the light sources are turned off we will still have some light in the room.		
  		The ambient channel used to simulate this non-directional environment light
   Diffuse light:
  		Diffuse light comes from a particular direction but is reflected evenly of the surface		
  		A good example of a diffuse light source is fluorescent lighting.
  		The angle in which the diffuse light component hit the surface influence the strength of the light reflected
  		( a right angle with the surface will give maximum reflection)
  
   Specular lighting:
  		Typical for metal objects and mirrors.
  		Specular Lighting identifies the bright specular highlights that occur when light 
  		hits an object surface and reflects back toward the camera. 
  		It is more intense than diffuse light and falls off more rapidly across the object surface. It takes longer to calculate specular lighting than diffuse lighting, however the benefit of using it is that it adds significant detail to a surface. 
  		
  
  
  
   Every source light is actually a combination of the three type of lights
   Feel free to play with these values till you get the desired results.
   The rule is that if it looks good then it is correct..	

   Important !
   -----------
   The resulted lighting is a combination of the material characteristic and the type of light
   For controlling the material light properties see STATE_polygon_set_ambient(), STATE_group_set_ambient(), STATE_object_set_ambient()

   

1. STATE_light2_create_default_light

2. STATE_light2_create_directional_light

3. STATE_light2_create_point_light

4. STATE_light2_create_spot_light

5. STATE_light2_get_number_of_lights_supported_by_hardware

6. STATE_light2_get_using_name

7. STATE_light2_disable_specular_lighting

8. STATE_light2_disable_all_lighting

9. STATE_light2_get_first_light

10. STATE_light2_get_next_light

11. STATE_light2_set_location

12. STATE_light2_get_location

13. STATE_light2_point_at

14. STATE_light2_set_direction

15. STATE_light2_get_direction

16. STATE_light2_set_type_of_light

17. STATE_light2_get_type_of_light

18. STATE_light2_set_range

19. STATE_light2_get_range

20. STATE_light2_set_attenuation

21. STATE_light2_get_attenuation

22. STATE_light2_set_complex_attenuation

23. STATE_light2_get_complex_attenuation

24. STATE_light2_set_inner_cone_angle

25. STATE_light2_get_inner_cone_angle

26. STATE_light2_set_outer_cone_angle

27. STATE_light2_get_outer_cone_angle

28. STATE_light2_set_inner_to_outer_cone_falloff

29. STATE_light2_get_inner_to_outer_cone_falloff

30. STATE_light2_set_ambient_color

31. STATE_light2_set_diffuse_color

32. STATE_light2_set_specular_color

33. STATE_light2_get_ambient_color

34. STATE_light2_get_diffuse_color

35. STATE_light2_get_specular_color

36. STATE_light2_is_light

37. STATE_light2_delete_all

38. STATE_light2_delete

39. STATE_light2_get_name

40. STATE_light2_set_name

41. STATE_light2_disable

42. STATE_light2_enable

43. STATE_light2_is_disabled

44. STATE_light2_calcualte_vertices_normals_automatically

 

 

Go to page 1     Select API

 

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