xsi_miuserdata_defs.h Source File
 
 
 
xsi_miuserdata_defs.h
Go to the documentation of this file.
00001 
00008 #ifndef XSI_MIUSERDATA_DEFS_H
00009 #define XSI_MIUSERDATA_DEFS_H
00010 
00011 #include <shader.h>
00012 
00013 /* Transformation data ------------------------------------------*/
00014 
00015 #define XSIMR_INSTANCETRANSFORMDATA_LABEL       0x00004210
00016 #define XSIMR_INSTANCETRANSFORMDATA_VERSION     0x00000003
00017 
00018 #define XSIMR_SHADOWINSTANCE_LABEL                      0xf6a209ca              // From random.org
00019 
00020 typedef enum
00021 {
00022         E3DIF_Ignore            = 0,
00023         E3DIF_Back                      = 1,
00024         E3DIF_Front                     = 2,
00025         E3DIF_Both                      = 3
00026 } xsimrInstanceFaceFlags;
00027 
00028 #define miDONTCARE                      (miCBoolean)2
00029 
00030 typedef struct
00031 {
00032         miCBoolean                              is_instance;
00033 
00034         miCBoolean                              primary_visible;
00035 
00036         miCBoolean                              transparent_receive;
00037         miCBoolean                              transparent_cast;
00038 
00039         miCBoolean                              reflection_receive;
00040         miCBoolean                              reflection_cast;
00041 
00042         miCBoolean                              refraction_receive;
00043         miCBoolean                              refraction_cast;
00044 
00045         miCBoolean                              fg_receive;
00046         miCBoolean                              fg_cast;
00047         miCBoolean                              fg_visible;
00048 
00049         miCBoolean                              gi_receive;
00050         miCBoolean                              gi_cast;
00051         miCBoolean                              gi_visible;
00052 
00053         miCBoolean                              caustic_receive;
00054         miCBoolean                              caustic_cast;
00055         miCBoolean                              caustic_visible;
00056 
00057         miCBoolean                              shadow_receive;
00058         miCBoolean                              shadow_cast;
00059 
00060         xsimrInstanceFaceFlags  face;
00061 } xsimrInstanceFlags;
00062 
00063 typedef struct
00064 {
00065         miVector                                scaling;
00066         miVector                                translation;
00067         miQuaternion                    rotation;
00068         miQuaternion                    scale_orientation;
00069 } xsimrInstanceTransform;
00070 
00071 typedef struct
00072 {
00073         miUint4                                 version;                        // Version + Byteswap indicator
00074         miCBoolean                              si_scaling;                     // Perform SI scaling (as opposed to classical)
00075         miCBoolean                              motionblur;                     // Do motion blur
00076         xsimrInstanceFlags              flags;                          // Instance's visibility flags
00077         xsimrInstanceTransform  open_transform;         // Instance's transform on shutter open
00078         xsimrInstanceTransform  close_transform;        // Instance's transform on shutter close (or if no motion blur)
00079 } xsimrInstanceTransformData;
00080 
00081 
00082 /* -----------------------------------------------------------*/
00105 #define XSIMR_LIGHTDATA_LABEL           2860411                         
00115 typedef enum
00116 {
00117         XSIMR_LF_DIFFUSE                        = 1 << 0,                               
00118         XSIMR_LF_SPECULAR                       = 1 << 1                                
00119 } xsimrLightFlags;
00127 typedef struct
00128 {
00129         xsimrLightFlags                         flags;   
00130 } xsimrLightData;
00131 
00132 /* -----------------------------------------------------------*/
00145 #define XSIMR_LIGHTILLUMDATA_KEY                "xsiLID"                
00154 typedef struct
00155 {
00156         miUint          struct_size;            
00158         miBoolean       set;                            
00160         miScalar        diffuse;                        
00161         miScalar        specular;                       
00163         miColor         color;                          
00164         miColor         shadow;                         
00165 } xsimrLightIllumData;
00166 
00167 /* -----------------------------------------------------------*/
00173 #define XSIMR_RENDERMAPDATA_LABEL               0x2C1ACA                
00176 /* Profile Curves ---------------------------------------------*/
00177 #define XSIMR_PROFILECURVEDATA_LABEL            0x9FDDD497; // random.org
00178 
00185 typedef enum
00186 {
00187         XSIMR_CE_CONSTANT                       = 1,    
00188         XSIMR_CE_END_GRADIENT           = 2,    
00189         XSIMR_CE_CYCLE                          = 3,    
00190         XSIMR_CE_CYCLE_RELATIVE         = 4             
00192 } xsimrCurveExtrapolation;
00205 typedef struct {
00206         xsimrCurveExtrapolation extrapolation_type;             
00207         miInteger                               n_points;                               
00208         miVector2d                              points[ 1 ];                    
00209 } xsimrProfileCurveData;
00210 
00211 
00212 /* Particle Shape -----------------------------------------------------------*/
00213 #include <shader.h>
00214 #include <geoshader.h>
00215 
00216 #define XSIMR_POINTCLOUDDATA_LABEL                      0x613EC66E              // random.org
00217 
00218 #define XSIMR_POINTCLOUDDATA_VERSION            0x020000                // 2.0
00219 
00226 typedef enum
00227 {
00228         xsimrSHAPE_POINT,                               
00229         xsimrSHAPE_SEGMENT,                             
00230         xsimrSHAPE_DISC,                                
00231         xsimrSHAPE_RECTANGLE,                   
00232         xsimrSHAPE_SPHERE,                              
00233         xsimrSHAPE_BOX,                                 
00234         xsimrSHAPE_CYLINDER,                    
00235         xsimrSHAPE_CAPSULE,                             
00236         xsimrSHAPE_CONE,                                
00237         xsimrSHAPE_BLOB,                                
00238         xsimrNB_SIMPLE_SHAPES,                  
00240         xsimrSHAPE_INSTANCE             = 128,  
00241 } xsimrParticleShapeType;
00348 typedef struct
00349 {
00350         xsimrParticleShapeType          type;                   
00351         miInteger                                       instance_id;    
00354 } xsimrParticleShape;
00355 
00356 
00362 typedef struct
00363 {
00364         miUint                                          size;           
00365         miUint                                          offset;         
00366 } xsimrParticleBlob;
00367 
00374 typedef enum
00375 {
00376         xsimrATTRIBUTE_BOOLEAN,         
00377         xsimrATTRIBUTE_INTEGER,         
00378         xsimrATTRIBUTE_SCALAR,          
00379         xsimrATTRIBUTE_VECTOR2,         
00380         xsimrATTRIBUTE_VECTOR3,         
00381         xsimrATTRIBUTE_VECTOR4,         
00382         xsimrATTRIBUTE_QUATERNION,      
00383         xsimrATTRIBUTE_MATRIX33,        
00384         xsimrATTRIBUTE_MATRIX44,        
00385         xsimrATTRIBUTE_COLOR4,          
00386         xsimrATTRIBUTE_ROTATION,        
00387         xsimrATTRIBUTE_SHAPE,           
00388         xsimrATTRIBUTE_BLOB,            
00389 } xsimrAttributeType;
00427 typedef struct
00428 {
00431         miTag                   name;                   // The attribute's name
00432 
00436         xsimrAttributeType      type;   // The attribute's data type
00437 
00447         miBoolean               constant;
00448 
00452         miUint                  size;
00453 
00461         miTag                   offsets;
00462 
00468         miTag                   data;                   // The userdata tag for the data blob.
00469 
00474         miTag                   blob_type;
00475 } xsimrAttributeData;
00476 
00477 
00493 typedef struct
00494 {
00495         miUint                  version;                        
00496         miUint                  nb_particles;           
00497         miTag                   positions;                      
00499         int                             i_data;                         
00500         int                             n_data;                         
00502         xsimrAttributeData attributes[ 1 ];     
00503 } xsimrPointCloudData;
00504 
00505 
00506 // Instance Marker
00507 
00517 #define XSIMR_POINTCLOUD_INDEX_LABEL            0x613EC66F              
00518 #define XSIMR_ATTRIBUTE_SHADER_KEY                      "xsiATTR"               
00526 typedef struct
00527 {
00528         miUint                  pc_index;       
00529         miUint                  st_index;       
00530 } xsimrPointCloudIndex;
00531 
00532 
00533 // Time mapping data for attribute time-controlled images
00541 typedef struct
00542 {
00543         miScalar                        range_min;              
00544         miScalar                        range_max;              
00545         miInteger                       index;                  
00546 } xsimrTimeMapValue;
00547 
00555 typedef struct
00556 {
00557         miInteger                       n_time_map;                     
00558         xsimrTimeMapValue       time_map[ 1 ];          
00559 } xsimrAttributeImageTimeMap;
00560 
00562 // Color Correction Look-up Table Definition
00563 
00564 #define XSIMR_CCLUT_GAMMA_LABEL         0x0A63EC03      // random.org
00565 #define XSIMR_CCLUT_1D_LABEL            0x0F2F2674      // random.org
00566 #define XSIMR_CCLUT_3D_LABEL            0x088F67E5      // random.org
00567 
00568 typedef struct
00569 {
00570         miScalar                r, g, b;
00571 } xsimrColor3;
00572 
00573 typedef struct
00574 {
00575         miScalar                red_gamma;
00576         miScalar                green_gamma;
00577         miScalar                blue_gamma;
00578 } xsimrCCLUTGamma;
00579 
00580 typedef struct
00581 {
00582         miScalar                from;
00583         miScalar                to;
00584 } xsimrCCLUTMapTuple;
00585 
00586 typedef struct
00587 {
00588         int                             i_tuple;
00589         int                             n_tuple;
00590         xsimrCCLUTMapTuple tuple[ 1 ];
00591 } xsimrCCLUTRangeMap;
00592 
00593 typedef struct 
00594 {
00595         miTag                   name;
00596         miTag                   params;
00597 } xsimrCCLUTPreTransform;
00598 
00599 typedef struct
00600 {
00601         xsimrCCLUTRangeMap      red_range;
00602         xsimrCCLUTRangeMap      green_range;
00603         xsimrCCLUTRangeMap      blue_range;
00604 
00605         int                             i_lut;
00606         int                             n_lut;
00607         xsimrColor3             lut[ 1 ];
00608 
00609         xsimrCCLUTPreTransform pretransform;
00610 } xsimrCCLUT1D;
00611 
00612 typedef struct
00613 {
00614         xsimrCCLUTRangeMap      red_range;
00615         xsimrCCLUTRangeMap      green_range;
00616         xsimrCCLUTRangeMap      blue_range;
00617 
00618         // red_size * green_size * blue_size == n_lut
00619         int                             red_size;
00620         int                             green_size;
00621         int                             blue_size;
00622 
00623         int                             i_lut;
00624         int                             n_lut;
00625         xsimrColor3             lut[ 1 ];
00626 
00627         xsimrCCLUTPreTransform pretransform;
00628 } xsimrCCLUT3D;
00629 
00630 
00631 #define XSIMR_MESHDATA_LABEL                    0x112A61FF              // random.org
00632 #define XSIMR_MESHDATA_VERSION                  0x010000                // 1.0
00633 
00634 typedef enum
00635 {
00636         xsimrMESHATTRIBUTESTORAGE_CONSTANT,     
00637         xsimrMESHATTRIBUTESTORAGE_TSPACE,
00638 } xsimrMeshAttributeStorage;
00639 
00645 typedef struct
00646 {
00647         char                                            name[256];      // A string with the attribute name
00648         xsimrAttributeType                      type;           // The attribute type. For constant storage, constant_data contains the per mesh value.
00649         xsimrMeshAttributeStorage       storage;        // The attribute storage. Attributes can be defined as tspace, per vertex userdata or constant.
00650         miInteger                                       id;                     // The index for tspace or vertex user data storage.
00651 
00652         // A union for the constant data.
00653         union 
00654         {
00655                 miCBoolean              b;
00656                 miInteger               i;
00657                 miScalar                s;
00658                 miVector2d              v2;
00659                 miVector                v3;
00660                 miQuaternion    v4;
00661                 miVector                m33[3];
00662                 miMatrix                m44;
00663                 miColor                 c;
00664         } constant_data;
00665 
00666 } xsimrMeshAttribute;
00667 
00675 typedef struct
00676 {
00677         // An array of xsimrMeshAttribute that represents the pushed attributes
00678         int     i_attributes;
00679         int     n_attributes;
00680         xsimrMeshAttribute attributes[ 1 ];
00681 } xsimrMesh;
00682 
00683 #endif /* XSI_MIUSERDATA_DEFS_H */