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;
00193 
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"       
00527 typedef struct
00528 {
00529     miUint          pc_index;   
00530     miUint          st_index;   
00531 } xsimrPointCloudIndex;
00535 // Time mapping data for attribute time-controlled images
00543 typedef struct
00544 {
00545     miScalar            range_min;      
00546     miScalar            range_max;      
00547     miInteger           index;          
00548 } xsimrTimeMapValue;
00549 
00557 typedef struct
00558 {
00559     miInteger           n_time_map;         
00560     xsimrTimeMapValue   time_map[ 1 ];      
00561 } xsimrAttributeImageTimeMap;
00562 
00564 // Color Correction Look-up Table Definition
00565 
00566 #define XSIMR_CCLUT_GAMMA_LABEL     0x0A63EC03  // random.org
00567 #define XSIMR_CCLUT_1D_LABEL        0x0F2F2674  // random.org
00568 #define XSIMR_CCLUT_3D_LABEL        0x088F67E5  // random.org
00569 
00570 typedef struct
00571 {
00572     miScalar        r, g, b;
00573 } xsimrColor3;
00574 
00575 typedef struct
00576 {
00577     miScalar        red_gamma;
00578     miScalar        green_gamma;
00579     miScalar        blue_gamma;
00580 } xsimrCCLUTGamma;
00581 
00582 typedef struct
00583 {
00584     miScalar        from;
00585     miScalar        to;
00586 } xsimrCCLUTMapTuple;
00587 
00588 typedef struct
00589 {
00590     int             i_tuple;
00591     int             n_tuple;
00592     xsimrCCLUTMapTuple tuple[ 1 ];
00593 } xsimrCCLUTRangeMap;
00594 
00595 typedef struct 
00596 {
00597     miTag           name;
00598     miTag           params;
00599 } xsimrCCLUTPreTransform;
00600 
00601 typedef struct
00602 {
00603     xsimrCCLUTRangeMap  red_range;
00604     xsimrCCLUTRangeMap  green_range;
00605     xsimrCCLUTRangeMap  blue_range;
00606 
00607     int             i_lut;
00608     int             n_lut;
00609     xsimrColor3     lut[ 1 ];
00610 
00611     xsimrCCLUTPreTransform pretransform;
00612 } xsimrCCLUT1D;
00613 
00614 typedef struct
00615 {
00616     xsimrCCLUTRangeMap  red_range;
00617     xsimrCCLUTRangeMap  green_range;
00618     xsimrCCLUTRangeMap  blue_range;
00619 
00620     // red_size * green_size * blue_size == n_lut
00621     int             red_size;
00622     int             green_size;
00623     int             blue_size;
00624 
00625     int             i_lut;
00626     int             n_lut;
00627     xsimrColor3     lut[ 1 ];
00628 
00629     xsimrCCLUTPreTransform pretransform;
00630 } xsimrCCLUT3D;
00631 
00632 
00633 #define XSIMR_MESHDATA_LABEL            0x112A61FF      // random.org
00634 #define XSIMR_MESHDATA_VERSION          0x010000        // 1.0
00635 
00636 typedef enum
00637 {
00638     xsimrMESHATTRIBUTESTORAGE_CONSTANT, 
00639     xsimrMESHATTRIBUTESTORAGE_TSPACE,
00640 } xsimrMeshAttributeStorage;
00641 
00647 typedef struct
00648 {
00649     char                        name[256];  // A string with the attribute name
00650     xsimrAttributeType          type;       // The attribute type. For constant storage, constant_data contains the per mesh value.
00651     xsimrMeshAttributeStorage   storage;    // The attribute storage. Attributes can be defined as tspace, per vertex userdata or constant.
00652     miInteger                   id;         // The index for tspace or vertex user data storage.
00653 
00654     // A union for the constant data.
00655     union 
00656     {
00657         miCBoolean      b;
00658         miInteger       i;
00659         miScalar        s;
00660         miVector2d      v2;
00661         miVector        v3;
00662         miQuaternion    v4;
00663         miVector        m33[3];
00664         miMatrix        m44;
00665         miColor         c;
00666     } constant_data;
00667 
00668 } xsimrMeshAttribute;
00669 
00677 typedef struct
00678 {
00679     // An array of xsimrMeshAttribute that represents the pushed attributes
00680     int i_attributes;
00681     int n_attributes;
00682     xsimrMeshAttribute attributes[ 1 ];
00683 } xsimrMesh;
00684 
00685 #endif /* XSI_MIUSERDATA_DEFS_H */