C:/jkyprian/devel/lib3ds/lib3ds/material.h

00001 /* -*- c -*- */
00002 #ifndef INCLUDED_LIB3DS_MATERIAL_H
00003 #define INCLUDED_LIB3DS_MATERIAL_H
00004 /*
00005  * The 3D Studio File Format Library
00006  * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
00007  * All rights reserved.
00008  *
00009  * This program is  free  software;  you can redistribute it and/or modify it
00010  * under the terms of the  GNU Lesser General Public License  as published by 
00011  * the  Free Software Foundation;  either version 2.1 of the License,  or (at 
00012  * your option) any later version.
00013  *
00014  * This  program  is  distributed in  the  hope that it will  be useful,  but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00016  * or  FITNESS FOR A  PARTICULAR PURPOSE.  See the  GNU Lesser General Public  
00017  * License for more details.
00018  *
00019  * You should  have received  a copy of the GNU Lesser General Public License
00020  * along with  this program;  if not, write to the  Free Software Foundation,
00021  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00022  *
00023  * $Id: material.h,v 1.18 2007/06/20 17:04:08 jeh Exp $
00024  */
00025 
00026 #ifndef INCLUDED_LIB3DS_TYPES_H
00027 #include <lib3ds/types.h>
00028 #endif
00029 
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033 
00037 typedef enum Lib3dsTextureMapFlags {
00038   LIB3DS_DECALE       =0x0001,
00039   LIB3DS_MIRROR       =0x0002,
00040   LIB3DS_NEGATE       =0x0008,
00041   LIB3DS_NO_TILE      =0x0010,
00042   LIB3DS_SUMMED_AREA  =0x0020,
00043   LIB3DS_ALPHA_SOURCE =0x0040,
00044   LIB3DS_TINT         =0x0080,
00045   LIB3DS_IGNORE_ALPHA =0x0100,
00046   LIB3DS_RGB_TINT     =0x0200
00047 } Lib3dsTextureMapFlags;
00048 
00053 typedef struct Lib3dsTextureMap {
00054     Lib3dsUserData user;
00055     char name[64];
00056     Lib3dsDword flags;
00057     Lib3dsFloat percent;
00058     Lib3dsFloat blur;
00059     Lib3dsFloat scale[2];
00060     Lib3dsFloat offset[2];
00061     Lib3dsFloat rotation;
00062     Lib3dsRgb tint_1;
00063     Lib3dsRgb tint_2;
00064     Lib3dsRgb tint_r;
00065     Lib3dsRgb tint_g;
00066     Lib3dsRgb tint_b;
00067 } Lib3dsTextureMap;
00068 
00072 typedef enum Lib3dsAutoReflMapFlags {
00073   LIB3DS_USE_REFL_MAP          =0x0001,
00074   LIB3DS_READ_FIRST_FRAME_ONLY =0x0004,
00075   LIB3DS_FLAT_MIRROR           =0x0008 
00076 } Lib3dsAutoReflectionMapFlags;
00077 
00081 typedef enum Lib3dsAutoReflMapAntiAliasLevel {
00082   LIB3DS_ANTI_ALIAS_NONE   =0,
00083   LIB3DS_ANTI_ALIAS_LOW    =1,
00084   LIB3DS_ANTI_ALIAS_MEDIUM =2,
00085   LIB3DS_ANTI_ALIAS_HIGH   =3
00086 } Lib3dsAutoReflMapAntiAliasLevel;
00087 
00092 typedef struct Lib3dsAutoReflMap {
00093     Lib3dsDword flags;
00094     Lib3dsIntd level;
00095     Lib3dsIntd size;
00096     Lib3dsIntd frame_step;
00097 } Lib3dsAutoReflMap;
00098 
00102 typedef enum Lib3dsMaterialShading {
00103   LIB3DS_WIRE_FRAME =0,
00104   LIB3DS_FLAT       =1, 
00105   LIB3DS_GOURAUD    =2, 
00106   LIB3DS_PHONG      =3, 
00107   LIB3DS_METAL      =4
00108 } Lib3dsMaterialShading; 
00109 
00114 struct Lib3dsMaterial {
00115     Lib3dsUserData user;                
00116     Lib3dsMaterial *next;
00117     char name[64];                      
00118     Lib3dsRgba ambient;                 
00119     Lib3dsRgba diffuse;                 
00120     Lib3dsRgba specular;                
00121     Lib3dsFloat shininess;              
00122     Lib3dsFloat shin_strength;
00123     Lib3dsBool use_blur;
00124     Lib3dsFloat blur;
00125     Lib3dsFloat transparency;
00126     Lib3dsFloat falloff;
00127     Lib3dsBool additive;
00128     Lib3dsFloat self_ilpct;
00129     Lib3dsBool use_falloff;
00130     Lib3dsBool self_illum;
00131     Lib3dsIntw shading;
00132     Lib3dsBool soften;
00133     Lib3dsBool face_map;
00134     Lib3dsBool two_sided;               
00135     Lib3dsBool map_decal;
00136     Lib3dsBool use_wire;
00137     Lib3dsBool use_wire_abs;
00138     Lib3dsFloat wire_size;
00139     Lib3dsTextureMap texture1_map;
00140     Lib3dsTextureMap texture1_mask;
00141     Lib3dsTextureMap texture2_map;
00142     Lib3dsTextureMap texture2_mask;
00143     Lib3dsTextureMap opacity_map;
00144     Lib3dsTextureMap opacity_mask;
00145     Lib3dsTextureMap bump_map;
00146     Lib3dsTextureMap bump_mask;
00147     Lib3dsTextureMap specular_map;
00148     Lib3dsTextureMap specular_mask;
00149     Lib3dsTextureMap shininess_map;
00150     Lib3dsTextureMap shininess_mask;
00151     Lib3dsTextureMap self_illum_map;
00152     Lib3dsTextureMap self_illum_mask;
00153     Lib3dsTextureMap reflection_map;
00154     Lib3dsTextureMap reflection_mask;
00155     Lib3dsAutoReflMap autorefl_map;
00156 };
00157 
00158 extern LIB3DSAPI Lib3dsMaterial* lib3ds_material_new();
00159 extern LIB3DSAPI void lib3ds_material_free(Lib3dsMaterial *material);
00160 extern LIB3DSAPI void lib3ds_material_dump(Lib3dsMaterial *material);
00161 extern LIB3DSAPI Lib3dsBool lib3ds_material_read(Lib3dsMaterial *material, Lib3dsIo *io);
00162 extern LIB3DSAPI Lib3dsBool lib3ds_material_write(Lib3dsMaterial *material, Lib3dsIo *io);
00163 
00164 #ifdef __cplusplus
00165 }
00166 #endif
00167 #endif
00168 
00169 
00170 

Hosted by
SourceForge.net Logo
Generated at Wed Jun 20 18:51:36 2007 by Doxygen 1.5.2