Note
|
The latest version of this specification is maintained at https://github.com/ecere/E3D-spec |
The coordinate system for E3D models is left-handed:
-
x is positive to the right
-
y is positive up
-
z is positive going away into the distance
Little-endian throughout (least significant bytes first)
Offset | Block Type | Block Length | Contents | Description |
---|---|---|---|---|
0 |
0x0001 (Version) |
0x0000000C (12) |
E3DF 0x0100 (1, 0) |
E3D Version 1.0 |
12 |
0x1000 (Meshes) |
0x000001B2 (434) |
sub-blocks: Mesh |
1 mesh in this file |
18 |
► 0x1010 (Mesh) |
0x000001AC (428) |
sub-blocks: MeshID, Attributes, TriFaces16, FacesMaterials |
Mesh description |
24 |
►►0x1020 (MeshID) |
0x0000000A (10) |
0x00000001 |
Mesh ID: 1 |
34 |
►► 0x2000 (Attributes) |
0x00000138 (312) |
0x00000018 (24) |
24 vertices, interleaved attributes for each vertex |
44 |
►►► 0x2800 (Interleaved) |
0x0000012E (302) |
0x2010 (Vertices) |
The interleaved attributes contain only (x,y,z) 32-bit floating-point vertices at offset 0 (0 type ends list of attribute types); for a total of 12 bytes per vertex. |
58 |
Vertex data |
(288 bytes) bytes [58..402] |
BF000000,BF000000,BF000000, |
{-0.5,-0.5,-0.5 }, |
Although a cube only has 8 vertices, this cube describes 24 vertices so as to be ready for adding additional attributes such as normals, which will differ depending on which face it is being referenced by (because a cube has faces at a square angle and the normals pointing away from the faces are very different therefore not averaged at the shared vertices / corners). |
||||
346 |
► 0x1030 (TriFaces16) |
0x00000052 (82) |
0x0000000C (12) |
Count of 12 triangle faces described as triplets of indices into attributes |
356 |
Faces data |
(72 bytes) |
0x11, 0x15, 0x14, |
{ 17, 21, 20 }, { 17,20, 16 }, |
428 |
► 0x1040 |
0x00000012 (18) |
0x00000000 (0) |
First face: 0 (indices: × 3) |
446 |
0x3000 (Nodes) |
0x00000016 (22) |
sub-blocks: MeshNode |
1 node in this file |
452 |
► 0x3010 (MeshNode) |
0x00000010 (16) |
sub-blocks: MeshID |
This node references a mesh in the meshes list by ID. |
458 |
►► 0x1020 (MeshID) |
0x0000000A (10) |
0x00000001 (1) |
This references mesh ID 1. |
This version adds normals to the interleaved attributes (with x,y,z packed using 10 bits each).
The floating-point normal values for the normals are (0 is implied for non-specified component values):
{ z = -1.0 }, { z = -1.0 }, { z = -1.0 }, { z = -1.0 },
{ z = 1.0 }, { z = 1.0 }, { z = 1.0 }, { z = 1.0 },
{ x = -1.0 }, { x = 1.0 }, { x = 1.0 }, { x = -1.0 },
{ x = -1.0 }, { x = 1.0 }, { x = 1.0 }, { x = -1.0 },
{ y = -1.0 }, { y = -1.0 }, { y = 1.0 }, { y = 1.0 },
{ y = -1.0 }, { y = -1.0 }, { y = 1.0 }, { y = 1.0 }
This version compresses the data using LZMA (any series of blocks, except the version header block, can be compressed inside an LZMA block). Here the top blocks are compressed in one LZMA block.
Block Type | Value | Description |
---|---|---|
version |
0x0001 |
uint16: major (high), minor (low) |
lzma |
0x0010 |
size: uint16, compressed data |
meshes |
0x1000 |
Section to describe meshes. |
►mesh |
0x1010 |
Describe a single mesh with a unique set of attributes. |
►►meshID |
0x1020 |
(uint) Defines (within mesh) or refers to (within meshNode) a unique ID for the mesh. |
►►meshBBox |
0x1021 |
float: loX, loY, loZ, hiX, hiY, hiZ |
►►meshDuplicateVertices |
0x1022 |
(uint) count; count * 16-bit index of original vertex corresponding to this vertex (e.g., for different normal / texCoord) |
►►attributes |
0x2000 |
uint count (limit of 65,536 vertices, multiple meshes should be used for more); |
►►►vertices |
0x2010 |
3x (x,y,z) 32-bit floats |
►►►verticesDbl |
0x2011 |
3x (x,y,z) 64-bit doubles |
►►►verticesQ |
0x2018 |
3x (x,y,z) 16-bit signed integer (quantized to meshBBox) |
►►►normals |
0x2020 |
3 components (x,y,z) stored as signed 10_10_10_2 format (10 bits per component: -1..1 range mapped to -511..511) |
►►►texCoords |
0x2030 |
Texture coordinates — 2 components (u,v) as 32-bit floats ranging from 0..1 for covering the entire texture (beyond that range for tiling) |
►►►texCoords2 |
0x2031 |
Second set of texture coordinates — 2 components (u,v) as 32-bit floats ranging from 0..1 |
►►►texCoords3 |
0x2032 |
Third set of texture coordinates — 2 components (u,v) as 32-bit floats ranging from 0..1 |
►►►texCoords4 |
0x2033 |
Fourth set of texture coordinates — 2 components (u,v) as 32-bit floats ranging from 0..1 |
►►►texCoords5 |
0x2034 |
Fifth set of texture coordinates — 2 components (u,v) as 32-bit floats ranging from 0..1 |
►►►texCoords6 |
0x2035 |
Sixth set of texture coordinates — 2 components (u,v) as 32-bit floats ranging from 0..1 |
►►►texCoords7 |
0x2036 |
Seventh set of texture coordinates — 2 components (u,v) as 32-bit floats ranging from 0..1 |
►►►texCoords8 |
0x2037 |
Eighth set of texture coordinates — 2 components (u,v) as 32-bit floats ranging from 0..1 |
►►►colors |
0x2070 |
4 components (r,g,b,a) as 8-bit integers (0..1 range mapped to 0..255) |
►►►tangentsSign |
0x2080 |
Tangents as 3 signed components (x,y,z) in 10_10_10_2 format (10 bits per component: -1..1 range mapped to -511..511), with the first extra bit used to indicate sign for re-constructing the co-tangent (orthogonal to normal and tangent) |
►►►tangentsBi |
0x2081 |
Tangents and bi-tangents as 6 components 2x (x,y,z) signed 10_10_10_2 format (10 bits per component: -1..1 range mapped to -511..511) |
►►►boneWeights |
0x2090 |
Skin bone ID and weights at each vertex (excluding as many last vertices as the duplicate vertices count) — count * 1..255 byte bone ID (0 indicating no bone); count * 0..1 weight mapped to 0..255 (max number of bones implied from next offset increment) |
►►►boneWeights2..8 |
0x2091..7 |
Alternative skin bone ID and weights for additional skins |
►►►interleaved |
0x2800 |
Define multiple attributes interleaved |
►►►custom |
0x4000:0x5FFF |
Custom attributes definitions. |
►►triFaces16 |
0x1030 |
Triangles (3 indices per triangles — each unsigned, 16-bit) |
►►triFaces32 |
0x1031 |
Triangles (3 indices per triangles — each unsigned, 32-bit) |
►►facesMaterials |
0x1040 |
Start triangle (uint), count of triangles (uint), material ID (uint) |
►►skin |
0x1050 |
Skinned bones definition |
►►►skinName |
0x1051 |
(String) A name for the skin (optional) |
►►►skinBindMatrix |
0x1052 |
Skin bind matrix to which bone definitions are relative — 4x4 32-bit float |
►►►skinBones |
0x1053 |
Bone definitions — byte number of bones, for each bone: nodeName referencing a node; 4x4 32-bit float inverse bind matrix (relative to skin bind matrix) |
►►►skinBoneWeights |
0x1054 |
byte 0..7: set of bone weights to use for this skin (default to 0 if not present) |
►►parts |
0x1060 |
For each part: |
nodes |
0x3000 |
Section to define nodes instancing meshes, cameras and lights. |
►meshNode |
0x3010 |
A node to instance a mesh. |
►►nodeID |
0x3020 |
(uint) Defines or refers to a node ID. |
►►nodeName |
0x3021 |
(String) Defines or refers to a node name. |
►►scaling |
0x3030 |
Defines scaling transformation for a node as |
►►orientation |
0x3031 |
Defines orientation transformation for a node as |
►►position |
0x3032 |
Defines translation transformation for a node as |
►►skeleton |
0x3040 |
ID of root object node for skeleton (32-bit integer); skeleton name (string). |
►cameraNode |
0x3011 |
Reserved for defining a camera. |
►lightNode |
0x3012 |
Reserved for defining a light. |
materials |
0x8000 |
Section to define materials. |
►material |
0x8010 |
Describes the real-world appearance of this material in the scene. |
►►materialID |
0x8011 |
(uint) Defines the ID for the material |
►►materialName |
0x8012 |
(String) Defines the name of the material. |
►►materialGroup |
0x8013 |
(uint) An ID which can be used to regroup compatible materials where a given map (e.g. phongDiffuseMap) is of identical dimensions, allowing to leverage array textures. |
►►materialFlags |
0x8020 |
bit 0: double-sided (default to true) ; |
►►opacity |
0x8021 |
(float) 1 meaning fully opaque (default); 0 fully transparent |
►►refractionRelIndex |
0x8022 |
(float) Relative refraction index (Default to 1.0) |
►►reflectivity |
0x8023 |
(float) Reflectivity (default to 0.0 — non-reflective) |
►►phongShininess |
0x8024 |
(float) Shininess (Phong Model exponent: sharpness of specular highlight) |
►►diffuse |
0x8030 |
3 floats (r,g,b) Diffuse (default to white) |
►►specular |
0x8031 |
3 floats (r,g,b) Specular (default to diffuse color or white) |
►►emissive |
0x8032 |
3 floats (r,g,b) Emissive (default to black — non-emissive) |
►►ambient |
0x8034 |
3 floats (r,g,b) Ambient (default to diffuse color or white) |
►►emissiveMap |
0x8100 |
Emissive map |
►►normalMap |
0x8101 |
Normal map |
►►heightMap |
0x8102 |
Height displacement map |
►►ambientOcclusionMap |
0x8103 |
Ambient occlusion map |
►►phongDiffuseMap |
0x8200 |
Diffuse & opacity map |
►►phongSpecularMap |
0x8201 |
Specular map |
►►phongAmbientMap |
0x8202 |
Ambient map |
►►pbrRMAlbedo |
0x8300 |
Albedo texture for Roughness/Metalness PBR model |
►►pbrRMRoughnessMetalness |
0x8301 |
Roughness/Metalness texture for Roughness/Metalness PBR model |
►►pbrSpecDiffuseMap |
0x8400 |
Diffuse Map for Specular/Glossiness PBR model |
►►pbrSpecSpecularGlossMap |
0x8401 |
Specular/Glossiness Map for Specular PBR model |
textures |
0x9000 |
Section to define textures. |
►texture |
0x9001 |
Definition of a single texture. |
►►textureID |
0x9002 |
Defines or refers to a sharable texture using a unique ID. |
►►textureName |
0x9003 |
(String) Defines or refers to a sharable texture by name. |
►►texturePNG |
0x9101 |
Embeds a PNG-encoded texture. |
►►textureJPG |
0x9102 |
Embeds a JPEG-encoded texture. |
►►textureJPG2K |
0x9103 |
Embeds a JPEG2000-encoded texture. |
animations |
0xA000 |
Section to define animations. |
►animation |
0xA010 |
Define an animation |
►►animationName |
0xA021 |
(String) Name for animation (optional) |
►►animationFrames |
0xA022 |
(uint) Start, end and default frame for animation |
►►animationTrack |
0xA100 |
An animation frame track — (uint) number of keys; number of keys * (uint) frameNumber; 1-byte bool looping flag; TCBEase and Frame Track Key sub-blocks; nodeID and/or nodeName reference sub-blocks |
►►►frameTCBEase |
0xA110 |
(optional) Tension, continuity, bias and easeFrom / easeTo for each key: 32-bit floats |
►►►ftkRotationOrder |
0xA120 |
(optional) Rotation Order for combining ftkRotationYaw, ftkRotationPitch, ftkRotationRoll; 0: xyz, 1: xzy, 2: yxz, 3: yzx, 4: zxy, 5: zyx (default: zxy) |
►►►ftkPosition |
0xA210 |
Translation — 3 (x,y,z) float positions per key |
►►►ftkScaling |
0xA220 |
Scaling — 3 (x,y,z) float scaling per key |
►►►ftkRotation |
0xA230 |
Rotation — 4 (w,x,y,z) float quaternion orientation per key |
►►►ftkRotationYaw |
0xA240 |
Yaw rotation — float yaw orientation (in degrees) per key |
►►►ftkRotationPitch |
0xA250 |
Pitch rotation — float pitch orientation (in degrees) per key |
►►►ftkRotationRoll |
0xA260 |
Roll rotation — float roll orientation (in degrees) per key |
►►►ftkCameraFieldOfView |
0xA270 |
Camera field of view — float camera field of view (in degrees) per key |
►►►ftkCameraRoll |
0xA280 |
Camera roll — float camera roll (in degrees) per key |
►►►ftkLightHotSpot |
0xA290 |
Light hot spot — float light hot spot (in degrees) per key |
►►►ftkLightFallOff |
0xA2A0 |
Light fall off — float light fall off (in degrees) per key |
►►►ftkLightColor |
0xA2B0 |
Light color — 3 (r,g,b) float 0..1 light color per key |
►►►ftkHide |
0xA2C0 |
Hide node — 1 boolean byte (0: displayed, 1: hidden) per key |
►►►ftkMorph |
0xA300 |
Morph — Reserved for morph definition (per key) |
Note
|
PBR (Physically Based Rendering) textures for Sponza Atrium available from http://www.alexandre-pestana.com/pbr-textures-sponza/ |