Nebula
Toggle main menu visibility
Loading...
Searching...
No Matches
nvx3fileformatstructs.h
Go to the documentation of this file.
1
#pragma once
2
//------------------------------------------------------------------------------
11
#include "
core/types.h
"
12
#include "
coregraphics/indextype.h
"
13
#include "
coregraphics/gpubuffertypes.h
"
14
#include "
coregraphics/vertexlayout.h
"
15
16
namespace
CoreGraphics
17
{
18
19
#define NEBULA_NVX_MAGICNUMBER 'NVX3'
20
21
#pragma pack(push, 1)
22
23
//------------------------------------------------------------------------------
27
struct
Nvx3Header
28
{
29
uint
magic
;
30
uint
meshDataOffset
;
31
uint
numMeshes
;
// The number of Nvx3Mesh structs
32
uint
meshletDataOffset
;
33
uint
numMeshlets
;
34
uint
vertexDataOffset
;
35
uint
vertexDataSize
;
36
uint
indexDataOffset
;
37
uint
indexDataSize
;
// The total byte size of the index data for all meshes
38
};
39
40
struct
Nvx3BBox
41
{
42
float
min
[3];
43
float
max
[3];
44
};
45
46
struct
Nvx3VertexRange
47
{
48
uint
indexByteOffset
;
49
uint
baseVertexByteOffset
;
50
uint
attributesVertexByteOffset
;
51
uint
firstGroupOffset
;
52
uint
numGroups
;
53
// Nvx3BBox boundingBox; TODO: ADD THIS
54
CoreGraphics::IndexType::Code
indexType
;
55
CoreGraphics::VertexLayoutType
layout
;
56
};
57
58
struct
Nvx3Group
59
{
60
uint
primType
;
61
uint
firstIndex
;
62
uint
numIndices
;
63
Nvx3BBox
boundingBox
;
64
65
uint
firstMeshlet
;
// Offset to first meshlet (optional)
66
uint
numMeshlets
;
// Number of meshlets for this primitive group
67
};
68
69
struct
Nvx3Meshlet
70
{
71
uint
indexOffset
;
72
uint
firstIndex
;
73
uint
numIndices
;
74
};
75
76
77
struct
Nvx3Elements
78
{
79
CoreGraphics::Nvx3VertexRange
*
ranges
;
80
ubyte
*
vertexData
;
81
ubyte
*
indexData
;
82
CoreGraphics::Nvx3Meshlet
*
meshlets
;
83
};
84
85
namespace
Nvx3
86
{
87
void
FillNvx3Elements
(
char
* basePointer,
Nvx3Header
* header,
Nvx3Elements
& OutElements);
88
};
89
90
#pragma pack(pop)
91
92
93
94
namespace
Nvx3
95
{
96
97
//------------------------------------------------------------------------------
100
inline
void
101
FillNvx3Elements
(
char
* basePointer,
Nvx3Header
* header,
Nvx3Elements
& OutElements)
102
{
103
n_assert
(header !=
nullptr
);
104
OutElements.
ranges
= (
CoreGraphics::Nvx3VertexRange
*)(basePointer + header->
meshDataOffset
);
105
OutElements.
vertexData
= (
ubyte
*)(basePointer + header->
vertexDataOffset
);
106
OutElements.
indexData
= (
ubyte
*)(basePointer + header->
indexDataOffset
);
107
OutElements.
meshlets
= (
CoreGraphics::Nvx3Meshlet
*)(basePointer + header->
meshletDataOffset
);
108
}
109
110
}
// namespace Nvx3
111
112
}
// namespace CoreGraphics
CoreGraphics::IndexType::Code
Code
index types enum
Definition
indextype.h:22
n_assert
#define n_assert(exp)
Definition
debug.h:58
gpubuffertypes.h
indextype.h
CoreGraphics::Nvx3
Definition
nvx3fileformatstructs.h:86
CoreGraphics::Nvx3::FillNvx3Elements
void FillNvx3Elements(char *basePointer, Nvx3Header *header, Nvx3Elements &OutElements)
Definition
nvx3fileformatstructs.h:101
CoreGraphics
Acceleration structures are used to enable ray tracing on the GPU by dividing the scene into a BVH.
Definition
accelerationstructure.h:24
CoreGraphics::VertexLayoutType
VertexLayoutType
Definition
vertexlayout.h:49
CoreGraphics::Nvx3BBox
Definition
nvx3fileformatstructs.h:41
CoreGraphics::Nvx3BBox::min
float min[3]
Definition
nvx3fileformatstructs.h:42
CoreGraphics::Nvx3BBox::max
float max[3]
Definition
nvx3fileformatstructs.h:43
CoreGraphics::Nvx3Elements
Definition
nvx3fileformatstructs.h:78
CoreGraphics::Nvx3Elements::vertexData
ubyte * vertexData
Definition
nvx3fileformatstructs.h:80
CoreGraphics::Nvx3Elements::ranges
CoreGraphics::Nvx3VertexRange * ranges
Definition
nvx3fileformatstructs.h:79
CoreGraphics::Nvx3Elements::indexData
ubyte * indexData
Definition
nvx3fileformatstructs.h:81
CoreGraphics::Nvx3Elements::meshlets
CoreGraphics::Nvx3Meshlet * meshlets
Definition
nvx3fileformatstructs.h:82
CoreGraphics::Nvx3Group
Definition
nvx3fileformatstructs.h:59
CoreGraphics::Nvx3Group::boundingBox
Nvx3BBox boundingBox
Definition
nvx3fileformatstructs.h:63
CoreGraphics::Nvx3Group::numMeshlets
uint numMeshlets
Definition
nvx3fileformatstructs.h:66
CoreGraphics::Nvx3Group::firstIndex
uint firstIndex
Definition
nvx3fileformatstructs.h:61
CoreGraphics::Nvx3Group::numIndices
uint numIndices
Definition
nvx3fileformatstructs.h:62
CoreGraphics::Nvx3Group::firstMeshlet
uint firstMeshlet
Definition
nvx3fileformatstructs.h:65
CoreGraphics::Nvx3Group::primType
uint primType
Definition
nvx3fileformatstructs.h:60
CoreGraphics::Nvx3Header
NVX3 file format structs.
Definition
nvx3fileformatstructs.h:28
CoreGraphics::Nvx3Header::numMeshlets
uint numMeshlets
Definition
nvx3fileformatstructs.h:33
CoreGraphics::Nvx3Header::vertexDataOffset
uint vertexDataOffset
Definition
nvx3fileformatstructs.h:34
CoreGraphics::Nvx3Header::indexDataOffset
uint indexDataOffset
Definition
nvx3fileformatstructs.h:36
CoreGraphics::Nvx3Header::indexDataSize
uint indexDataSize
Definition
nvx3fileformatstructs.h:37
CoreGraphics::Nvx3Header::vertexDataSize
uint vertexDataSize
Definition
nvx3fileformatstructs.h:35
CoreGraphics::Nvx3Header::magic
uint magic
Definition
nvx3fileformatstructs.h:29
CoreGraphics::Nvx3Header::meshDataOffset
uint meshDataOffset
Definition
nvx3fileformatstructs.h:30
CoreGraphics::Nvx3Header::meshletDataOffset
uint meshletDataOffset
Definition
nvx3fileformatstructs.h:32
CoreGraphics::Nvx3Header::numMeshes
uint numMeshes
Definition
nvx3fileformatstructs.h:31
CoreGraphics::Nvx3Meshlet
Definition
nvx3fileformatstructs.h:70
CoreGraphics::Nvx3Meshlet::firstIndex
uint firstIndex
Definition
nvx3fileformatstructs.h:72
CoreGraphics::Nvx3Meshlet::indexOffset
uint indexOffset
Definition
nvx3fileformatstructs.h:71
CoreGraphics::Nvx3Meshlet::numIndices
uint numIndices
Definition
nvx3fileformatstructs.h:73
CoreGraphics::Nvx3VertexRange
Definition
nvx3fileformatstructs.h:47
CoreGraphics::Nvx3VertexRange::firstGroupOffset
uint firstGroupOffset
Definition
nvx3fileformatstructs.h:51
CoreGraphics::Nvx3VertexRange::layout
CoreGraphics::VertexLayoutType layout
Definition
nvx3fileformatstructs.h:55
CoreGraphics::Nvx3VertexRange::numGroups
uint numGroups
Definition
nvx3fileformatstructs.h:52
CoreGraphics::Nvx3VertexRange::baseVertexByteOffset
uint baseVertexByteOffset
Definition
nvx3fileformatstructs.h:49
CoreGraphics::Nvx3VertexRange::attributesVertexByteOffset
uint attributesVertexByteOffset
Definition
nvx3fileformatstructs.h:50
CoreGraphics::Nvx3VertexRange::indexType
CoreGraphics::IndexType::Code indexType
Definition
nvx3fileformatstructs.h:54
CoreGraphics::Nvx3VertexRange::indexByteOffset
uint indexByteOffset
Definition
nvx3fileformatstructs.h:48
types.h
ubyte
unsigned char ubyte
Definition
types.h:36
uint
unsigned int uint
Definition
types.h:33
vertexlayout.h
code
render
coregraphics
nvx3fileformatstructs.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.