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{
31 uint numMeshes; // The number of Nvx3Mesh structs
37 uint indexDataSize; // The total byte size of the index data for all meshes
38};
39
50
52{
56
57 uint firstMeshlet; // Offset to first meshlet (optional)
58 uint numMeshlets; // Number of meshlets for this primitive group
59};
60
67
68
76
77namespace Nvx3
78{
79 void FillNvx3Elements(char* basePointer, Nvx3Header* header, Nvx3Elements& OutElements);
80};
81
82#pragma pack(pop)
83
84
85
86namespace Nvx3
87{
88
89//------------------------------------------------------------------------------
92inline void
93FillNvx3Elements(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
Code
index types enum
Definition indextype.h:22
#define n_assert(exp)
Definition debug.h:50
Definition nvx3fileformatstructs.h:78
void FillNvx3Elements(char *basePointer, Nvx3Header *header, Nvx3Elements &OutElements)
Definition nvx3fileformatstructs.h:93
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:70
ubyte * vertexData
Definition nvx3fileformatstructs.h:72
CoreGraphics::Nvx3VertexRange * ranges
Definition nvx3fileformatstructs.h:71
ubyte * indexData
Definition nvx3fileformatstructs.h:73
CoreGraphics::Nvx3Meshlet * meshlets
Definition nvx3fileformatstructs.h:74
Definition nvx3fileformatstructs.h:52
uint numMeshlets
Definition nvx3fileformatstructs.h:58
uint firstIndex
Definition nvx3fileformatstructs.h:54
uint numIndices
Definition nvx3fileformatstructs.h:55
uint firstMeshlet
Definition nvx3fileformatstructs.h:57
uint primType
Definition nvx3fileformatstructs.h:53
NVX3 file format structs.
Definition nvx3fileformatstructs.h:28
uint numMeshlets
Definition nvx3fileformatstructs.h:33
uint vertexDataOffset
Definition nvx3fileformatstructs.h:34
uint indexDataOffset
Definition nvx3fileformatstructs.h:36
uint indexDataSize
Definition nvx3fileformatstructs.h:37
uint vertexDataSize
Definition nvx3fileformatstructs.h:35
uint magic
Definition nvx3fileformatstructs.h:29
uint meshDataOffset
Definition nvx3fileformatstructs.h:30
uint meshletDataOffset
Definition nvx3fileformatstructs.h:32
uint numMeshes
Definition nvx3fileformatstructs.h:31
Definition nvx3fileformatstructs.h:62
uint firstIndex
Definition nvx3fileformatstructs.h:64
uint indexOffset
Definition nvx3fileformatstructs.h:63
uint numIndices
Definition nvx3fileformatstructs.h:65
Definition nvx3fileformatstructs.h:41
uint firstGroupOffset
Definition nvx3fileformatstructs.h:45
CoreGraphics::VertexLayoutType layout
Definition nvx3fileformatstructs.h:48
uint numGroups
Definition nvx3fileformatstructs.h:46
uint baseVertexByteOffset
Definition nvx3fileformatstructs.h:43
uint attributesVertexByteOffset
Definition nvx3fileformatstructs.h:44
CoreGraphics::IndexType::Code indexType
Definition nvx3fileformatstructs.h:47
uint indexByteOffset
Definition nvx3fileformatstructs.h:42
unsigned char ubyte
Definition types.h:34
unsigned int uint
Definition types.h:31