Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:shape [2016/12/11 15:49] – Added .shape file documentation (V1) Sit Melai | en:shape [2021/12/03 18:19] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Shape ====== | + | ====== Shape specifications |
| ===== A Shape in the code ===== | ===== A Shape in the code ===== | ||
| Line 5: | Line 5: | ||
| <WRAP center round important 60%> | <WRAP center round important 60%> | ||
| Following notes are only a draft and work in progress! | Following notes are only a draft and work in progress! | ||
| - | --- //[[wiki:user: | + | --- // |
| </ | </ | ||
| Line 163: | Line 163: | ||
| ==== The .shape format ==== | ==== The .shape format ==== | ||
| - | You want to make your own importer/ | + | You want to make your own importer/ |
| <WRAP center round important 60%> | <WRAP center round important 60%> | ||
| Not finished yet, missing some parts that can be parsed as PolyPtr! WIP! | Not finished yet, missing some parts that can be parsed as PolyPtr! WIP! | ||
| - | --- //[[wiki:user: | + | |
| + | --- // | ||
| </ | </ | ||
| - | < | + | Check [[en: |
| - | Version | + | |
| - | - 1 byte number, ver | + | |
| - | if ver = 0xFF | + | |
| - | - 4 bytes number, ver | + | |
| - | Double | ||
| - | - 8 bytes number | ||
| - | Float | + | Base class for start is **CShapeStream**. |
| - | - 4 bytes number | + | You need all classes that are called from this class, and following classes (or child classes) for PolyPtr: |
| - | Bool | + | |
| - | | + | * **IMeshVertexProgram** (CMeshVPWindTree, |
| + | * **IShape** (CMesh, CMeshBase, CMeshMRM, CMeshMRMSkinned, | ||
| - | String (Length encoded) | ||
| - | - 4 bytes number, len | ||
| - | - len bytes string | ||
| - | |||
| - | RGBA | ||
| - | - 1 byte number r (0 - 255) | ||
| - | - 1 byte number g (0 - 255) | ||
| - | - 1 byte nubmer b (0 - 255) | ||
| - | - 1 byte number a (0 - 255) | ||
| - | |||
| - | 2DVector | ||
| - | - Float x | ||
| - | - Float y | ||
| - | |||
| - | 3DVector | ||
| - | - Float x | ||
| - | - Float y | ||
| - | - Float z | ||
| - | |||
| - | 4DVector | ||
| - | - Float a | ||
| - | - Float b | ||
| - | - Float c | ||
| - | - Float d | ||
| - | |||
| - | PolyPtr | ||
| - | - 8 bytes number, an id | ||
| - | - if id not in file yet | ||
| - | - String, classname | ||
| - | - classname | ||
| - | |||
| - | Shape | ||
| - | - 4 bytes that are " | ||
| - | - PolyPtr | ||
| - | |||
| - | CMesh | ||
| - | - Version | ||
| - | - CMeshBase | ||
| - | - CMeshGeom | ||
| - | |||
| - | CMeshBase | ||
| - | - Version, ver | ||
| - | - ver greater/ | ||
| - | - 4 bytes number, Number Animated Morphs | ||
| - | 0 to Number Animated Morphs | ||
| - | - String, Material Name | ||
| - | - ver bigger than 1 | ||
| - | - Version | ||
| - | - 3DVector, Default Position | ||
| - | - Version | ||
| - | - 3DVector, Default Pivot | ||
| - | - Version | ||
| - | - 3DVector, Default Rotation Euler | ||
| - | - Version | ||
| - | - 4DVector, Default Rotation Quat | ||
| - | - Version | ||
| - | - 3DVector, Default Scale | ||
| - | - 4 bytes number, Number Materials | ||
| - | 0 to Number Materials | ||
| - | - CMaterial | ||
| - | - 4 bytes number, Number Elements | ||
| - | 0 to Number Elements | ||
| - | - 4 bytes number, key | ||
| - | - CMaterialBase, | ||
| - | - map key to value | ||
| - | - ver bigger/ | ||
| - | // Map p maps index to matnumber and stage number | ||
| - | - 4 bytes number, Number Lights | ||
| - | 0 to Number Lights | ||
| - | - CLightMapInfoList | ||
| - | - ver smaller than 8 // Map m maps light name to map p | ||
| - | // Map p maps index to matnumber and stage number | ||
| - | - 4 bytes number, Number Lights | ||
| - | 0 to Number Lights | ||
| - | - String, key | ||
| - | - 4 bytes number, num | ||
| - | 0 to num, i | ||
| - | - 1 byte number, value[i][" | ||
| - | - 1 byte number, value[i][" | ||
| - | - ver bigger/ | ||
| - | - Bool, Lightable | ||
| - | - ver bigger/ | ||
| - | - Bool, Use Lighting Local Attenuation | ||
| - | - ver bigger/ | ||
| - | - Bool, Auto Anim | ||
| - | - ver bigger/ | ||
| - | - Float, Max Distance | ||
| - | - ver bigger/ | ||
| - | - 8 bytes number, id | ||
| - | - if id not read yet | ||
| - | - CLodCharacterTexture | ||
| - | - ver bigger/ | ||
| - | - 4 bytes number, index | ||
| - | index value | ||
| - | - case 0 | ||
| - | - Auto Camera Collision | ||
| - | - case 1 | ||
| - | - No Camera Collision | ||
| - | - case 2 | ||
| - | - Force Camera Collision | ||
| - | |||
| - | CMeshGeom | ||
| - | - Version, ver | ||
| - | - ver bigger/ | ||
| - | - 4 bytes number, Number Bone Names | ||
| - | 0 to Number Bone Names | ||
| - | - String, Bone Name | ||
| - | - ver bigger/ | ||
| - | - PolyPtr, Mesh Vertex Program | ||
| - | - ver bigger/ | ||
| - | - CMeshMorpher, | ||
| - | - CVertexBuffer, | ||
| - | - 4 bytes number, Number Matrix Blocks | ||
| - | 0 to Number Matrix Blocks | ||
| - | - CMatrixBlock | ||
| - | - CAABBox, BBox | ||
| - | - Bool, Skinned | ||
| - | |||
| - | CMaterial | ||
| - | - Version | ||
| - | - 4 bytes number, index | ||
| - | index in Shaders: | ||
| - | " | ||
| - | - 4 bytes number, flags | ||
| - | - 4 bytes number, index | ||
| - | index in Source Blenders | ||
| - | " | ||
| - | - 4 bytes number, index | ||
| - | index in Destination Blenders | ||
| - | " | ||
| - | - 4 bytes number, index | ||
| - | index in ZFunctions | ||
| - | " | ||
| - | - Float, ZBias | ||
| - | - RGBA, Color | ||
| - | - RGBA, Emissive | ||
| - | - RGBA, Ambient | ||
| - | - RGBA, Diffuse | ||
| - | - RGBA, Specular | ||
| - | - ver greater/ | ||
| - | - Float, Shininess | ||
| - | - ver greater/ | ||
| - | - Float, AlphaTestThreshold | ||
| - | - ver greater/ | ||
| - | - 2 bytes number, Texture Coordinate Generation Mode | ||
| - | 0 to IDRV_MAT_MAXTEXTURES (0 to 4) | ||
| - | - PolyPtr, Texture | ||
| - | - ver greater/ | ||
| - | - TexEnv (ver greater/ | ||
| - | - ver greater/ | ||
| - | - ver greater/ | ||
| - | - 4 bytes number, Number of Light Maps | ||
| - | 0 to Number of Light Maps | ||
| - | - CLightMap_2 | ||
| - | - Bool | ||
| - | - ver smaller 7 | ||
| - | - 4 bytes number, Number of Light Maps | ||
| - | 0 to Number of Light Maps | ||
| - | - CLightMap | ||
| - | - ver greater/ | ||
| - | - flags greater 0 | ||
| - | 0 to Max Textures (4) | ||
| - | - 1 byte number, Texture Address Mode | ||
| - | - ver greater/ | ||
| - | 0 to Max Textures (4), i | ||
| - | - flags greater 0 | ||
| - | - i smaller than 3 | ||
| - | - CMatrix, Texture User Mat | ||
| - | |||
| - | CMaterialBase | ||
| - | - Version, ver | ||
| - | - String, Name | ||
| - | - Version | ||
| - | - RGBA, Default Ambient | ||
| - | - Version | ||
| - | - RGBA, Default Diffuse | ||
| - | - Version | ||
| - | - RGBA, Default Specular | ||
| - | - Version | ||
| - | - Float, Shininess | ||
| - | - Version | ||
| - | - RGBA, Default Emissive | ||
| - | - Version | ||
| - | - Float, Default Opacity | ||
| - | - Version | ||
| - | - 4 bytes number, Default Texture | ||
| - | - 4 bytes number, Number Elements | ||
| - | 0 to Number Elements | ||
| - | - 4 bytes number, key | ||
| - | - CAnimatedTexture, | ||
| - | - map key to mat | ||
| - | - ver greater 0 | ||
| - | 0 to Max Textures (4) | ||
| - | - CTexAnimTracks | ||
| - | |||
| - | CLightMapInfoList | ||
| - | - Version | ||
| - | - 4 bytes number, Light Group | ||
| - | - String, Animated Light | ||
| - | - 4 bytes number, Number Mat Stages | ||
| - | 0 to Number Mat Stages | ||
| - | - Version | ||
| - | - 1 byte number, Material Id | ||
| - | - 1 byte number, Stage Id | ||
| - | |||
| - | CLodCharacterTexture | ||
| - | - Version | ||
| - | - 4 bytes number, Width | ||
| - | - 4 bytes number, Height | ||
| - | - 4 bytes number, Number Points | ||
| - | 0 to Number Points | ||
| - | - 1 byte number, T | ||
| - | - 1 byte number, U | ||
| - | - 1 byte number, V | ||
| - | - 1 byte number, Q | ||
| - | |||
| - | CMeshMorpher | ||
| - | - Version | ||
| - | - 4 bytes number, Number Blend Shapes | ||
| - | 0 to Number Blend Shapes | ||
| - | - CBlendShape | ||
| - | |||
| - | CVertexBuffer | ||
| - | - Version, ver | ||
| - | - ver smaller 2 | ||
| - | - 4 bytes number, Flags | ||
| - | bit 1 = XYZ | ||
| - | bit 2 = Weight0, WeightCount = 1 // if multiple, highest WeightCount | ||
| - | bit 3 = Weight1, WeightCount = 2 | ||
| - | bit 4 = Weight2, WeightCount = 3 | ||
| - | bit 5 = Weight3, WeightCount = 4 | ||
| - | bit 6 = Normal | ||
| - | bit 7 = PrimaryColor | ||
| - | bit 8 = SecondaryColor | ||
| - | bit 9 = TexCoord0 | ||
| - | bit 10 = TexCoord1 | ||
| - | bit 11 = TexCoord2 | ||
| - | bit 12 = TexCoord3 | ||
| - | bit 13 = TexCoord4 | ||
| - | bit 14 = TexCoord5 | ||
| - | bit 15 = TexCoord6 | ||
| - | bit 16 = TexCoord7 | ||
| - | bits 17 & 2 & 3 & 4 & 5 = PaletteSkin | ||
| - | - 4 bytes number, Number Vertices | ||
| - | 0 to Number Vertices | ||
| - | - XYZ_Flag | ||
| - | - 3DVector, XYZ | ||
| - | - Normal_Flag | ||
| - | - 3DVector, Normal | ||
| - | 0 to MaxStage (8), i | ||
| - | - UVi_Flag | ||
| - | - CUV | ||
| - | - PrimaryColor_Flag | ||
| - | - RGBA, Color | ||
| - | - SecondaryColor_Flag | ||
| - | - RGBA, Specular | ||
| - | 0 to WeightCount | ||
| - | - Float, Weight | ||
| - | - PaletteSkin_Flag | ||
| - | - CPaletteSkin | ||
| - | - ver greater/ | ||
| - | - Version, hver | ||
| - | - hver smaller 1 | ||
| - | - 4 bytes number, Flags | ||
| - | bit 1 = XYZ | ||
| - | bit 2 = Weight0, WeightCount = 1 // if multiple, highest WeightCount | ||
| - | bit 3 = Weight1, WeightCount = 2 | ||
| - | bit 4 = Weight2, WeightCount = 3 | ||
| - | bit 5 = Weight3, WeightCount = 4 | ||
| - | bit 6 = Normal | ||
| - | bit 7 = PrimaryColor | ||
| - | bit 8 = SecondaryColor | ||
| - | bit 9 = TexCoord0 | ||
| - | bit 10 = TexCoord1 | ||
| - | bit 11 = TexCoord2 | ||
| - | bit 12 = TexCoord3 | ||
| - | bit 13 = TexCoord4 | ||
| - | bit 14 = TexCoord5 | ||
| - | bit 15 = TexCoord6 | ||
| - | bit 16 = TexCoord7 | ||
| - | bits 17 & 2 & 3 & 4 & 5 = PaletteSkin | ||
| - | - hver greater/ | ||
| - | - 2 bytes number, Flags | ||
| - | bit 1 = Position | ||
| - | bit 2 = Normal | ||
| - | bit 3 = TexCoord0 | ||
| - | bit 4 = TexCoord1 | ||
| - | bit 5 = TexCoord2 | ||
| - | bit 6 = TexCoord3 | ||
| - | bit 7 = TexCoord4 | ||
| - | bit 8 = TexCoord5 | ||
| - | bit 9 = TexCoord6 | ||
| - | bit 10 = TexCoord7 | ||
| - | bit 11 = PrimaryColor (Color?) | ||
| - | bit 12 = SecondaryColor (Specular?) | ||
| - | bit 13 = Weight | ||
| - | bit 14 = PaletteSkin | ||
| - | bit 15 = Fog | ||
| - | bit 16 = Empty | ||
| - | 0 to NumValue (16), i | ||
| - | - 1 byte number, Type[i] | ||
| - | - 4 bytes number, Number Vertices | ||
| - | - hver greater/ | ||
| - | - 1 byte number, Vertex Color Format | ||
| - | - hver greater/ | ||
| - | - 4 bytes number, index | ||
| - | index in PreferredMemory: | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | - String, Name | ||
| - | - Version, sver | ||
| - | 0 to Number Vertices | ||
| - | 0 to NumValue (16), i | ||
| - | - Flags bit i set | ||
| - | - Type[i] equal 0 | ||
| - | - Double | ||
| - | - Type[i] equal 1 | ||
| - | - Float | ||
| - | - Type[i] equal 2 | ||
| - | - 2 bytes number | ||
| - | - Type[i] equal 3 | ||
| - | - Double | ||
| - | - Double | ||
| - | - Type[i] equal 4 | ||
| - | - Float | ||
| - | - Float | ||
| - | - Type[i] equal 5 | ||
| - | - 2 bytes number | ||
| - | - 2 bytes number | ||
| - | - Type[i] equal 6 | ||
| - | - Double | ||
| - | - Double | ||
| - | - Double | ||
| - | - Type[i] equal 7 | ||
| - | - Float | ||
| - | - Float | ||
| - | - Float | ||
| - | - Type[i] equal 8 | ||
| - | - 2 bytes number | ||
| - | - 2 bytes number | ||
| - | - 2 bytes number | ||
| - | - Type[i] equal 9 | ||
| - | - Double | ||
| - | - Double | ||
| - | - Double | ||
| - | - Double | ||
| - | - Type[i] equal 10 | ||
| - | - Float | ||
| - | - Float | ||
| - | - Float | ||
| - | - Float | ||
| - | - Type[i] equal 11 | ||
| - | - 2 bytes number | ||
| - | - 2 bytes number | ||
| - | - 2 bytes number | ||
| - | - 2 bytes number | ||
| - | - Type[i] equal 12 | ||
| - | - 1 byte number | ||
| - | - 1 byte number | ||
| - | - 1 byte number | ||
| - | - 1 byte number | ||
| - | - sver greater/ | ||
| - | - 1 byte number, UVRouting | ||
| - | - 1 byte number, UVRouting | ||
| - | - 1 byte number, UVRouting | ||
| - | - 1 byte number, UVRouting | ||
| - | - 1 byte number, UVRouting | ||
| - | - 1 byte number, UVRouting | ||
| - | - 1 byte number, UVRouting | ||
| - | - 1 byte number, UVRouting | ||
| - | |||
| - | CMatrixBlock | ||
| - | - Version | ||
| - | 0 to 16 | ||
| - | - 4 bytes number, Matrix Id | ||
| - | - 4 bytes number, Number Matrix | ||
| - | - 4 bytes number, num | ||
| - | 0 to num | ||
| - | - CRdrPass | ||
| - | |||
| - | CAABBox | ||
| - | - Version | ||
| - | - 3DVector, Center | ||
| - | - 3DVector, Half Size | ||
| - | |||
| - | TexEnv (ver) | ||
| - | - 1 byte number, Color Operand | ||
| - | - 1 byte number, Color Argument 0 | ||
| - | - 1 byte number, Color Operand 0 | ||
| - | - 1 byte number, Color Argument 1 | ||
| - | - 1 byte number, Color Operand 1 | ||
| - | - ver greater 0 | ||
| - | - 1 byte number, Color Argument 2 | ||
| - | - 1 byte number, Color Operand 2 | ||
| - | - 1 byte number, Alpha Operand | ||
| - | - 1 byte number, Alpha Argument 0 | ||
| - | - 1 byte number, Alpha Operand 0 | ||
| - | - 1 byte number, Alpha Argument 1 | ||
| - | - 1 byte number, Alpha Operand 1 | ||
| - | - ver greater 0 | ||
| - | - 1 byte number, Alpha Argument 2 | ||
| - | - 1 byte number, Alpha Operand 2 | ||
| - | - RGBA, Constant Color | ||
| - | |||
| - | CLightMap_2 | ||
| - | - Version, ver | ||
| - | - RGBA, Factor | ||
| - | - RGBA, LMCDiffuse | ||
| - | - ver greater/ | ||
| - | - RGBA, LMCAmbient | ||
| - | - PolyPtr, Texture | ||
| - | |||
| - | CLightMap | ||
| - | - RGBA, Factor | ||
| - | - PolyPtr, Texture | ||
| - | |||
| - | CMatrix | ||
| - | - Version, ver | ||
| - | - 4 bytes number, StateBit | ||
| - | - Float, Scale 33 | ||
| - | - StateBit bit for value 2, 4 or 8 set | ||
| - | - Float, Matrix [0][0] | ||
| - | - Float, Matrix [0][1] | ||
| - | - Float, Matrix [0][2] | ||
| - | - Float, Matrix [1][0] | ||
| - | - Float, Matrix [1][1] | ||
| - | - Float, Matrix [1][2] | ||
| - | - Float, Matrix [2][0] | ||
| - | - Float, Matrix [2][1] | ||
| - | - Float, Matrix [2][2] | ||
| - | - StateBit bit for value 1 set | ||
| - | - Float, Matrix [0][3] | ||
| - | - Float, Matrix [1][3] | ||
| - | - Float, Matrix [2][3] | ||
| - | - StateBit bit for value 16 set | ||
| - | - Float, Matrix [3][0] | ||
| - | - Float, Matrix [3][1] | ||
| - | - Float, Matrix [3][2] | ||
| - | - Float, Matrix [3][3] | ||
| - | |||
| - | CAnimatedTexture | ||
| - | - PolyPtr, Texture | ||
| - | |||
| - | CTexAnimTracks | ||
| - | - Version, ver | ||
| - | - Float, Default U Translation | ||
| - | - Float, Default V Translation | ||
| - | - Float, Default U Scale | ||
| - | - Float, Default V Scale | ||
| - | |||
| - | CBlendShape | ||
| - | - Version, ver | ||
| - | - String, Name | ||
| - | - 4 bytes number, Number deltaPos | ||
| - | 0 to Number deltaPos | ||
| - | - 3DVector | ||
| - | - 4 bytes number, Number deltaNorm | ||
| - | 0 to Number deltaNorm | ||
| - | - 3DVector | ||
| - | - 4 bytes number, Number deltaUV | ||
| - | 0 to Number deltaUV | ||
| - | - CUV | ||
| - | - 4 bytes number, Number deltaCol | ||
| - | 0 to Number deltaCol | ||
| - | - CRGBAF | ||
| - | - ver greater/ | ||
| - | - 4 bytes number, Number deltaTgSpace | ||
| - | 0 to Number deltaTgSpace | ||
| - | - 3DVector | ||
| - | - 4 bytes number, Number Vertex References | ||
| - | 0 to Number Vertex References | ||
| - | - 4 bytes number, Vertex Reference | ||
| - | |||
| - | CUV | ||
| - | - Float, u | ||
| - | - Float, v | ||
| - | |||
| - | CPaletteSkin | ||
| - | - 1 byte number, MatrixId 0 | ||
| - | - 1 byte number, MatrixId 1 | ||
| - | - 1 byte number, MatrixId 2 | ||
| - | - 1 byte number, MatrixId 3 | ||
| - | |||
| - | CRdrPass | ||
| - | - Version | ||
| - | - 4 bytes number, MaterialId | ||
| - | - CIndexBuffer | ||
| - | |||
| - | CRGBAF | ||
| - | - Float, R (0 - 1) | ||
| - | - Float, G (0 - 1) | ||
| - | - Float, B (0 - 1) | ||
| - | - Float, A (0 - 1) | ||
| - | |||
| - | CIndexBuffer | ||
| - | - Version, ver | ||
| - | - ver smaller 1 // Primitive block | ||
| - | - 4 bytes number, Number | ||
| - | - 4 bytes number, Capacity | ||
| - | - 4 bytes number, Number Indexes | ||
| - | 0 to Number Indexes | ||
| - | - 4 bytes number, Index | ||
| - | - 4 bytes number, Number | ||
| - | - 4 bytes number, Capacity | ||
| - | - 4 bytes number, Number nonResidentIndexes | ||
| - | 0 to Number nonResidentIndexes | ||
| - | - 4 bytes number, nonResidentIndex | ||
| - | - 4 bytes number, Number | ||
| - | - 4 bytes number, Capacity | ||
| - | - 4 bytes number, Number Indexes | ||
| - | 0 to Number Indexes | ||
| - | - 4 bytes number, Index | ||
| - | - ver greater/ | ||
| - | - 4 bytes number, Number Indexes | ||
| - | - 4 bytes number, Capacity | ||
| - | - 4 bytes number, Number nonResidentIndexes | ||
| - | 0 to Number nonResidentIndexes | ||
| - | - 4 bytes number, nonResidentIndex | ||
| - | - 4 bytes number, index | ||
| - | index in PreferredMemory: | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | - ver equal to 1 | ||
| - | 0 to PreferredCount (5) | ||
| - | - Bool, old Format Memory Preference | ||
| - | </ | ||
| {{tag> | {{tag> | ||





