Commit: 70edd8b3be5ff88d8378c114dfd5c19fd9e903a5
Author: Nicholas Bishop
Date:   Mon Jan 19 15:59:28 2015 +0100
Branches: cycles-ptex-08
https://developer.blender.org/rB70edd8b3be5ff88d8378c114dfd5c19fd9e903a5

Add some Ptex types to Mesh SDNA

===================================================================

M       source/blender/makesdna/DNA_meshdata_types.h

===================================================================

diff --git a/source/blender/makesdna/DNA_meshdata_types.h 
b/source/blender/makesdna/DNA_meshdata_types.h
index 3304980..e331aff 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -96,6 +96,16 @@ typedef struct MTexPoly {
        short mode, tile, pad;
 } MTexPoly;
 
+typedef struct MPtexLoop {
+       float uv[2];
+       int id;
+       int pad;
+} MPtexLoop;
+
+typedef struct MPtexTessFace {
+       struct MPtexLoop corners[4];
+} MPtexTessFace;
+
 /* can copy from/to MTexPoly/MTFace */
 #define ME_MTEXFACE_CPY(dst, src)   \
 {                                   \
@@ -280,6 +290,41 @@ typedef struct MVertSkin {
        int flag;
 } MVertSkin;
 
+typedef enum PtexChannelDataType {
+       MPTEX_DATA_TYPE_UINT8  =  0,
+       MPTEX_DATA_TYPE_UINT16 =  1,
+       /* Reserved for compatibility with Ptex file format
+        * specification */
+       /* MPTEX_DATA_TYPE_FLOAT16 = 2, */
+       MPTEX_DATA_TYPE_FLOAT32 = 3,
+} PtexChannelDataType;
+
+/* Ptex texture data attached to mesh poly loops
+ *
+ * The texture is rectanglular (doesn't have to be square), and the
+ * number of pixels on each side must be a power of two. The number of
+ * texels in the texture is (2^u_res * 2^v_res).
+ *
+ * All channels have the same data type and resolution, so the data
+ * array's length in bytes is:
+ *     num_texels *
+ *     num_channels *
+ *     data_type_size_in_bytes
+ */
+typedef struct MLoopPtex {
+       /* Channel data array */
+       void *data;
+
+       int pad;
+
+       /* enum PtexChannelDataType */
+       unsigned char data_type;
+
+       unsigned char num_channels;
+       unsigned char u_res;
+       unsigned char v_res;
+} MLoopPtex;
+
 typedef struct FreestyleEdge {
        char flag;
        char pad[3];

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to