[Bf-blender-cvs] [1448af2] cycles-ptex-12: Add some Ptex types to Mesh SDNA

Nicholas Bishop noreply at git.blender.org
Mon Jan 26 02:04:36 CET 2015


Commit: 1448af227513c2f6ed4622d2f0a4bf744baa3136
Author: Nicholas Bishop
Date:   Mon Jan 19 15:59:28 2015 +0100
Branches: cycles-ptex-12
https://developer.blender.org/rB1448af227513c2f6ed4622d2f0a4bf744baa3136

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..59cd82f 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -280,6 +280,53 @@ typedef struct MVertSkin {
 	int flag;
 } MVertSkin;
 
+typedef enum PtexDataType {
+	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,
+} PtexDataType;
+
+/* 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_rlog2 * 2^v_rlog2).
+ *
+ * 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 {
+	/* TODO, shouldn't be in each loop? */
+	struct Image *image;
+
+	/* Channel data array */
+	void *data;
+
+	int pad;
+
+	/* enum PtexDataType */
+	unsigned char data_type;
+
+	unsigned char num_channels;
+	unsigned char u_rlog2;
+	unsigned char v_rlog2;
+} MLoopPtex;
+
+typedef struct MLoopPtexUV {
+	float uv[2];
+	int id;
+} MLoopPtexUV;
+
+typedef struct MTessFacePtex {
+	struct MLoopPtexUV corners[4];
+} MTessFacePtex;
+
 typedef struct FreestyleEdge {
 	char flag;
 	char pad[3];




More information about the Bf-blender-cvs mailing list