Cogs.Core
CogsBin.h
1#pragma once
2#include <glm/vec3.hpp>
3#include <glm/mat4x4.hpp>
4#include <glm/ext/quaternion_float.hpp>
5#include <cstdint>
6#include "Flags.h"
7
8namespace Cogs::Core
9{
10 namespace CogsBin
11 {
12 // COGSBIN file format
13 // ====================
14 //
15 // File layout:
16 // - Header. Contains number of sections in file.
17 // - N instances of SectionInfo, where N is the number of sections in file (see header).
18 // - Section 0
19 // - ...
20 // - Section N-1
21 //
22 // Sections:
23 // Each section is described by its SectionInfo in the beginning of the file. The info
24 // contains the offset inside the file where the section is located, along with its size.
25 // Sections can be compressed or raw on a section-by-section basis. The info tells if the
26 // section is compressed, and what the uncompressed file size is.
27 //
28 // The idea is that if the cogsbin file is used as an archive, it should be simple to only
29 // pay the decompression cost for what is needed, and thus the format allows the free-form
30 // data of models to be placed in different sections.
31 //
32 // Subsections:
33 // Data that corresponds to given structs are stored in sub-sections. Items in the
34 // subsections contains reference into other subsections *within the same section*.
35 //
36 // Currently, the writer only puts subsection into section 0, but the file format doesn't
37 // require this. The reasoning is that the data in subsections is quite small compared to
38 // the free-form data, and compression is more efficient if similar data (e.g. strings)
39 // are grouped. Also, the writer does de-duplication, so shared materials etc. are shared
40 // inside the file as well.
41 //
42 // The 'models' subsection contain the entry point when extracting data, and contains the
43 // list of models contained in the file. Usually there is only one model in the file.
44 //
45 // Free-form data:
46 // Some data, like vertex data, indices, and animation value arrays are stored outside
47 // the subsections.
48 //
49 // **Free-form data offsets:** Data is referenced by an uin64_t, where the upper 16 bits is
50 // the subsection number and the lower 48 contains the offset within the subsection.
51 //
52
53 const uint32_t HeaderMagic = 0xC065C065;
54 const uint32_t Version = 5;
55 const size_t CogsSectionAlignment = 16;
56
57 struct Header
58 {
59 uint32_t magic;
60 uint32_t version;
61 uint64_t fileLength;
62 uint32_t sectionCount;
63 uint32_t unused[3];
64 };
65 static_assert(sizeof(Header) == 4 * 8);
66
67 enum struct Compression : uint32_t
68 {
69 None = 0,
70 ZSTD = 1
71 };
72
73 enum struct SectionType : uint16_t
74 {
75 META = 1<<0,
76 DATA = 1<<1
77 };
78 ENABLE_ENUM_FLAGS(SectionType);
79
81 {
82 uint64_t fileOffset; // Offset in file
83 uint64_t fileSize; // Number of bytes in file (i.e. compressed size)
84 uint64_t uncompressedSize; // Number of bytes when uncompressed.
85 Compression compression; // Compression method.
86 SectionType type;
87 uint16_t subSectionCount;
88 };
89 static_assert(sizeof(SectionInfo) == 4 * 8);
90
91 enum struct SubSectionType: uint32_t
92 {
93 Buffers,
94 ExternalTextures,
95 EmbeddedTextures,
96 SamplerStates,
97 Strings,
98 StringData,
99 Nodes,
100 Transforms,
101 BoundingBoxes,
102 MaterialInstances,
103 Properties,
104 PropertyData,
105 Meshes,
106 VertexStreams,
107 VertexAttributes,
108 Bones,
109 Skeletons,
110 AnimTracks,
111 AnimClips,
112 Models,
113 EnumSize
114 };
115
117 {
118 uint64_t offset;
119 uint32_t size;
120 SubSectionType type;
121 };
122// static_assert(sizeof(SubSection)==
123
124 // enum values matches DXGI_FORMAT
125 enum struct Format : uint16_t {
126 Unknown,
127 R8_UNORM,
128 R8G8_UNORM,
129 R8G8B8_UNORM,
130 R8G8B8A8_UNORM,
131 R16_UNORM,
132 R16G16_UNORM,
133 R16G16B16_UNORM,
134 R16G16B16A16_UNORM,
135 R8_SNORM,
136 R8G8_SNORM,
137 R8G8B8_SNORM,
138 R8G8B8A8_SNORM,
139 R16_SNORM,
140 R16G16_SNORM,
141 R16G16B16_SNORM,
142 R16G16B16A16_SNORM,
143 R8_UINT,
144 R8G8_UINT,
145 R8G8B8_UINT,
146 R8G8B8A8_UINT,
147 R16_UINT,
148 R16G16_UINT,
149 R16G16B16_UINT,
150 R16G16B16A16_UINT,
151 R32_UINT,
152 R32G32_UINT,
153 R32G32B32_UINT,
154 R32G32B32A32_UINT,
155 R8_SINT,
156 R8G8_SINT,
157 R8G8B8_SINT,
158 R8G8B8A8_SINT,
159 R16_SINT,
160 R16G16_SINT,
161 R16G16B16_SINT,
162 R16G16B16A16_SINT,
163 R32_SINT,
164 R32G32_SINT,
165 R32G32B32_SINT,
166 R32G32B32A32_SINT,
167 R16_FLOAT,
168 R16G16_FLOAT,
169 R16G16B16_FLOAT,
170 R16G16B16A16_FLOAT,
171 R32_FLOAT,
172 R32G32_FLOAT,
173 R32G32B32_FLOAT,
174 R32G32B32A32_FLOAT,
175 D16_UNORM,
176 D24_UNORM,
177 D24S8_UNORM,
178 D32_FLOAT,
179 R32_TYPELESS,
180 R16_TYPELESS,
181 R8T,
182 R8G8T,
183 R8G8B8T,
184 R8G8B8A8T,
185 B8G8R8,
186 B8G8R8A8,
187 A8_UNORM,
188 BC1_TYPELESS,
189 BC1_UNORM,
190 BC1_UNORM_SRGB,
191 BC2_TYPELESS,
192 BC2_UNORM,
193 BC2_UNORM_SRGB,
194 BC3_TYPELESS,
195 BC3_UNORM,
196 BC3_UNORM_SRGB,
197 BC4_TYPELESS,
198 BC4_UNORM,
199 BC4_SNORM,
200 BC5_TYPELESS,
201 BC5_UNORM,
202 BC5_SNORM,
203 R8G8B8A8_UNORM_SRGB,
204 R64_FLOAT,
205 R64G64_FLOAT,
206 R64G64B64_FLOAT,
207 R64G65B64A64_FLOAT,
208 EnumSize
209 };
210
211 enum struct DataFormatV4 : uint16_t
212 {
213 Unknown = 0,
214 R8_UNORM,
215 R8G8_UNORM,
216 R8G8B8_UNORM,
217 R8G8B8A8_UNORM,
218 R16_UNORM,
219 R16G16_UNORM,
220 R16G16B16_UNORM,
221 R16G16B16A16_UNORM,
222 R8_SNORM,
223 R8G8_SNORM,
224 R8G8B8_SNORM,
225 R8G8B8A8_SNORM,
226 R16_SNORM,
227 R16G16_SNORM,
228 R16G16B16_SNORM,
229 R16G16B16A16_SNORM,
230 R8_UINT,
231 R8G8_UINT,
232 R8G8B8_UINT,
233 R8G8B8A8_UINT,
234 R16_UINT,
235 R16G16_UINT,
236 R16G16B16_UINT,
237 R16G16B16A16_UINT,
238 R32_UINT,
239 R32G32_UINT,
240 R32G32B32_UINT,
241 R32G32B32A32_UINT,
242 R8_SINT,
243 R8G8_SINT,
244 R8G8B8_SINT,
245 R8G8B8A8_SINT,
246 R16_SINT,
247 R16G16_SINT,
248 R16G16B16_SINT,
249 R16G16B16A16_SINT,
250 R32_SINT,
251 R32G32_SINT,
252 R32G32B32_SINT,
253 R32G32B32A32_SINT,
254 R16_FLOAT,
255 R16G16_FLOAT,
256 R16G16B16_FLOAT,
257 R16G16B16A16_FLOAT,
258 R32_FLOAT,
259 R32G32_FLOAT,
260 R32G32B32_FLOAT,
261 R32G32B32A32_FLOAT,
262 D16_UNORM,
263 D24_UNORM,
264 D24S8_UNORM,
265 D32_FLOAT,
266 R32_TYPELESS,
267 R16_TYPELESS,
268 R8T,
269 R8G8T,
270 R8G8B8T,
271 R8G8B8A8T,
272 B8G8R8,
273 B8G8R8A8,
274 A8_UNORM,
275 BC1_TYPELESS,
276 BC1_UNORM,
277 BC1_UNORM_SRGB,
278 BC2_TYPELESS,
279 BC2_UNORM,
280 BC2_UNORM_SRGB,
281 BC3_TYPELESS,
282 BC3_UNORM,
283 BC3_UNORM_SRGB,
284 BC4_TYPELESS,
285 BC4_UNORM,
286 BC4_SNORM,
287 BC5_TYPELESS,
288 BC5_UNORM,
289 BC5_SNORM,
290 R8G8B8_UNORM_SRGB,
291 R8G8B8A8_UNORM_SRGB,
292 R10G10B10A2_TYPELESS,
293 R10G10B10A2_UNORM,
294 R10G10B10A2_UINT,
295 R11G11B10_FLOAT,
296 R5G6B5_UNORM,
297 R5G5B5A1_UNORM,
298 R4G4B4A4_UNORM,
299 R9G9B9E5_FLOAT,
300 MAT4X4_FLOAT,
301 Format_Size,
302 };
303 static_assert(static_cast<int>(DataFormatV4::Format_Size) == 88);
304
305 enum struct DataFormatV5 : uint16_t
306 {
307 Unknown = 0,
308 R8_UNORM,
309 R8G8_UNORM,
310 R8G8B8_UNORM,
311 R8G8B8A8_UNORM,
312 R16_UNORM,
313 R16G16_UNORM,
314 R16G16B16_UNORM,
315 R16G16B16A16_UNORM,
316 R8_SNORM,
317 R8G8_SNORM,
318 R8G8B8_SNORM,
319 R8G8B8A8_SNORM,
320 R16_SNORM,
321 R16G16_SNORM,
322 R16G16B16_SNORM,
323 R16G16B16A16_SNORM,
324 R8_UINT,
325 R8G8_UINT,
326 R8G8B8_UINT,
327 R8G8B8A8_UINT,
328 R16_UINT,
329 R16G16_UINT,
330 R16G16B16_UINT,
331 R16G16B16A16_UINT,
332 R32_UINT,
333 R32G32_UINT,
334 R32G32B32_UINT,
335 R32G32B32A32_UINT,
336 R8_SINT,
337 R8G8_SINT,
338 R8G8B8_SINT,
339 R8G8B8A8_SINT,
340 R16_SINT,
341 R16G16_SINT,
342 R16G16B16_SINT,
343 R16G16B16A16_SINT,
344 R32_SINT,
345 R32G32_SINT,
346 R32G32B32_SINT,
347 R32G32B32A32_SINT,
348 R16_FLOAT,
349 R16G16_FLOAT,
350 R16G16B16_FLOAT,
351 R16G16B16A16_FLOAT,
352 R32_FLOAT,
353 R32G32_FLOAT,
354 R32G32B32_FLOAT,
355 R32G32B32A32_FLOAT,
356 D16_UNORM,
357 D24_UNORM,
358 D24S8_UNORM,
359 D32_FLOAT,
360 R32_TYPELESS,
361 R16_TYPELESS,
362 R8T,
363 R8G8T,
364 R8G8B8T,
365 R8G8B8A8T,
366 B8G8R8,
367 B8G8R8A8,
368 A8_UNORM,
369 BC1_TYPELESS,
370 BC1_UNORM,
371 BC1_UNORM_SRGB,
372 BC2_TYPELESS,
373 BC2_UNORM,
374 BC2_UNORM_SRGB,
375 BC3_TYPELESS,
376 BC3_UNORM,
377 BC3_UNORM_SRGB,
378 BC4_TYPELESS,
379 BC4_UNORM,
380 BC4_SNORM,
381 BC5_TYPELESS,
382 BC5_UNORM,
383 BC5_SNORM,
384 BC6H_SIGNED_FLOAT_RGB,
385 BC6H_UNSIGNED_FLOAT_RGB,
386 BC7_UNORM_RGBA,
387 BC7_UNORM_SRGBA,
388 PVRTC1_2BPP_UNORM_RGB,
389 PVRTC1_4BPP_UNORM_RGB,
390 PVRTC1_2BPP_UNORM_RGBA,
391 PVRTC1_4BPP_UNORM_RGBA,
392 EAC_BLOCK8_UNSIGNED_FLOAT_R,
393 EAC_BLOCK8_SIGNED_FLOAT_R,
394 EAC_BLOCK16_UNSIGNED_FLOAT_RG,
395 EAC_BLOCK16_SIGNED_FLOAT_RG,
396 ETC2_BLOCK8_UNORM_RGB,
397 ETC2_BLOCK8_UNORM_SRGB,
398 ETC2_BLOCK16_UNORM_RGBA,
399 ETC2_BLOCK16_UNORM_SRGBA,
400 ASTC_4x4_UNORM_RGBA,
401 ASTC_5x4_UNORM_RGBA,
402 ASTC_5x5_UNORM_RGBA,
403 ASTC_6x5_UNORM_RGBA,
404 ASTC_6x6_UNORM_RGBA,
405 ASTC_8x5_UNORM_RGBA,
406 ASTC_8x6_UNORM_RGBA,
407 ASTC_8x8_UNORM_RGBA,
408 ASTC_10x5_UNORM_RGBA,
409 ASTC_10x6_UNORM_RGBA,
410 ASTC_10x8_UNORM_RGBA,
411 ASTC_10x10_UNORM_RGBA,
412 ASTC_12x10_UNORM_RGBA,
413 ASTC_12x12_UNORM_RGBA,
414 ASTC_4x4_UNORM_SRGBA,
415 ASTC_5x4_UNORM_SRGBA,
416 ASTC_5x5_UNORM_SRGBA,
417 ASTC_6x5_UNORM_SRGBA,
418 ASTC_6x6_UNORM_SRGBA,
419 ASTC_8x5_UNORM_SRGBA,
420 ASTC_8x6_UNORM_SRGBA,
421 ASTC_8x8_UNORM_SRGBA,
422 ASTC_10x5_UNORM_SRGBA,
423 ASTC_10x6_UNORM_SRGBA,
424 ASTC_10x8_UNORM_SRGBA,
425 ASTC_10x10_UNORM_SRGBA,
426 ASTC_12x10_UNORM_SRGBA,
427 ASTC_12x12_UNORM_SRGBA,
428 R8G8B8_UNORM_SRGB,
429 R8G8B8A8_UNORM_SRGB,
430 R10G10B10A2_TYPELESS,
431 R10G10B10A2_UNORM,
432 R10G10B10A2_UINT,
433 R11G11B10_FLOAT,
434 R5G6B5_UNORM,
435 R5G5B5A1_UNORM,
436 R4G4B4A4_UNORM,
437 R9G9B9E5_FLOAT,
438 MAT4X4_FLOAT,
439 Format_Size,
440 };
441 static_assert(static_cast<int>(DataFormatV5::Format_Size) == 132);
442
443 enum struct MeshFlags : uint8_t
444 {
445 None = 0,
446 Clockwise = 1<<0,
447 Skinned = 1<<1
448 };
449 ENABLE_ENUM_FLAGS(MeshFlags);
450
451 enum struct PrimitiveType : uint8_t
452 {
453 Unknown = 255,
454 TriangleList = 0,
455 TriangleStrip = 1,
456 LineList = 2,
457 LineStrip = 3,
458 PointList = 4,
459 TriangleListAdjacency = 5,
460 TriangleStripAdjacency = 6,
461 LineListAdjacency = 7,
462 LineStripAdjacency = 8,
463 ControlPoint1PatchList = 9,
464 ControlPoint2PatchList = 10,
465 ControlPoint3PatchList = 11,
466 ControlPoint4PatchList = 12,
467 EnumSize
468 };
469
470 enum struct Semantic : uint8_t
471 {
472 Position = 0,
473 Normal = 1,
474 Color = 2,
475 TexCoord = 3,
476 Tangent = 4,
477 InstanceVector = 5,
478 InstanceMatrix = 6,
479 EnumSize
480 };
481
482 enum struct InputType : uint8_t
483 {
484 PerVertex,
485 PerInstance,
486 EnumSize
487 };
488
489 // Reference to string in string buffer, non-zero terminated.
490 struct String
491 {
492 uint32_t offset;
493 uint32_t length;
494 };
495
497 {
498 float min[3];
499 float max[3];
500 };
501
502 enum struct BufferContentFlags : uint32_t
503 {
504 None = 0,
505 VertexData = 1<<0,
506 IndexData = 1<<1,
507 TextureData = 1<<2,
508 AnimationData = 1<<3,
509 ProcessedData = 1<<4
510 };
511 ENABLE_ENUM_FLAGS(BufferContentFlags);
512
514 struct Buffer
515 {
517 uint32_t size;
518 BufferContentFlags flags;
519 };
520 static_assert(sizeof(Buffer) == 2 * 8);
521
523 {
524 uint16_t offset; // uint16_t Offset from element start
525 Format format; // uint16_t
526 Semantic semantic; // uint8_t
527 uint8_t semanticIndex; // uint8_t
528 uint16_t instanceStepRate; // 0 - vertex input, !0 -> instance stepping = instanceStepRate-1
529 };
530 static_assert(sizeof(VertexAttribute) == 2 * 4);
531
533 {
534 uint32_t buffer;
535 uint32_t offset;
536 uint32_t count;
537 uint32_t firstAttribute;
538 uint32_t attributeCount;
539 uint16_t stride;
540 uint8_t vertexDataType;
541 uint8_t encoding;
542 };
543 static_assert(sizeof(VertexStream) == 3 * 8);
544
545 struct Mesh
546 {
547 uint32_t name;
548 uint32_t boundingBox;
549 uint32_t firstStream;
550 uint8_t streamCount;
551 MeshFlags flags;
552 PrimitiveType primitiveType;
553 };
554 static_assert(sizeof(Mesh) == 4 * 4);
555
556 // Contains one LOD-level of texture data.
557 // - data size deducable from width,height/depth/layers/format
558 struct Level
559 {
560 uint32_t bufferView;
561 uint32_t offset;
562 uint32_t rowStride;
563 uint32_t depthStride;
564 };
565 static_assert(sizeof(Level) == 4 * 4);
566
567 enum struct TextureAddressMode : uint8_t
568 {
569 Clamp,
570 Wrap,
571 Mirror,
572 Border,
573 EnumSize,
574 };
575
576 enum struct TextureFilterMode : uint8_t
577 {
578 MinMagMipPoint,
579 MinMagMipLinear,
580 ComparisonMinMagMipPoint,
581 ComparisonMinMagMipLinear,
582 EnumSize
583 };
584
585 enum struct TextureComparisonFunction : uint8_t
586 {
587 Never,
588 Less,
589 Equal,
590 LessEqual,
591 Greater,
592 NotEqual,
593 GreaterEqual,
594 Always,
595 EnumSize
596 };
597
599 {
600 TextureAddressMode addressModeS;
601 TextureAddressMode addressModeT;
602 TextureAddressMode addressModeW;
603
604 TextureFilterMode filter;
605 TextureComparisonFunction comparisonFunction;
606
607 uint32_t maxAnisotropy;
608 float borderColor[4];
609 };
610 static_assert(sizeof(SamplerState) == 7 * 4);
611
612 // Later, add support for PNG prediction filters so we compress as well as PNG.
613 enum struct TextureEncoding : uint8_t
614 {
615 None,
616 EnumSize
617 };
618
619 enum struct TextureFlags : uint8_t
620 {
621 None,
622 EnumSize
623 };
624
625 enum struct TextureDimensions : uint8_t
626 {
627 Unknown,
628 Buffer,
629 Texture1D,
630 Texture1DArray,
631 Texture2D,
632 Texture2DArray,
633 Texture2DMS,
634 Texture2DMSArray,
635 Texture3D,
636 Texture3DArray,
637 TextureCube,
638 TextureCubeArray,
639 EnumSize
640 };
641
643 {
644 uint32_t buffer;
645 uint32_t offset;
646 uint32_t size;
647 uint32_t name;
648 uint32_t width;
649 uint32_t height;
650 uint32_t depth;
651 uint32_t faces;
652 uint32_t layers;
653 uint32_t samplerState;
654 Format format;
655 TextureEncoding encoding;
656 TextureFlags flags;
657 TextureDimensions dimension;
658 };
659 static_assert(sizeof(EmbeddedTexture) == 12 * 4);
660
662 {
663 uint32_t source;
664 uint32_t samplerState;
665 };
666 static_assert(sizeof(ExternalTexture) == 2 * 4);
667
668 enum struct PropertyKeyType : uint16_t
669 {
670 String,
671 Index,
672 EnumSize
673 };
674
675 enum struct PropertyValueType : uint16_t
676 {
677 Bool,
678 UInt,
679 Float,
680 Float2,
681 Float3,
682 Float4,
683 Variant,
684 Option,
685 ExternalTexture,
686 EmbeddedTexture,
687 EnumSize
688 };
689
690 struct Property
691 {
692 PropertyKeyType keyType;
693 PropertyValueType valueType;
694 uint32_t key;
695 uint32_t value;
696 };
697 static_assert(alignof(Property) == 4);
698
700 {
701 uint32_t material;
702 uint32_t permutation;
703 uint32_t propertyFirst;
704 uint32_t propertyCount;
705 };
706
708 {
709 float m[12];
710
711 size_t hash(size_t hashValue = Cogs::hash()) const {
712 for (const float& f : m) {
713 hashValue = Cogs::hash(f, hashValue);
714 }
715 return hashValue;
716 }
717 };
718 static_assert(sizeof(Transform) == 6 * 8);
719
720
721 enum struct BoneFlags : uint16_t
722 {
723 None = 0,
724 HasOffset = 1<<0,
725 Used = 1<<1,
726 Animated = 1<<2
727 };
728 ENABLE_ENUM_FLAGS(BoneFlags);
729
730 struct Bone
731 {
732 glm::mat4 inverseBindPose;
733 glm::mat4 relative;
734 glm::quat rot;
735 glm::vec3 pos;
736 glm::vec3 scale;
737 uint32_t name;
738 uint16_t parentBone;
739 BoneFlags flags;
740 };
741 static_assert(sizeof(Bone) == 44 * 4);
742
743 struct Skeleton
744 {
745 glm::mat4 bindPose;
746 uint32_t firstBone;
747 uint32_t boneCount;
748 };
749
751 {
752 uint32_t boneIndex;
753 uint32_t buffer;
754 uint32_t translationOffset;
755 uint32_t translationCount;
756 uint32_t rotationOffset;
757 uint32_t rotationCount;
758 uint32_t scaleOffset;
759 uint32_t scaleCount;
760 };
761 static_assert(sizeof(AnimTrack) == 8 * 4);
762
763 struct AnimClip
764 {
765 uint32_t name;
766 float duration;
767 float resolution;
768 uint32_t trackFirst;
769 uint32_t trackCount;
770 };
771
772 struct Node
773 {
774 uint32_t parent;
775 uint32_t name;
776 uint32_t mesh;
778 uint32_t boundingBox;
779 uint32_t transform;
780 PrimitiveType primitiveType;
781 uint32_t vertexFirst;
782 uint32_t vertexCount;
783 };
784
785 struct Model
786 {
787 uint32_t skeleton;
788 uint32_t animClipFirst;
789 uint32_t animClipCount;
790 uint32_t firstNode;
791 uint32_t nodeCount;
792 };
793
794 }
795}
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
@ Normal
Regular shaded rendering.
constexpr size_t hash() noexcept
Simple getter function that returns the initial value for fnv1a hashing.
Definition: HashFunctions.h:62
uint32_t name
Offset into strings subsection of current section.
Definition: CogsBin.h:765
uint32_t boneIndex
Which bone to animate.
Definition: CogsBin.h:752
uint32_t buffer
Offset into bones array.
Definition: CogsBin.h:753
uint32_t name
Offset into strings subsection of current section.
Definition: CogsBin.h:737
uint16_t parentBone
Offset of within range of bones of this skeleton.
Definition: CogsBin.h:738
Generic blob of data.
Definition: CogsBin.h:515
BufferContentFlags flags
Specifies what kind of data present in the buffer.
Definition: CogsBin.h:518
uint32_t size
Size of buffer, in bytes.
Definition: CogsBin.h:517
uint64_t sectionOffset
Raw section pointer: Upper 16 bits is section id, lower 48 is offset inside that section.
Definition: CogsBin.h:516
uint32_t size
Byte size of image data.
Definition: CogsBin.h:646
uint32_t offset
Byte offset within buffer for start of imagte data.
Definition: CogsBin.h:645
uint32_t buffer
Buffer that holds image data, index into buffers.
Definition: CogsBin.h:644
uint32_t bufferView
Index of buffer view with data.
Definition: CogsBin.h:560
uint32_t material
Name of material. Offset into strings subsection of current section.
Definition: CogsBin.h:701
uint32_t propertyCount
Number of properties set in material instance.
Definition: CogsBin.h:704
uint32_t permutation
String with permuation name. Offset into strings subsection of current section.
Definition: CogsBin.h:702
uint32_t propertyFirst
Offset into Properties subsection of current section.
Definition: CogsBin.h:703
uint32_t name
Index of string with name.
Definition: CogsBin.h:547
uint32_t boundingBox
Index of bounding box.
Definition: CogsBin.h:548
uint32_t firstStream
Index of first stream of mesh.
Definition: CogsBin.h:549
uint32_t nodeCount
Number of nodes in model.
Definition: CogsBin.h:791
uint32_t skeleton
Offset into the Skeleton subsection of current section.
Definition: CogsBin.h:787
uint32_t firstNode
Offset of first node into Nodes subsection of current section.
Definition: CogsBin.h:790
PrimitiveType primitiveType
Primitive type to use for this node.
Definition: CogsBin.h:780
uint32_t name
Name of node, offset into Strings subsection.
Definition: CogsBin.h:775
uint32_t vertexFirst
First vertex of mesh to draw.
Definition: CogsBin.h:781
uint32_t boundingBox
Bounding box of node, offset into BoundingBoxes subsection.
Definition: CogsBin.h:778
uint32_t materialInstance
Material instance of node, offset into MaterialInstances subsection.
Definition: CogsBin.h:777
uint32_t mesh
Mesh of node, offset into Meshes subsection.
Definition: CogsBin.h:776
uint32_t vertexCount
Number of vertices to draw.
Definition: CogsBin.h:782
uint32_t parent
Parent node, offset into Nodes subsection.
Definition: CogsBin.h:774
uint32_t transform
Transform of node, offset into Transforms subsection.
Definition: CogsBin.h:779
TextureAddressMode addressModeW
Specifies the addressing mode along the W axis in texture coordinate space.
Definition: CogsBin.h:602
TextureFilterMode filter
Specifies the filter to use for texture sampling.
Definition: CogsBin.h:604
float borderColor[4]
Specifies the border color to apply if the addressing mode is Border and texture coordinates are outs...
Definition: CogsBin.h:608
TextureAddressMode addressModeS
Specifies the addressing mode along the S axis in texture coordinate space.
Definition: CogsBin.h:600
uint32_t maxAnisotropy
Specifies the maximum number of anisotropic samples to use when sampling a texture.
Definition: CogsBin.h:607
TextureComparisonFunction comparisonFunction
Specifies the comparison function to use when applying a comparison sampler.
Definition: CogsBin.h:605
TextureAddressMode addressModeT
Specifies the addressing mode along the T axis in texture coordinate space.
Definition: CogsBin.h:601
uint32_t firstBone
Offset into Bones subsection of current section.
Definition: CogsBin.h:746
uint32_t boneCount
Number of bones in skeleton.
Definition: CogsBin.h:747
Texture flags describing valid usage for a texture object.
Definition: Flags.h:111