This repository has been archived by the owner on Nov 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDALi-format.txt
229 lines (215 loc) · 7.57 KB
/
DALi-format.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
It is based in the glTF format for future implementation
This format has a JSON structure,
"scene" has the index of the default scene.
"scenes" has an array where points the starting node of scene graph
"nodes"(Actors) is an array, each mode can have:
"name", name of node
"children", the child nodes of this node
"matrix", orientation and position of the node
If "matrix" is defined, "angle" and "position" tags are ignored.
"angle", Vector3: specify "Euler angles", rotate the matrix in X,Y,Z,
in that order (also works for 3D mesh)
"position", Vector3: set the position of node. (also works for 3D mesh)
"size"/"bounds": Vector3: set the size of image/node, can be used the tag "bounds"
with the same result.
"mesh": is the index of the model used
"material", index of material used, default index 0
"shader", index shader used, default index 0
"meshes", an array of "bin" files:
"uri" "bin" filename
Also accepts a special "uri" named "quad" that create a geometry
without "bin" file and contains the quad vertices with texture UV
cordinates only. (Normals and tangents can be hardcoded in shader)
"attributes" attributes used
// bit0, indices
// bit1, positions
// bit2, normals
// bit3, textures
// bit4, tangents
// bit5, bitangents
indices/positions/normals/textures/tangents/bitangents
byteOffset, offset position of the binary file
byteLength, length in bytes of attribute
"materials", an array which contains the texture files(albedo-metal, normal-rough)
"texture1-4": texture files names.
"environment", environment textures used for file, default index 0.
"mipmap", the default value is "false", this flags set if the generation of mipmaps
levels is desired for this textures.
"cameras", array of camera parameters, the default camera used is in index 0
"fov", field of view
If "orthographic" tag is set, "fov" parameter will be ignored.
"orthographic": Vector4: set the view area of an orthographic camera,
[left, right, top, bottom]
"near": the closest value of scene
"far": the far value of scene
"matrix", orientation and position of camera
"animations", it is an array of items, and each item is named, i.e."loaded"; and each item
is an array of animations structure.
animation structure:
"properties":[{
"actor": target actor.
"property": The actor property to animate
"value": value to animate
"alphaFunction": type of interpolation
"timePeriod": { "delay":<float> "duration":<float> }
"relative": boolean, true/false
}]
"loop:" boolean, true/false
EXAMPLE of DALi-format 3D mesh
/////////////////////////////////////
{
"asset" : { "version" : "1.0" },
"scene" : 0,
"scenes" : [ { "nodes" : [ 0 ] } ],
"nodes" : [
{
"name": "cubetest_DAE_001",
"matrix": [0.01, 0, 0, 0, 0, 0.01, 0, 0, 0, 0, 0.01, 0, 0, 0, 0, 1],
"children": [ 1 ]
},
{
"name": "pCube2",
"matrix": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -1.70099, 1],
"mesh": 0,
"children": [ 2 ]
},
{
"name": "pCube1",
"matrix": [1, 0, 0, 0, 0, 0.934389, 0.356254, 0, 0, -0.356254, 0.934389, 0, 0, 0, 1.70099, 1],
"mesh": 1
}
],
"meshes" : [
{
"uri": "testdali.bin",
"attributes": 63,
"indices": { "byteOffset": 0 , "byteLength": 72 },
"positions": { "byteOffset": 72 , "byteLength": 432 },
"normals": { "byteOffset": 504, "byteLength": 432 },
"textures": { "byteOffset": 936, "byteLength": 432 },
"tangents": { "byteOffset": 1368, "byteLength": 432 },
"bitangents": { "byteOffset": 1800, "byteLength": 432}
},
{
"uri": "testdali.bin",
"material": 0,
"shader": 0,
"attributes": 63,
"indices": { "byteOffset": 2232, "byteLength": 72 },
"positions": { "byteOffset": 2304, "byteLength": 432 },
"normals": { "byteOffset": 2736, "byteLength": 432 },
"textures": { "byteOffset": 3168, "byteLength": 432 },
"tangents": { "byteOffset": 3600, "byteLength": 432 },
"bitangents": { "byteOffset": 4032, "byteLength": 432 }
}
],
"cameras" : [
{
"fov": 60.0,
"near": 0.1,
"far": 1000.0,
"position": [0.0, 0.0, 3.5]
}
],
"materials" : [
{
"texture1": "scenes/CityScape_Albedo_Metal.png",
"texture2": "scenes/CityScape_Normal_Rough.png",
"mipmap": true
}
],
"environment" : {
"cubeSpecular": "scenes/EnviromentTest_Radiance.ktx",
"cubeDiffuse": "scenes/EnviromentTest_Irradiance.ktx"
},
"shaders" : [
{
"vertex": "scenes/default_pbr_shader.vsh",
"fragment": "scenes/default_pbr_shader.fsh",
"MaxLOD" : 8
}
]
}
EXAMPLE of DALi-format image based file
///////////////////////////////////////////////////
{
"asset" : { "version" : "1.0" },
"scene" : 0,
"scenes" : [ { "nodes" : [ 0 ] } ],
"nodes" : [
{
"name": "TextTest_001",
"matrix": [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0],
"children": [ 3, 2, 1 ]
},
{
"material": 2,
"mesh": 0,
"position": [ 0.0, 0.0, -0.21]
},
{
"material": 1,
"mesh": 0,
"position": [ 0.0, 0.0, -0.235]
},
{
"material": 0,
"mesh": 0,
"position": [ 0.0, 0.0, -0.24]
}
],
"meshes" : [
{
"uri": "quad"
}
],
"cameras" : [
{
"fov": 59.9999,
"orthographic": [-0.5, 0.5, 0.5, -0.5],
"near": 0.1,
"far": 1000,
"matrix": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
}
],
"materials" : [
{
"texture1": "scenes/Layer_01_Albedo_L.png",
"texture2": "scenes/Layer_01_Metallic_Roughness.png",
"texture3": "scenes/Layer_01_Normal.png",
"environment": 1,
"mipmap": false
},
{
"texture1": "scenes/Layer_02_Albedo_L.png",
"texture2": "scenes/Layer_02_Metallic_Roughness.png",
"texture3": "scenes/Layer_02_Normal.png",
"environment": 1,
"mipmap": false
},
{
"texture1": "scenes/Layer_03_Albedo_L.png",
"texture2": "scenes/Layer_03_Metallic_Roughness.png",
"texture3": "scenes/Layer_03_Normal.png",
"environment": 1,
"mipmap": false
}
],
"environment" : [
{
},
{
"cubeSpecular": "scenes/StudioLight_RAD_003_128_16L.ktx"
}
],
"shaders" : [
{
"vertex": "scenes/default_pbr_3tex.vsh",
"fragment": "scenes/default_pbr_3tex.fsh",
"renderMode":1,
"uDiffuse": [ 0.2, 0.2, 0.2 ],
"uCubeMatrix": [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ],
"maxLOD": 7
}
]
}