Nebula
Loading...
Searching...
No Matches
nvx3fileformatstructs.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
11#include "core/types.h"
15
16namespace CoreGraphics
17{
18
19#define NEBULA_NVX_MAGICNUMBER 'NVX3'
20
21#pragma pack(push, 1)
22
23//------------------------------------------------------------------------------
28{
30 uint numMeshes; // The number of Nvx3Mesh structs
33 uint indexDataSize; // The total byte size of the index data for all meshes
35};
36
45
47{
51
52 uint firstMeshlet; // Offset to first meshlet (optional)
53 uint numMeshlets; // Number of meshlets for this primitive group
54};
55
62
63
72
73namespace Nvx3
74{
75 void FillNvx3Elements(Nvx3Header* header, Nvx3Elements& OutElements);
76};
77
78#pragma pack(pop)
79
80
81
82namespace Nvx3
83{
84
85//------------------------------------------------------------------------------
88inline void
90{
91 n_assert(header != nullptr);
92 OutElements.ranges = (CoreGraphics::Nvx3VertexRange*)(header + 1);
93 OutElements.groups = (CoreGraphics::Nvx3Group*)(OutElements.ranges + header->numMeshes);
94 OutElements.vertexData = (ubyte*)(OutElements.groups + header->numGroups);
95 OutElements.indexData = (ubyte*)(OutElements.vertexData + header->vertexDataSize);
96 OutElements.meshlets = (CoreGraphics::Nvx3Meshlet*)(OutElements.indexData + header->indexDataSize);
97}
98
99} // namespace Nvx3
100
101} // namespace CoreGraphics
Code
index types enum
Definition indextype.h:22
#define n_assert(exp)
Definition debug.h:50
void FillNvx3Elements(Nvx3Header *header, Nvx3Elements &OutElements)
Definition nvx3fileformatstructs.h:89
Acceleration structures are used to enable ray tracing on the GPU by dividing the scene into a BVH.
Definition accelerationstructure.h:24
VertexLayoutType
Definition vertexlayout.h:49
Definition nvx3fileformatstructs.h:65
ubyte * vertexData
Definition nvx3fileformatstructs.h:68
CoreGraphics::Nvx3Group * groups
Definition nvx3fileformatstructs.h:67
CoreGraphics::Nvx3VertexRange * ranges
Definition nvx3fileformatstructs.h:66
ubyte * indexData
Definition nvx3fileformatstructs.h:69
CoreGraphics::Nvx3Meshlet * meshlets
Definition nvx3fileformatstructs.h:70
Definition nvx3fileformatstructs.h:47
uint numMeshlets
Definition nvx3fileformatstructs.h:53
uint firstIndex
Definition nvx3fileformatstructs.h:49
uint numIndices
Definition nvx3fileformatstructs.h:50
uint firstMeshlet
Definition nvx3fileformatstructs.h:52
uint primType
Definition nvx3fileformatstructs.h:48
NVX3 file format structs.
Definition nvx3fileformatstructs.h:28
uint numGroups
Definition nvx3fileformatstructs.h:31
uint numMeshlets
Definition nvx3fileformatstructs.h:32
uint indexDataSize
Definition nvx3fileformatstructs.h:33
uint vertexDataSize
Definition nvx3fileformatstructs.h:34
uint magic
Definition nvx3fileformatstructs.h:29
uint numMeshes
Definition nvx3fileformatstructs.h:30
Definition nvx3fileformatstructs.h:57
uint firstIndex
Definition nvx3fileformatstructs.h:59
uint indexOffset
Definition nvx3fileformatstructs.h:58
uint numIndices
Definition nvx3fileformatstructs.h:60
Definition nvx3fileformatstructs.h:38
CoreGraphics::VertexLayoutType layout
Definition nvx3fileformatstructs.h:43
uint baseVertexByteOffset
Definition nvx3fileformatstructs.h:40
uint attributesVertexByteOffset
Definition nvx3fileformatstructs.h:41
CoreGraphics::IndexType::Code indexType
Definition nvx3fileformatstructs.h:42
uint indexByteOffset
Definition nvx3fileformatstructs.h:39
unsigned char ubyte
Definition types.h:34
unsigned int uint
Definition types.h:31