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
Nvx3VertexRange
41
{
42
uint
indexByteOffset
;
43
uint
baseVertexByteOffset
;
44
uint
attributesVertexByteOffset
;
45
uint
firstGroupOffset
;
46
uint
numGroups
;
47
CoreGraphics::IndexType::Code
indexType
;
48
CoreGraphics::VertexLayoutType
layout
;
49
};
50
51
struct
Nvx3Group
52
{
53
uint
primType
;
54
uint
firstIndex
;
55
uint
numIndices
;
56
57
uint
firstMeshlet
;
// Offset to first meshlet (optional)
58
uint
numMeshlets
;
// Number of meshlets for this primitive group
59
};
60
61
struct
Nvx3Meshlet
62
{
63
uint
indexOffset
;
64
uint
firstIndex
;
65
uint
numIndices
;
66
};
67
68
69
struct
Nvx3Elements
70
{
71
CoreGraphics::Nvx3VertexRange
*
ranges
;
72
ubyte
*
vertexData
;
73
ubyte
*
indexData
;
74
CoreGraphics::Nvx3Meshlet
*
meshlets
;
75
};
76
77
namespace
Nvx3
78
{
79
void
FillNvx3Elements
(
char
* basePointer,
Nvx3Header
* header,
Nvx3Elements
& OutElements);
80
};
81
82
#pragma pack(pop)
83
84
85
86
namespace
Nvx3
87
{
88
89
//------------------------------------------------------------------------------
92
inline
void
93
FillNvx3Elements
(
char
* basePointer,
Nvx3Header
* header,
Nvx3Elements
& OutElements)
94
{
95
n_assert
(header !=
nullptr
);
96
OutElements.
ranges
= (
CoreGraphics::Nvx3VertexRange
*)(basePointer + header->
meshDataOffset
);
97
OutElements.
vertexData
= (
ubyte
*)(basePointer + header->
vertexDataOffset
);
98
OutElements.
indexData
= (
ubyte
*)(basePointer + header->
indexDataOffset
);
99
OutElements.
meshlets
= (
CoreGraphics::Nvx3Meshlet
*)(basePointer + header->
meshletDataOffset
);
100
}
101
102
}
// namespace Nvx3
103
104
}
// namespace CoreGraphics
CoreGraphics::IndexType::Code
Code
index types enum
Definition
indextype.h:22
n_assert
#define n_assert(exp)
Definition
debug.h:50
gpubuffertypes.h
indextype.h
CoreGraphics::Nvx3
Definition
nvx3fileformatstructs.h:78
CoreGraphics::Nvx3::FillNvx3Elements
void FillNvx3Elements(char *basePointer, Nvx3Header *header, Nvx3Elements &OutElements)
Definition
nvx3fileformatstructs.h:93
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::Nvx3Elements
Definition
nvx3fileformatstructs.h:70
CoreGraphics::Nvx3Elements::vertexData
ubyte * vertexData
Definition
nvx3fileformatstructs.h:72
CoreGraphics::Nvx3Elements::ranges
CoreGraphics::Nvx3VertexRange * ranges
Definition
nvx3fileformatstructs.h:71
CoreGraphics::Nvx3Elements::indexData
ubyte * indexData
Definition
nvx3fileformatstructs.h:73
CoreGraphics::Nvx3Elements::meshlets
CoreGraphics::Nvx3Meshlet * meshlets
Definition
nvx3fileformatstructs.h:74
CoreGraphics::Nvx3Group
Definition
nvx3fileformatstructs.h:52
CoreGraphics::Nvx3Group::numMeshlets
uint numMeshlets
Definition
nvx3fileformatstructs.h:58
CoreGraphics::Nvx3Group::firstIndex
uint firstIndex
Definition
nvx3fileformatstructs.h:54
CoreGraphics::Nvx3Group::numIndices
uint numIndices
Definition
nvx3fileformatstructs.h:55
CoreGraphics::Nvx3Group::firstMeshlet
uint firstMeshlet
Definition
nvx3fileformatstructs.h:57
CoreGraphics::Nvx3Group::primType
uint primType
Definition
nvx3fileformatstructs.h:53
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:62
CoreGraphics::Nvx3Meshlet::firstIndex
uint firstIndex
Definition
nvx3fileformatstructs.h:64
CoreGraphics::Nvx3Meshlet::indexOffset
uint indexOffset
Definition
nvx3fileformatstructs.h:63
CoreGraphics::Nvx3Meshlet::numIndices
uint numIndices
Definition
nvx3fileformatstructs.h:65
CoreGraphics::Nvx3VertexRange
Definition
nvx3fileformatstructs.h:41
CoreGraphics::Nvx3VertexRange::firstGroupOffset
uint firstGroupOffset
Definition
nvx3fileformatstructs.h:45
CoreGraphics::Nvx3VertexRange::layout
CoreGraphics::VertexLayoutType layout
Definition
nvx3fileformatstructs.h:48
CoreGraphics::Nvx3VertexRange::numGroups
uint numGroups
Definition
nvx3fileformatstructs.h:46
CoreGraphics::Nvx3VertexRange::baseVertexByteOffset
uint baseVertexByteOffset
Definition
nvx3fileformatstructs.h:43
CoreGraphics::Nvx3VertexRange::attributesVertexByteOffset
uint attributesVertexByteOffset
Definition
nvx3fileformatstructs.h:44
CoreGraphics::Nvx3VertexRange::indexType
CoreGraphics::IndexType::Code indexType
Definition
nvx3fileformatstructs.h:47
CoreGraphics::Nvx3VertexRange::indexByteOffset
uint indexByteOffset
Definition
nvx3fileformatstructs.h:42
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.