[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [10820] branches/soc-2007-maike/source/ blender/include/BIF_glsl_light.h: GLSL Light structures and function prototypes

Miguel Torres Lima torreslima at gmail.com
Wed May 30 17:08:10 CEST 2007


Revision: 10820
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10820
Author:   maike
Date:     2007-05-30 17:08:10 +0200 (Wed, 30 May 2007)

Log Message:
-----------
GLSL Light structures and function prototypes

Added Paths:
-----------
    branches/soc-2007-maike/source/blender/include/BIF_glsl_light.h

Added: branches/soc-2007-maike/source/blender/include/BIF_glsl_light.h
===================================================================
--- branches/soc-2007-maike/source/blender/include/BIF_glsl_light.h	                        (rev 0)
+++ branches/soc-2007-maike/source/blender/include/BIF_glsl_light.h	2007-05-30 15:08:10 UTC (rev 10820)
@@ -0,0 +1,113 @@
+typedef struct GLSL_LightList_ *GLSL_LightList;
+typedef struct GLSL_Light_ *GLSL_Light;
+typedef struct GLSL_LampLight_ *GLSL_LampLight;
+typedef struct GLSL_AreaLight_ *GLSL_AreaLight;
+typedef struct GLSL_SpotLight_ *GLSL_SpotLight;
+typedef struct GLSL_SunLight_ *GLSL_SunLight;
+typedef struct GLSL_HemiLight_ *GLSL_HemiLight;
+typedef struct GLSL_LocalLight_ *GLSL_LocalLight;
+
+
+struct GLSL_LightList_
+{
+  GLSL_Light light;
+  GLSL_LightList next, prev;
+};
+
+
+struct GLSL_Light_
+{
+  short type;       // lamp type flag
+  void *glsl_light; // pointer to GLSL_Lamp... type structure
+  void *blen_light; // pointer to Blender light
+};
+
+
+struct GLSL_LampLight_
+{
+  short mode;        // light's active modes LA_QUAD | LA_SPHERE | LA_LAYER | LA_NEG | LA_NO_DIFF | LA_NO_SPEC
+
+  float loc[3];      // light's location
+  float color[3];    // light's diffuse color
+  float dist;        // light's distance parameter
+  float energy;      // light's energy
+  float quad1;       // light's linear distance attenuation factor
+  float quad2;       // light's quadratic distance attenuation factor
+};
+
+
+struct GLSL_AreaLight_
+{
+  short mode;
+
+  float loc[3];
+  float color[3];      // directional light's directional vector
+  float dist;
+  float energy;
+  float gamma;         // area light's gamma
+
+  short area_type;     // area type square | rectangle
+  float area_size_x;   // area's x size (x and y for square)
+  float area_size_y;   // area's y size (only for rectangle)
+};
+
+
+struct GLSL_SpotLight_
+{
+  short mode;
+
+  float loc[3];
+  float color[3];
+  float dist;
+  float energy;
+  float quad1;
+  float quad2;
+};
+
+
+struct GLSL_SunLight_
+{ 
+  short mode;
+ 
+  float loc[3];
+  float vec[3];
+  float color[3];
+  float dist;
+  float energy;
+};
+
+
+struct GLSL_HemiLight_
+{
+  short mode;
+  
+  float loc[3];
+  float vec[3];
+  float color[3];
+  float dist;
+  float energy;
+};
+
+
+struct GLSL_LocalLight_
+{
+  float vec[3];
+  float color[3];
+  float spec_color[3];
+};
+
+
+struct Lamp;
+struct Object;
+
+void glsl_init_scene_light(struct Lamp *lamp, struct Object *obj);
+void glsl_free_light_structs(void);
+void glsl_create_light(struct Lamp *lamp, struct Object *obj);
+GLSL_Light glsl_create_glsl_light(struct Lamp *lamp, struct Object *obj);
+GLSL_LampLight create_lamp_light(struct Lamp *lamp, struct Object *obj);
+GLSL_AreaLight create_area_light(struct Lamp *lamp, struct Object *obj);
+GLSL_SpotLight create_spot_light(struct Lamp *lamp, struct Object *obj);
+GLSL_SunLight create_sun_light(struct Lamp *lamp, struct Object *obj);
+GLSL_HemiLight create_hemi_light(struct Lamp *lamp, struct Object *obj);
+void glsl_delete_light(struct Lamp *lamp);
+void glsl_delete_glsl_light(GLSL_Light light);





More information about the Bf-blender-cvs mailing list